[CMF-checkins] SVN: CMF/trunk/ - modernized adapter registration
Yvo Schubbe
y.2006_ at wcm-solutions.de
Fri Feb 17 12:41:23 EST 2006
Log message for revision 41641:
- modernized adapter registration
Changed:
U CMF/trunk/CMFCore/exportimport/actions.py
U CMF/trunk/CMFCore/exportimport/cachingpolicymgr.py
U CMF/trunk/CMFCore/exportimport/configure.zcml
U CMF/trunk/CMFCore/exportimport/contenttyperegistry.py
U CMF/trunk/CMFCore/exportimport/cookieauth.py
U CMF/trunk/CMFCore/exportimport/properties.py
U CMF/trunk/CMFCore/exportimport/skins.py
U CMF/trunk/CMFCore/exportimport/typeinfo.py
U CMF/trunk/CMFCore/exportimport/workflow.py
U CMF/trunk/DCWorkflow/configure.zcml
U CMF/trunk/DCWorkflow/exportimport.py
-=-
Modified: CMF/trunk/CMFCore/exportimport/actions.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/actions.py 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/CMFCore/exportimport/actions.py 2006-02-17 17:41:23 UTC (rev 41641)
@@ -15,6 +15,9 @@
$Id$
"""
+from zope.component import adapts
+
+from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import exportObjects
from Products.GenericSetup.utils import I18NURI
from Products.GenericSetup.utils import importObjects
@@ -40,7 +43,7 @@
"""Node im- and exporter for ActionCategory.
"""
- __used_for__ = IActionCategory
+ adapts(IActionCategory, ISetupEnviron)
def _exportNode(self):
"""Export the object as a DOM node.
@@ -71,7 +74,7 @@
"""Node im- and exporter for Action.
"""
- __used_for__ = IAction
+ adapts(IAction, ISetupEnviron)
def _exportNode(self):
"""Export the object as a DOM node.
@@ -99,7 +102,7 @@
"""XML im- and exporter for ActionsTool.
"""
- __used_for__ = IActionsTool
+ adapts(IActionsTool, ISetupEnviron)
_LOGGER_ID = 'actions'
Modified: CMF/trunk/CMFCore/exportimport/cachingpolicymgr.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/cachingpolicymgr.py 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/CMFCore/exportimport/cachingpolicymgr.py 2006-02-17 17:41:23 UTC (rev 41641)
@@ -16,10 +16,12 @@
"""
from zope.app import zapi
+from zope.component import adapts
+from Products.GenericSetup.interfaces import INode
+from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import exportObjects
from Products.GenericSetup.utils import importObjects
-from Products.GenericSetup.interfaces import INode
from Products.GenericSetup.utils import NodeAdapterBase
from Products.GenericSetup.utils import XMLAdapterBase
@@ -33,7 +35,7 @@
"""Node im- and exporter for CachingPolicy.
"""
- __used_for__ = ICachingPolicy
+ adapts(ICachingPolicy, ISetupEnviron)
def _exportNode(self):
"""Export the object as a DOM node.
@@ -117,7 +119,7 @@
"""XML im- and exporter for CachingPolicyManager.
"""
- __used_for__ = ICachingPolicyManager
+ adapts(ICachingPolicyManager, ISetupEnviron)
_LOGGER_ID = 'cachingpolicies'
Modified: CMF/trunk/CMFCore/exportimport/configure.zcml
===================================================================
--- CMF/trunk/CMFCore/exportimport/configure.zcml 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/CMFCore/exportimport/configure.zcml 2006-02-17 17:41:23 UTC (rev 41641)
@@ -1,43 +1,7 @@
<configure
- xmlns="http://namespaces.zope.org/zope"
- >
+ xmlns="http://namespaces.zope.org/zope">
<adapter
- factory=".actions.ActionCategoryNodeAdapter"
- provides="Products.GenericSetup.interfaces.INode"
- for="Products.CMFCore.interfaces.IActionCategory
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
-
- <adapter
- factory=".actions.ActionNodeAdapter"
- provides="Products.GenericSetup.interfaces.INode"
- for="Products.CMFCore.interfaces.IAction
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
-
- <adapter
- factory=".actions.ActionsToolXMLAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for="Products.CMFCore.interfaces.IActionsTool
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
-
- <adapter
- factory=".cachingpolicymgr.CachingPolicyNodeAdapter"
- provides="Products.GenericSetup.interfaces.INode"
- for="Products.CMFCore.interfaces.ICachingPolicy
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
-
- <adapter
- factory=".cachingpolicymgr.CachingPolicyManagerXMLAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for="Products.CMFCore.interfaces.ICachingPolicyManager
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
-
- <adapter
factory=".content.StructureFolderWalkingAdapter"
provides="Products.GenericSetup.interfaces.IFilesystemExporter"
for="Products.CMFCore.interfaces.IFolderish"
@@ -49,60 +13,30 @@
for="Products.CMFCore.interfaces.IFolderish"
/>
- <adapter
- factory=".contenttyperegistry.ContentTypeRegistryXMLAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for="Products.CMFCore.interfaces.IContentTypeRegistry
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
+ <adapter factory=".actions.ActionCategoryNodeAdapter"/>
- <adapter
- factory=".cookieauth.CookieCrumblerXMLAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for="Products.CMFCore.interfaces.ICookieCrumbler
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
+ <adapter factory=".actions.ActionNodeAdapter"/>
- <adapter
- factory=".properties.PropertiesXMLAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for="Products.CMFCore.interfaces.ISiteRoot
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
+ <adapter factory=".actions.ActionsToolXMLAdapter"/>
- <adapter
- factory=".skins.DirectoryViewNodeAdapter"
- provides="Products.GenericSetup.interfaces.INode"
- for="Products.CMFCore.interfaces.IDirectoryView
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
+ <adapter factory=".cachingpolicymgr.CachingPolicyNodeAdapter"/>
- <adapter
- factory=".skins.SkinsToolXMLAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for="Products.CMFCore.interfaces.ISkinsTool
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
+ <adapter factory=".cachingpolicymgr.CachingPolicyManagerXMLAdapter"/>
- <adapter
- factory=".typeinfo.TypeInformationXMLAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for="Products.CMFCore.interfaces.ITypeInformation
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
+ <adapter factory=".contenttyperegistry.ContentTypeRegistryXMLAdapter"/>
- <adapter
- factory=".typeinfo.TypesToolXMLAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for="Products.CMFCore.interfaces.ITypesTool
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
+ <adapter factory=".cookieauth.CookieCrumblerXMLAdapter"/>
- <adapter
- factory=".workflow.WorkflowToolXMLAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for="Products.CMFCore.interfaces.IWorkflowTool
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
+ <adapter factory=".properties.PropertiesXMLAdapter"/>
+ <adapter factory=".skins.DirectoryViewNodeAdapter"/>
+
+ <adapter factory=".skins.SkinsToolXMLAdapter"/>
+
+ <adapter factory=".typeinfo.TypeInformationXMLAdapter"/>
+
+ <adapter factory=".typeinfo.TypesToolXMLAdapter"/>
+
+ <adapter factory=".workflow.WorkflowToolXMLAdapter"/>
+
</configure>
Modified: CMF/trunk/CMFCore/exportimport/contenttyperegistry.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/contenttyperegistry.py 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/CMFCore/exportimport/contenttyperegistry.py 2006-02-17 17:41:23 UTC (rev 41641)
@@ -15,6 +15,9 @@
$Id$
"""
+from zope.component import adapts
+
+from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import exportObjects
from Products.GenericSetup.utils import importObjects
from Products.GenericSetup.utils import XMLAdapterBase
@@ -28,7 +31,7 @@
"""XML im- and exporter for ContentTypeRegistry.
"""
- __used_for__ = IContentTypeRegistry
+ adapts(IContentTypeRegistry, ISetupEnviron)
_LOGGER_ID = 'contenttypes'
Modified: CMF/trunk/CMFCore/exportimport/cookieauth.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/cookieauth.py 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/CMFCore/exportimport/cookieauth.py 2006-02-17 17:41:23 UTC (rev 41641)
@@ -15,6 +15,9 @@
$Id$
"""
+from zope.component import adapts
+
+from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import exportObjects
from Products.GenericSetup.utils import importObjects
from Products.GenericSetup.utils import PropertyManagerHelpers
@@ -29,7 +32,7 @@
"""XML im- and exporter for CookieCrumbler.
"""
- __used_for__ = ICookieCrumbler
+ adapts(ICookieCrumbler, ISetupEnviron)
_LOGGER_ID = 'cookies'
Modified: CMF/trunk/CMFCore/exportimport/properties.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/properties.py 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/CMFCore/exportimport/properties.py 2006-02-17 17:41:23 UTC (rev 41641)
@@ -16,8 +16,10 @@
"""
from zope.app import zapi
+from zope.component import adapts
from Products.GenericSetup.interfaces import IBody
+from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import PropertyManagerHelpers
from Products.GenericSetup.utils import XMLAdapterBase
@@ -31,7 +33,7 @@
"""XML im- and exporter for properties.
"""
- __used_for__ = ISiteRoot
+ adapts(ISiteRoot, ISetupEnviron)
_LOGGER_ID = 'properties'
Modified: CMF/trunk/CMFCore/exportimport/skins.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/skins.py 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/CMFCore/exportimport/skins.py 2006-02-17 17:41:23 UTC (rev 41641)
@@ -17,7 +17,9 @@
from Acquisition import aq_inner
from Acquisition import aq_parent
+from zope.component import adapts
+from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import exportObjects
from Products.GenericSetup.utils import importObjects
from Products.GenericSetup.utils import NodeAdapterBase
@@ -35,7 +37,7 @@
"""Node im- and exporter for DirectoryView.
"""
- __used_for__ = IDirectoryView
+ adapts(IDirectoryView, ISetupEnviron)
def _exportNode(self):
"""Export the object as a DOM node.
@@ -57,7 +59,7 @@
"""XML im- and exporter for SkinsTool.
"""
- __used_for__ = ISkinsTool
+ adapts(ISkinsTool, ISetupEnviron)
_LOGGER_ID = 'skins'
Modified: CMF/trunk/CMFCore/exportimport/typeinfo.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/typeinfo.py 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/CMFCore/exportimport/typeinfo.py 2006-02-17 17:41:23 UTC (rev 41641)
@@ -18,7 +18,9 @@
from xml.dom.minidom import parseString
import Products
+from zope.component import adapts
+from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import exportObjects
from Products.GenericSetup.utils import I18NURI
from Products.GenericSetup.utils import importObjects
@@ -36,7 +38,7 @@
"""XML im- and exporter for TypeInformation.
"""
- __used_for__ = ITypeInformation
+ adapts(ITypeInformation, ISetupEnviron)
_LOGGER_ID = 'types'
@@ -208,7 +210,7 @@
"""XML im- and exporter for TypesTool.
"""
- __used_for__ = ITypesTool
+ adapts(ITypesTool, ISetupEnviron)
_LOGGER_ID = 'types'
Modified: CMF/trunk/CMFCore/exportimport/workflow.py
===================================================================
--- CMF/trunk/CMFCore/exportimport/workflow.py 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/CMFCore/exportimport/workflow.py 2006-02-17 17:41:23 UTC (rev 41641)
@@ -16,7 +16,9 @@
"""
import Products
+from zope.component import adapts
+from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import exportObjects
from Products.GenericSetup.utils import importObjects
from Products.GenericSetup.utils import ObjectManagerHelpers
@@ -33,7 +35,7 @@
"""XML im- and exporter for WorkflowTool.
"""
- __used_for__ = IWorkflowTool
+ adapts(IWorkflowTool, ISetupEnviron)
_LOGGER_ID = 'workflow'
Modified: CMF/trunk/DCWorkflow/configure.zcml
===================================================================
--- CMF/trunk/DCWorkflow/configure.zcml 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/DCWorkflow/configure.zcml 2006-02-17 17:41:23 UTC (rev 41641)
@@ -13,11 +13,6 @@
global="False"
/>
- <adapter
- factory=".exportimport.DCWorkflowDefinitionBodyAdapter"
- provides="Products.GenericSetup.interfaces.IBody"
- for=".interfaces.IDCWorkflowDefinition
- Products.GenericSetup.interfaces.ISetupEnviron"
- />
+ <adapter factory=".exportimport.DCWorkflowDefinitionBodyAdapter"/>
</configure>
Modified: CMF/trunk/DCWorkflow/exportimport.py
===================================================================
--- CMF/trunk/DCWorkflow/exportimport.py 2006-02-17 17:23:12 UTC (rev 41640)
+++ CMF/trunk/DCWorkflow/exportimport.py 2006-02-17 17:41:23 UTC (rev 41641)
@@ -22,7 +22,9 @@
from Acquisition import Implicit
from Globals import InitializeClass
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
+from zope.component import adapts
+from Products.GenericSetup.interfaces import ISetupEnviron
from Products.GenericSetup.utils import BodyAdapterBase
from utils import _xmldir
@@ -40,7 +42,7 @@
"""Body im- and exporter for DCWorkflowDefinition.
"""
- __used_for__ = IDCWorkflowDefinition
+ adapts(IDCWorkflowDefinition, ISetupEnviron)
def _exportBody(self):
"""Export the object as a file body.
More information about the CMF-checkins
mailing list