Commit ca41f85c authored by Hanno Schlichting's avatar Hanno Schlichting

Make use of the new zope.container and zope.site packages.

parent cc384419
......@@ -9,8 +9,10 @@ Zope Changes
Restructuring
- Make use of the new zope.container and zope.site packages.
- Updated to newer versions of zope packages. Removed long deprecated
defaultSkin, layer and skin ZCML directives.
layer and skin ZCML directives.
- Disabled the XML export on the UI level - the export functionality
however is still available on the Python level.
......
......@@ -48,8 +48,8 @@ from ZODB.POSException import ConflictError
from zope.interface import implements
from zope.event import notify
from zope.lifecycleevent import ObjectCopiedEvent
from zope.app.container.contained import ObjectMovedEvent
from zope.app.container.contained import notifyContainerModified
from zope.container.contained import ObjectMovedEvent
from zope.container.contained import notifyContainerModified
from OFS.event import ObjectWillBeMovedEvent
from OFS.event import ObjectClonedEvent
......
......@@ -52,10 +52,10 @@ from ZODB.POSException import ConflictError
from zope.interface import implements
from zope.component.interfaces import ComponentLookupError
from zope.event import notify
from zope.app.container.contained import ObjectAddedEvent
from zope.app.container.contained import ObjectRemovedEvent
from zope.app.container.contained import notifyContainerModified
from zope.app.container.interfaces import IContainer
from zope.container.contained import ObjectAddedEvent
from zope.container.contained import ObjectRemovedEvent
from zope.container.contained import notifyContainerModified
from zope.container.interfaces import IContainer
from zope.interface import implements
from OFS.CopySupport import CopyContainer
......
......@@ -24,7 +24,7 @@ from Acquisition import aq_base
from App.class_init import InitializeClass
from DocumentTemplate.sequence import sort
from zope.interface import implements
from zope.app.container.contained import notifyContainerModified
from zope.container.contained import notifyContainerModified
from OFS.interfaces import IOrderedContainer as IOrderedContainer
from OFS.ObjectManager import ObjectManager
......
......@@ -29,8 +29,8 @@ from ZODB.POSException import ConflictError
import zope.component
import zope.interface
import zope.location.interfaces
from zope.app.container.contained import dispatchToSublocations
from zope.app.container.interfaces import IObjectMovedEvent
from zope.container.contained import dispatchToSublocations
from zope.container.interfaces import IObjectMovedEvent
from zope.lifecycleevent.interfaces import IObjectCopiedEvent
deprecatedManageAddDeleteClasses = []
......
......@@ -43,9 +43,9 @@ from Persistence import Persistent
from Products.ZCatalog.Lazy import LazyMap
from ZODB.POSException import ConflictError
from zope.event import notify
from zope.app.container.contained import ObjectAddedEvent
from zope.app.container.contained import ObjectRemovedEvent
from zope.app.container.contained import notifyContainerModified
from zope.container.contained import ObjectAddedEvent
from zope.container.contained import ObjectRemovedEvent
from zope.container.contained import notifyContainerModified
LOG = getLogger('BTreeFolder2')
......
......@@ -30,6 +30,11 @@ from zope.component import getUtility
from zope.component import queryMultiAdapter
from zope.component import queryUtility
from zope.component.interfaces import IFactory
from zope.container.constraints import checkFactory, checkObject
from zope.container.i18n import ZopeMessageFactory as _
from zope.container.interfaces import IContainerNamesContainer
from zope.container.interfaces import INameChooser
from zope.event import notify
from zope.interface import implements
from zope.publisher.interfaces import IPublishTraverse
......@@ -37,10 +42,7 @@ from zope.traversing.browser.absoluteurl import absoluteURL
from zope.exceptions.interfaces import UserError
from zope.lifecycleevent import ObjectCreatedEvent
from zope.app.container.constraints import checkFactory, checkObject
from zope.app.container.i18n import ZopeMessageFactory as _
from zope.app.container.interfaces import IAdding, INameChooser
from zope.app.container.interfaces import IContainerNamesContainer
from zope.app.container.interfaces import IAdding
from zope.app.publisher.browser.menu import getMenu
from zExceptions import BadRequest
......
......@@ -72,7 +72,7 @@
<adapter
for="OFS.interfaces.IObjectManager"
factory=".adding.ObjectManagerNameChooser"
provides="zope.app.container.interfaces.INameChooser"
provides="zope.container.interfaces.INameChooser"
/>
<!-- Menu access -->
......
......@@ -29,8 +29,8 @@ from ZPublisher.BeforeTraverse import registerBeforeTraverse
from ZPublisher.BeforeTraverse import unregisterBeforeTraverse
# Hook up custom component architecture calls
import zope.app.component.hooks
zope.app.component.hooks.setHooks()
from zope.site.hooks import setHooks
setHooks()
def findSite(obj, iface=ISite):
"""Find a site by walking up the object hierarchy, supporting both
......
......@@ -21,7 +21,7 @@ from Products.Five.component.interfaces import IObjectManagerSite
from zope.component.globalregistry import base
from zope.component.persistentregistry import PersistentComponents
from zope.app.component.hooks import clearSite
from zope.site.hooks import setSite
class ObjectManagerSiteView(BrowserView):
......@@ -59,6 +59,6 @@ class ObjectManagerSiteView(BrowserView):
# it can't be found anymore. So, for the rest of this request
# (which will be over in about 20 CPU cycles), already clear
# the local site from the thread local.
clearSite()
setSite()
self.context.setSiteManager(None)
......@@ -6,12 +6,12 @@
<subscriber
for="zope.location.interfaces.ISite
zope.app.publication.interfaces.IBeforeTraverseEvent"
handler="zope.app.component.site.threadSiteSubscriber"
handler="zope.site.site.threadSiteSubscriber"
/>
<subscriber
for="zope.app.publication.interfaces.IEndRequestEvent"
handler="zope.app.component.site.clearThreadSiteSubscriber"
handler="zope.site.site.clearThreadSiteSubscriber"
/>
<browser:page
......
......@@ -18,7 +18,7 @@ Load all of Five's configuration (this is a functional test):
Enable local component lookup hooks:
>>> from zope.app.component.hooks import setHooks
>>> from zope.site.hooks import setHooks
>>> setHooks()
......
......@@ -32,11 +32,6 @@ redefinePermission
Redefine a permission in included ZCML as another one.
skin
----
Declare a skin, consisting of layers.
utility
-------
......@@ -73,11 +68,6 @@ defaultView
Declare the name of the view that should be used for the default when viewing
the object; i.e. when the object is traversed to without a view.
defaultSkin
-----------
Declare the default skin used.
editform
--------
......@@ -88,11 +78,6 @@ addform
Create an add form based on a schema.
layer
-----
Declare a layer.
menu
----
......
......@@ -131,7 +131,7 @@ zcml, so in ``configure.zcml`` we'll add::
...
<subscriber
for="Products.CoolProduct.interfaces.ICoolDocument
zope.app.container.interfaces.IObjectAddedEvent"
zope.container.interfaces.IObjectAddedEvent"
handler="Products.CoolProduct.CoolDocument.addedCoolDocument"
/>
...
......@@ -214,7 +214,7 @@ And replace the subscriber with::
...
<subscriber
for="Products.CoolProduct.interfaces.ICoolDocument
zope.app.container.interfaces.IObjectMovedEvent"
zope.container.interfaces.IObjectMovedEvent"
handler="Products.CoolProduct.CoolDocument.movedCoolDocument"
/>
...
......
......@@ -12,7 +12,7 @@
#
##############################################################################
"""
Use 'structured monkey patching' to enable zope.app.container event sending for
Use 'structured monkey patching' to enable zope.container event sending for
Zope 2 objects.
$Id$
......
......@@ -56,7 +56,7 @@ framework's ones, so ours will be called first. This has the effect that
printed events will be in their "natural" order::
>>> from zope.component.interfaces import IObjectEvent, IRegistrationEvent
>>> from zope.app.container.interfaces import IObjectMovedEvent
>>> from zope.container.interfaces import IObjectMovedEvent
>>> from zope.lifecycleevent.interfaces import IObjectCopiedEvent
>>> from OFS.interfaces import IObjectWillBeMovedEvent
>>> from OFS.interfaces import IObjectClonedEvent
......
......@@ -31,8 +31,8 @@ def savestate(func):
'''
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from zope.app.component.hooks import getSite
from zope.app.component.hooks import setSite
from zope.site.hooks import getSite
from zope.site.hooks import setSite
def wrapped_func(*args, **kw):
sm, site = getSecurityManager(), getSite()
......
......@@ -47,8 +47,8 @@ from ZPublisher.HTTPRangeSupport import HTTPRangeInterface
from zope.interface import implements
from zope.event import notify
from zope.lifecycleevent import ObjectCopiedEvent
from zope.app.container.contained import ObjectMovedEvent
from zope.app.container.contained import notifyContainerModified
from zope.container.contained import ObjectMovedEvent
from zope.container.contained import notifyContainerModified
from webdav.Lockable import LockableItem
from webdav.Lockable import wl_isLockable
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment