[CMF-checkins] SVN: CMF/branches/goldegg-phase-1/ turned things
around: z3 interfaces are now the primary interfaces
Yvo Schubbe
y.2005- at wcm-solutions.de
Sat Sep 24 10:27:06 EDT 2005
Log message for revision 38588:
turned things around: z3 interfaces are now the primary interfaces
(this includes a lot of stuff from tseaver-z3_interfaces-branch)
Changed:
U CMF/branches/goldegg-phase-1/CMFCore/ActionInformation.py
U CMF/branches/goldegg-phase-1/CMFCore/ActionProviderBase.py
U CMF/branches/goldegg-phase-1/CMFCore/ActionsTool.py
U CMF/branches/goldegg-phase-1/CMFCore/CMFCatalogAware.py
U CMF/branches/goldegg-phase-1/CMFCore/CachingPolicyManager.py
U CMF/branches/goldegg-phase-1/CMFCore/CatalogTool.py
U CMF/branches/goldegg-phase-1/CMFCore/ContentTypeRegistry.py
U CMF/branches/goldegg-phase-1/CMFCore/DiscussionTool.py
U CMF/branches/goldegg-phase-1/CMFCore/DynamicType.py
U CMF/branches/goldegg-phase-1/CMFCore/MemberDataTool.py
U CMF/branches/goldegg-phase-1/CMFCore/MembershipTool.py
U CMF/branches/goldegg-phase-1/CMFCore/PortalContent.py
U CMF/branches/goldegg-phase-1/CMFCore/PortalFolder.py
U CMF/branches/goldegg-phase-1/CMFCore/RegistrationTool.py
U CMF/branches/goldegg-phase-1/CMFCore/SkinsContainer.py
U CMF/branches/goldegg-phase-1/CMFCore/SkinsTool.py
U CMF/branches/goldegg-phase-1/CMFCore/TypesTool.py
U CMF/branches/goldegg-phase-1/CMFCore/URLTool.py
U CMF/branches/goldegg-phase-1/CMFCore/UndoTool.py
U CMF/branches/goldegg-phase-1/CMFCore/WorkflowTool.py
D CMF/branches/goldegg-phase-1/CMFCore/bridge.zcml
D CMF/branches/goldegg-phase-1/CMFCore/configure.zcml
D CMF/branches/goldegg-phase-1/CMFCore/implements.zcml
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/CachingPolicyManager.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/ContentTypeRegistry.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/Contentish.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/Discussions.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/DublinCore.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/Dynamic.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/Folderish.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/IOpaqueItems.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/Syndicatable.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/__init__.py
A CMF/branches/goldegg-phase-1/CMFCore/interfaces/_content.py
A CMF/branches/goldegg-phase-1/CMFCore/interfaces/_tools.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_actions.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_catalog.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_discussion.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_memberdata.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_membership.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_metadata.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_properties.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_registration.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_skins.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_types.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_undo.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_url.py
U CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_workflow.py
U CMF/branches/goldegg-phase-1/CMFDefault/DefaultWorkflow.py
U CMF/branches/goldegg-phase-1/CMFDefault/DiscussionItem.py
U CMF/branches/goldegg-phase-1/CMFDefault/DiscussionTool.py
U CMF/branches/goldegg-phase-1/CMFDefault/Document.py
U CMF/branches/goldegg-phase-1/CMFDefault/DublinCore.py
U CMF/branches/goldegg-phase-1/CMFDefault/MembershipTool.py
U CMF/branches/goldegg-phase-1/CMFDefault/MetadataTool.py
U CMF/branches/goldegg-phase-1/CMFDefault/PropertiesTool.py
D CMF/branches/goldegg-phase-1/CMFDefault/bridge.zcml
U CMF/branches/goldegg-phase-1/CMFDefault/configure.zcml
D CMF/branches/goldegg-phase-1/CMFDefault/implements.zcml
U CMF/branches/goldegg-phase-1/CMFDefault/interfaces/Document.py
U CMF/branches/goldegg-phase-1/CMFDefault/interfaces/__init__.py
A CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_content.py
A CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_tools.py
U CMF/branches/goldegg-phase-1/CMFDefault/interfaces/portal_membership.py
U CMF/branches/goldegg-phase-1/CMFSetup/actions.py
D CMF/branches/goldegg-phase-1/CMFSetup/tests/conformance.py
U CMF/branches/goldegg-phase-1/CMFTopic/DateCriteria.py
U CMF/branches/goldegg-phase-1/CMFTopic/ListCriterion.py
U CMF/branches/goldegg-phase-1/CMFTopic/SimpleIntCriterion.py
U CMF/branches/goldegg-phase-1/CMFTopic/SimpleStringCriterion.py
U CMF/branches/goldegg-phase-1/CMFTopic/SortCriterion.py
D CMF/branches/goldegg-phase-1/CMFTopic/configure.zcml
U CMF/branches/goldegg-phase-1/CMFTopic/interfaces/Criterion.py
U CMF/branches/goldegg-phase-1/CMFTopic/interfaces/__init__.py
U CMF/branches/goldegg-phase-1/CMFUid/UniqueIdAnnotationTool.py
U CMF/branches/goldegg-phase-1/CMFUid/UniqueIdGeneratorTool.py
U CMF/branches/goldegg-phase-1/CMFUid/UniqueIdHandlerTool.py
U CMF/branches/goldegg-phase-1/CMFUid/interfaces.py
U CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidannotation.py
U CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidgeneration.py
U CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidhandling.py
U CMF/branches/goldegg-phase-1/DCWorkflow/DCWorkflow.py
D CMF/branches/goldegg-phase-1/DCWorkflow/configure.zcml
-=-
Modified: CMF/branches/goldegg-phase-1/CMFCore/ActionInformation.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/ActionInformation.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/ActionInformation.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -25,11 +25,15 @@
from OFS.SimpleItem import SimpleItem
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from zope.i18nmessageid import MessageID
+from zope.interface import implements
from Expression import Expression
-from interfaces.portal_actions import Action as IAction
-from interfaces.portal_actions import ActionCategory as IActionCategory
-from interfaces.portal_actions import ActionInfo as IActionInfo
+from interfaces import IAction
+from interfaces import IActionCategory
+from interfaces import IActionInfo
+from interfaces.portal_actions import Action as z2IAction
+from interfaces.portal_actions import ActionCategory as z2IActionCategory
+from interfaces.portal_actions import ActionInfo as z2IActionInfo
from permissions import View
from utils import _checkPermission
from utils import _wwwdir
@@ -43,11 +47,12 @@
""" Group of Action objects.
"""
- __implements__ = (IActionCategory, OrderedFolder.__implements__)
+ implements(IActionCategory)
+ __implements__ = (z2IActionCategory, OrderedFolder.__implements__)
meta_type = 'CMF Action Category'
- _product_interfaces = (IActionCategory, IAction)
+ _product_interfaces = (z2IActionCategory, z2IAction)
security = ClassSecurityInfo()
@@ -58,9 +63,9 @@
actions = []
for obj in self.objectValues():
- if IActionCategory.isImplementedBy(obj):
+ if z2IActionCategory.isImplementedBy(obj):
actions.extend( obj.listActions() )
- elif IAction.isImplementedBy(obj):
+ elif z2IAction.isImplementedBy(obj):
actions.append(obj)
return tuple(actions)
@@ -84,7 +89,8 @@
""" Reference to an action.
"""
- __implements__ = IAction
+ implements(IAction)
+ __implements__ = z2IAction
meta_type = 'CMF Action'
i18n_domain = 'cmf_default'
@@ -179,7 +185,8 @@
""" A lazy dictionary for Action infos.
"""
- __implements__ = IActionInfo
+ implements(IActionInfo)
+ __implements__ = z2IActionInfo
__allow_access_to_unprotected_subobjects__ = 1
@@ -265,7 +272,8 @@
of the site. They can be filtered via their conditions.
"""
- __implements__ = IAction
+ implements(IAction)
+ __implements__ = z2IAction
_isActionInformation = 1
__allow_access_to_unprotected_subobjects__ = 1
Modified: CMF/branches/goldegg-phase-1/CMFCore/ActionProviderBase.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/ActionProviderBase.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/ActionProviderBase.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -18,13 +18,15 @@
from AccessControl import ClassSecurityInfo
from Globals import DTMLFile
from Globals import InitializeClass
+from zope.interface import implements
from ActionInformation import ActionInfo
from ActionInformation import ActionInformation
from ActionInformation import getOAI
from exceptions import AccessControl_Unauthorized
from Expression import getExprContext
-from interfaces.portal_actions import ActionProvider as IActionProvider
+from interfaces import IActionProvider
+from interfaces.portal_actions import ActionProvider as z2IActionProvider
from permissions import ManagePortal
from utils import _dtmldir
@@ -33,7 +35,8 @@
""" Provide ActionTabs and management methods for ActionProviders
"""
- __implements__ = IActionProvider
+ implements(IActionProvider)
+ __implements__ = z2IActionProvider
security = ClassSecurityInfo()
Modified: CMF/branches/goldegg-phase-1/CMFCore/ActionsTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/ActionsTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/ActionsTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -20,11 +20,13 @@
from Globals import InitializeClass
from OFS.ObjectManager import IFAwareObjectManager
from OFS.OrderedFolder import OrderedFolder
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
-from interfaces.portal_actions import ActionCategory as IActionCategory
-from interfaces.portal_actions import ActionProvider as IActionProvider
-from interfaces.portal_actions import portal_actions as IActionsTool
+from interfaces import IActionsTool
+from interfaces.portal_actions import ActionCategory as z2IActionCategory
+from interfaces.portal_actions import ActionProvider as z2IActionProvider
+from interfaces.portal_actions import portal_actions as z2IActionsTool
from permissions import ManagePortal
from utils import _dtmldir
from utils import UniqueObject
@@ -38,12 +40,13 @@
to the current user and context.
"""
- __implements__ = (IActionsTool, OrderedFolder.__implements__,
+ implements(IActionsTool)
+ __implements__ = (z2IActionsTool, OrderedFolder.__implements__,
ActionProviderBase.__implements__)
id = 'portal_actions'
meta_type = 'CMF Actions Tool'
- _product_interfaces = (IActionCategory,)
+ _product_interfaces = (z2IActionCategory,)
action_providers = ('portal_types', 'portal_workflow', 'portal_actions')
security = ClassSecurityInfo()
@@ -154,12 +157,12 @@
# Include actions from specific tools.
for provider_name in self.listActionProviders():
provider = getattr(self, provider_name)
- if IActionProvider.isImplementedBy(provider):
+ if z2IActionProvider.isImplementedBy(provider):
actions.extend( provider.listActionInfos(object=object) )
# Include actions from object.
if object is not None:
- if IActionProvider.isImplementedBy(object):
+ if z2IActionProvider.isImplementedBy(object):
actions.extend( object.listActionInfos(object=object) )
# Reorganize the actions by category.
Modified: CMF/branches/goldegg-phase-1/CMFCore/CMFCatalogAware.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/CMFCatalogAware.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/CMFCatalogAware.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -29,7 +29,9 @@
from utils import _getAuthenticatedUser
from utils import getToolByName
-from interfaces.IOpaqueItems import ICallableOpaqueItem
+from interfaces import ICallableOpaqueItem
+from interfaces.IOpaqueItems \
+ import ICallableOpaqueItem as z2ICallableOpaqueItem
class CMFCatalogAware(Base):
"""Mix-in for notifying portal_catalog and portal_workflow
@@ -162,7 +164,8 @@
self_base = aq_base(self)
for name in self_base.__dict__.keys():
obj = getattr(self_base, name)
- if ICallableOpaqueItem.isImplementedBy(obj):
+ if ICallableOpaqueItem.providedBy(obj) \
+ or z2ICallableOpaqueItem.isImplementedBy(obj):
items.append((obj.getId(), obj))
return tuple(items)
Modified: CMF/branches/goldegg-phase-1/CMFCore/CachingPolicyManager.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/CachingPolicyManager.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/CachingPolicyManager.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -24,12 +24,14 @@
from OFS.SimpleItem import SimpleItem
from Products.PageTemplates.Expressions import getEngine
from Products.PageTemplates.Expressions import SecureModuleImporter
+from zope.interface import implements
from permissions import ManagePortal
from permissions import View
from Expression import Expression
+from interfaces import ICachingPolicyManager
from interfaces.CachingPolicyManager \
- import CachingPolicyManager as ICachingPolicyManager
+ import CachingPolicyManager as z2ICachingPolicyManager
from utils import _dtmldir
from utils import getToolByName
@@ -335,7 +337,8 @@
to them from skin methods.
"""
- __implements__ = ICachingPolicyManager
+ implements(ICachingPolicyManager)
+ __implements__ = z2ICachingPolicyManager
id = 'caching_policy_manager'
meta_type = 'CMF Caching Policy Manager'
Modified: CMF/branches/goldegg-phase-1/CMFCore/CatalogTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/CatalogTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/CatalogTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -26,11 +26,14 @@
from Products.ZCTextIndex.Lexicon import Splitter
from Products.ZCTextIndex.Lexicon import StopWordRemover
from Products.ZCTextIndex.ZCTextIndex import PLexicon
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
+from interfaces import ICatalogTool
+from interfaces import IIndexableObjectWrapper
from interfaces.portal_catalog \
- import IndexableObjectWrapper as IIndexableObjectWrapper
-from interfaces.portal_catalog import portal_catalog as ICatalogTool
+ import IndexableObjectWrapper as z2IIndexableObjectWrapper
+from interfaces.portal_catalog import portal_catalog as z2ICatalogTool
from permissions import AccessInactivePortalContent
from permissions import ManagePortal
from permissions import View
@@ -45,7 +48,8 @@
class IndexableObjectWrapper:
- __implements__ = IIndexableObjectWrapper
+ implements(IIndexableObjectWrapper)
+ __implements__ = z2IIndexableObjectWrapper
def __init__(self, vars, ob):
self.__vars = vars
@@ -81,7 +85,8 @@
""" This is a ZCatalog that filters catalog queries.
"""
- __implements__ = (ICatalogTool, ZCatalog.__implements__,
+ implements(ICatalogTool)
+ __implements__ = (z2ICatalogTool, ZCatalog.__implements__,
ActionProviderBase.__implements__)
id = 'portal_catalog'
Modified: CMF/branches/goldegg-phase-1/CMFCore/ContentTypeRegistry.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/ContentTypeRegistry.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/ContentTypeRegistry.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -23,11 +23,14 @@
from Globals import PersistentMapping
from OFS.SimpleItem import SimpleItem
from ZPublisher.mapply import mapply
+from zope.interface import implements
+from interfaces import IContentTypeRegistry
+from interfaces import IContentTypeRegistryPredicate
from interfaces.ContentTypeRegistry \
- import ContentTypeRegistry as IContentTypeRegistry
+ import ContentTypeRegistry as z2IContentTypeRegistry
from interfaces.ContentTypeRegistry \
- import ContentTypeRegistryPredicate as IContentTypeRegistryPredicate
+ import ContentTypeRegistryPredicate as z2IContentTypeRegistryPredicate
from permissions import ManagePortal
from utils import _dtmldir
from utils import getToolByName
@@ -39,7 +42,8 @@
Empty major or minor implies wildcard (all match).
"""
- __implements__ = IContentTypeRegistryPredicate
+ implements(IContentTypeRegistryPredicate)
+ __implements__ = z2IContentTypeRegistryPredicate
major = minor = None
PREDICATE_TYPE = 'major_minor'
@@ -125,7 +129,8 @@
Predicate matching on filename extensions.
"""
- __implements__ = IContentTypeRegistryPredicate
+ implements(IContentTypeRegistryPredicate)
+ __implements__ = z2IContentTypeRegistryPredicate
extensions = None
PREDICATE_TYPE = 'extension'
@@ -189,7 +194,8 @@
also be passed).
"""
- __implements__ = IContentTypeRegistryPredicate
+ implements(IContentTypeRegistryPredicate)
+ __implements__ = z2IContentTypeRegistryPredicate
pattern = None
PREDICATE_TYPE = 'mimetype_regex'
@@ -245,7 +251,8 @@
and 'pattern' can also be passed).
"""
- __implements__ = IContentTypeRegistryPredicate
+ implements(IContentTypeRegistryPredicate)
+ __implements__ = z2IContentTypeRegistryPredicate
pattern = None
PREDICATE_TYPE = 'name_regex'
@@ -319,7 +326,8 @@
Registry for rules which map PUT args to a CMF Type Object.
"""
- __implements__ = IContentTypeRegistry
+ implements(IContentTypeRegistry)
+ __implements__ = z2IContentTypeRegistry
meta_type = 'Content Type Registry'
id = 'content_type_registry'
Modified: CMF/branches/goldegg-phase-1/CMFCore/DiscussionTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/DiscussionTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/DiscussionTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -19,15 +19,18 @@
from Globals import InitializeClass, DTMLFile
from Acquisition import Implicit
from AccessControl import ClassSecurityInfo
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
from permissions import AccessContentsInformation
from permissions import ManagePortal
from permissions import ReplyToItem
from permissions import View
-from interfaces.Discussions import OldDiscussable as IOldDiscussable
+from interfaces import IOldstyleDiscussable
+from interfaces import IOldstyleDiscussionTool
+from interfaces.Discussions import OldDiscussable as z2IOldstyleDiscussable
from interfaces.portal_discussion \
- import oldstyle_portal_discussion as IOldstyleDiscussionTool
+ import oldstyle_portal_discussion as z2IOldstyleDiscussionTool
from utils import _dtmldir
from utils import getToolByName
from utils import UniqueObject
@@ -38,7 +41,8 @@
Adapter for PortalContent to implement "old-style" discussions.
"""
- __implements__ = IOldDiscussable
+ implements(IOldstyleDiscussable)
+ __implements__ = z2IOldstyleDiscussable
_isDiscussable = 1
@@ -112,9 +116,10 @@
return ""
-class DiscussionTool (UniqueObject, SimpleItem, ActionProviderBase):
+class DiscussionTool(UniqueObject, SimpleItem, ActionProviderBase):
- __implements__ = (IOldstyleDiscussionTool,
+ implements(IOldstyleDiscussionTool)
+ __implements__ = (z2IOldstyleDiscussionTool,
ActionProviderBase.__implements__)
id = 'portal_discussion'
Modified: CMF/branches/goldegg-phase-1/CMFCore/DynamicType.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/DynamicType.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/DynamicType.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -19,18 +19,22 @@
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
+from zope.interface import implements
-from interfaces.Dynamic import DynamicType as IDynamicType
+from interfaces import IDynamicType
+from interfaces.Dynamic import DynamicType as z2IDynamicType
from utils import getToolByName
class DynamicType:
+
"""
Mixin for portal content that allows the object to take on
a dynamic type property.
"""
- __implements__ = IDynamicType
+ implements(IDynamicType)
+ __implements__ = z2IDynamicType
portal_type = None
Modified: CMF/branches/goldegg-phase-1/CMFCore/MemberDataTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/MemberDataTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/MemberDataTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -23,11 +23,15 @@
from OFS.PropertyManager import PropertyManager
from OFS.SimpleItem import SimpleItem
from ZPublisher.Converters import type_converters
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
from exceptions import BadRequest
-from interfaces.portal_memberdata import MemberData as IMemberData
-from interfaces.portal_memberdata import portal_memberdata as IMemberDataTool
+from interfaces import IMemberData
+from interfaces import IMemberDataTool
+from interfaces.portal_memberdata import MemberData as z2IMemberData
+from interfaces.portal_memberdata \
+ import portal_memberdata as z2IMemberDataTool
from permissions import ManagePortal
from permissions import SetOwnProperties
from permissions import ViewManagementScreens
@@ -45,7 +49,8 @@
""" This tool wraps user objects, making them act as Member objects.
"""
- __implements__ = (IMemberDataTool, ActionProviderBase.__implements__)
+ implements(IMemberDataTool)
+ __implements__ = (z2IMemberDataTool, ActionProviderBase.__implements__)
id = 'portal_memberdata'
meta_type = 'CMF Member Data Tool'
@@ -247,9 +252,10 @@
pass
-class MemberData (SimpleItem):
+class MemberData(SimpleItem):
- __implements__ = IMemberData
+ implements(IMemberData)
+ __implements__ = z2IMemberData
security = ClassSecurityInfo()
Modified: CMF/branches/goldegg-phase-1/CMFCore/MembershipTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/MembershipTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/MembershipTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -26,12 +26,14 @@
from Globals import PersistentMapping
from OFS.Folder import Folder
from ZODB.POSException import ConflictError
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
from exceptions import AccessControl_Unauthorized
from exceptions import BadRequest
+from interfaces import IMembershipTool
from interfaces.portal_membership \
- import portal_membership as IMembershipTool
+ import portal_membership as z2IMembershipTool
from permissions import AccessContentsInformation
from permissions import ChangeLocalRoles
from permissions import ListPortalMembers
@@ -54,7 +56,8 @@
different way.
"""
- __implements__ = (IMembershipTool, ActionProviderBase.__implements__)
+ implements(IMembershipTool)
+ __implements__ = (z2IMembershipTool, ActionProviderBase.__implements__)
id = 'portal_membership'
meta_type = 'CMF Membership Tool'
Modified: CMF/branches/goldegg-phase-1/CMFCore/PortalContent.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/PortalContent.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/PortalContent.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -19,30 +19,31 @@
from Acquisition import aq_base
from OFS.SimpleItem import SimpleItem
from AccessControl import ClassSecurityInfo
-from webdav.WriteLockInterface import WriteLockInterface
+from webdav.WriteLockInterface import WriteLockInterface as z2IWriteLock
+from zope.interface import implements
-from interfaces.Contentish import Contentish
+from CMFCatalogAware import CMFCatalogAware
from DynamicType import DynamicType
-from CMFCatalogAware import CMFCatalogAware
from exceptions import NotFound
from exceptions import ResourceLockedError
+from interfaces import IContentish
+from interfaces.Contentish import Contentish as z2IContentish
from permissions import FTPAccess
from permissions import View
class PortalContent(DynamicType, CMFCatalogAware, SimpleItem):
- """
- Base class for portal objects.
+ """ Base class for portal objects.
+
Provides hooks for reviewing, indexing, and CMF UI.
Derived classes must implement the interface described in
interfaces/DublinCore.py.
"""
- __implements__ = (Contentish,
- WriteLockInterface,
- DynamicType.__implements__)
+ implements(IContentish)
+ __implements__ = (z2IContentish, z2IWriteLock, DynamicType.__implements__)
isPortalContent = 1
_isPortalContent = 1 # More reliable than 'isPortalContent'.
Modified: CMF/branches/goldegg-phase-1/CMFCore/PortalFolder.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/PortalFolder.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/PortalFolder.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -26,13 +26,15 @@
from Globals import InitializeClass
from OFS.OrderSupport import OrderSupport
from OFS.Folder import Folder
+from zope.interface import implements
from CMFCatalogAware import CMFCatalogAware
from DynamicType import DynamicType
from exceptions import AccessControl_Unauthorized
from exceptions import BadRequest
from exceptions import zExceptions_Unauthorized
-from interfaces.Folderish import Folderish as IFolderish
+from interfaces import IFolderish
+from interfaces.Folderish import Folderish as z2IFolderish
from permissions import AddPortalContent
from permissions import AddPortalFolders
from permissions import ChangeLocalRoles
@@ -97,11 +99,13 @@
class PortalFolderBase(DynamicType, CMFCatalogAware, Folder):
+
"""Base class for portal folder
"""
meta_type = 'Portal Folder Base'
- __implements__ = (IFolderish, DynamicType.__implements__,
+ implements(IFolderish)
+ __implements__ = (z2IFolderish, DynamicType.__implements__,
Folder.__implements__)
security = ClassSecurityInfo()
Modified: CMF/branches/goldegg-phase-1/CMFCore/RegistrationTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/RegistrationTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/RegistrationTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -22,10 +22,12 @@
from Globals import DTMLFile
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
+from interfaces import IRegistrationTool
from interfaces.portal_registration \
- import portal_registration as IRegistrationTool
+ import portal_registration as z2IRegistrationTool
from permissions import AddPortalMember
from permissions import MailForgottenPassword
from permissions import ManagePortal
@@ -42,7 +44,8 @@
""" Create and modify users by making calls to portal_membership.
"""
- __implements__ = (IRegistrationTool, ActionProviderBase.__implements__)
+ implements(IRegistrationTool)
+ __implements__ = (z2IRegistrationTool, ActionProviderBase.__implements__)
id = 'portal_registration'
meta_type = 'CMF Registration Tool'
Modified: CMF/branches/goldegg-phase-1/CMFCore/SkinsContainer.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/SkinsContainer.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/SkinsContainer.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -18,15 +18,18 @@
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
from Globals import InitializeClass
+from zope.interface import implements
from exceptions import SkinPathError
-from interfaces.portal_skins import SkinsContainer as ISkinsContainer
+from interfaces import ISkinsContainer
+from interfaces.portal_skins import SkinsContainer as z2ISkinsContainer
from permissions import AccessContentsInformation
class SkinsContainer:
- __implements__ = ISkinsContainer
+ implements(ISkinsContainer)
+ __implements__ = z2ISkinsContainer
security = ClassSecurityInfo()
Modified: CMF/branches/goldegg-phase-1/CMFCore/SkinsTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/SkinsTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/SkinsTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -27,12 +27,14 @@
from OFS.ObjectManager import REPLACEABLE
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
from Products.PythonScripts.PythonScript import PythonScript
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
from DirectoryView import base_ignore
from DirectoryView import ignore
from DirectoryView import ignore_re
-from interfaces.portal_skins import portal_skins as ISkinsTool
+from interfaces import ISkinsTool
+from interfaces.portal_skins import portal_skins as z2ISkinsTool
from permissions import AccessContentsInformation
from permissions import ManagePortal
from permissions import View
@@ -60,7 +62,8 @@
""" This tool is used to supply skins to a portal.
"""
- __implements__ = (ISkinsTool, SkinsContainer.__implements__,
+ implements(ISkinsTool)
+ __implements__ = (z2ISkinsTool, SkinsContainer.__implements__,
ActionProviderBase.__implements__)
id = 'portal_skins'
Modified: CMF/branches/goldegg-phase-1/CMFCore/TypesTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/TypesTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/TypesTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -30,13 +30,17 @@
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from zLOG import LOG, ERROR
from zope.i18nmessageid import MessageID
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
from exceptions import AccessControl_Unauthorized
from exceptions import BadRequest
from exceptions import zExceptions_Unauthorized
-from interfaces.portal_types import ContentTypeInformation as ITypeInformation
-from interfaces.portal_types import portal_types as ITypesTool
+from interfaces import ITypeInformation
+from interfaces import ITypesTool
+from interfaces.portal_types \
+ import ContentTypeInformation as z2ITypeInformation
+from interfaces.portal_types import portal_types as z2ITypesTool
from permissions import AccessContentsInformation
from permissions import ManagePortal
from permissions import View
@@ -54,6 +58,7 @@
class TypeInformation(SimpleItemWithProperties, ActionProviderBase):
+
"""
Base class for information about a content type.
"""
@@ -444,11 +449,13 @@
class FactoryTypeInformation(TypeInformation):
+
"""
Portal content factory.
"""
- __implements__ = ITypeInformation
+ implements(ITypeInformation)
+ __implements__ = z2ITypeInformation
meta_type = 'Factory-based Type Information'
security = ClassSecurityInfo()
@@ -560,11 +567,13 @@
class ScriptableTypeInformation( TypeInformation ):
+
"""
Invokes a script rather than a factory to create the content.
"""
- __implements__ = ITypeInformation
+ implements(ITypeInformation)
+ __implements__ = z2ITypeInformation
meta_type = 'Scriptable Type Information'
security = ClassSecurityInfo()
@@ -638,15 +647,17 @@
class TypesTool(UniqueObject, IFAwareObjectManager, Folder,
ActionProviderBase):
+
"""
Provides a configurable registry of portal content types.
"""
- __implements__ = (ITypesTool, ActionProviderBase.__implements__)
+ implements(ITypesTool)
+ __implements__ = (z2ITypesTool, ActionProviderBase.__implements__)
id = 'portal_types'
meta_type = 'CMF Types Tool'
- _product_interfaces = (ITypeInformation,)
+ _product_interfaces = (z2ITypeInformation,)
security = ClassSecurityInfo()
Modified: CMF/branches/goldegg-phase-1/CMFCore/URLTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/URLTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/URLTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -21,9 +21,11 @@
from Globals import DTMLFile
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
-from interfaces.portal_url import portal_url as IURLTool
+from interfaces import IURLTool
+from interfaces.portal_url import portal_url as z2IURLTool
from permissions import ManagePortal
from permissions import View
from utils import _dtmldir
@@ -35,7 +37,8 @@
""" CMF URL Tool.
"""
- __implements__ = (IURLTool, ActionProviderBase.__implements__)
+ implements(IURLTool)
+ __implements__ = (z2IURLTool, ActionProviderBase.__implements__)
id = 'portal_url'
meta_type = 'CMF URL Tool'
Modified: CMF/branches/goldegg-phase-1/CMFCore/UndoTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/UndoTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/UndoTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -19,10 +19,12 @@
from Globals import DTMLFile
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
from exceptions import AccessControl_Unauthorized
-from interfaces.portal_undo import portal_undo as IUndoTool
+from interfaces import IUndoTool
+from interfaces.portal_undo import portal_undo as z2IUndoTool
from permissions import ListUndoableChanges
from permissions import ManagePortal
from utils import _checkPermission
@@ -36,7 +38,8 @@
""" This tool is used to undo changes.
"""
- __implements__ = (IUndoTool, ActionProviderBase.__implements__)
+ implements(IUndoTool)
+ __implements__ = (z2IUndoTool, ActionProviderBase.__implements__)
id = 'portal_undo'
meta_type = 'CMF Undo Tool'
Modified: CMF/branches/goldegg-phase-1/CMFCore/WorkflowTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/WorkflowTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/WorkflowTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -24,9 +24,11 @@
from Globals import InitializeClass
from Globals import PersistentMapping
from OFS.Folder import Folder
+from zope.interface import implements
from ActionProviderBase import ActionProviderBase
-from interfaces.portal_workflow import portal_workflow as IWorkflowTool
+from interfaces import IWorkflowTool
+from interfaces.portal_workflow import portal_workflow as z2IWorkflowTool
from permissions import ManagePortal
from utils import _dtmldir
from utils import getToolByName
@@ -60,12 +62,15 @@
class WorkflowTool(UniqueObject, Folder, ActionProviderBase):
+
""" Mediator tool, mapping workflow objects
"""
+
+ implements(IWorkflowTool)
+ __implements__ = (z2IWorkflowTool, ActionProviderBase.__implements__)
+
id = 'portal_workflow'
meta_type = 'CMF Workflow Tool'
- __implements__ = (IWorkflowTool,
- ActionProviderBase.__implements__)
_chains_by_type = None # PersistentMapping
_default_chain = ('default_workflow',)
Deleted: CMF/branches/goldegg-phase-1/CMFCore/bridge.zcml
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/bridge.zcml 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/bridge.zcml 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,233 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/five"
- >
-
- <bridge
- zope2=".interfaces.CachingPolicyManager.CachingPolicyManager"
- package=".interfaces"
- name="ICachingPolicyManager"
- />
-
- <bridge
- zope2=".interfaces.Contentish.Contentish"
- package=".interfaces"
- name="IContentish"
- />
-
- <bridge
- zope2=".interfaces.ContentTypeRegistry.ContentTypeRegistryPredicate"
- package=".interfaces"
- name="IContentTypeRegistryPredicate"
- />
-
- <bridge
- zope2=".interfaces.ContentTypeRegistry.ContentTypeRegistry"
- package=".interfaces"
- name="IContentTypeRegistry"
- />
-
- <bridge
- zope2=".interfaces.Discussions.Discussable"
- package=".interfaces"
- name="IDiscussable"
- />
-
- <bridge
- zope2=".interfaces.Discussions.OldDiscussable"
- package=".interfaces"
- name="IOldstyleDiscussable"
- />
-
- <bridge
- zope2=".interfaces.Discussions.DiscussionResponse"
- package=".interfaces"
- name="IDiscussionResponse"
- />
-
- <bridge
- zope2=".interfaces.DublinCore.DublinCore"
- package=".interfaces"
- name="IDublinCore"
- />
-
- <bridge
- zope2=".interfaces.DublinCore.CatalogableDublinCore"
- package=".interfaces"
- name="ICatalogableDublinCore"
- />
-
- <bridge
- zope2=".interfaces.DublinCore.MutableDublinCore"
- package=".interfaces"
- name="IMutableDublinCore"
- />
-
- <bridge
- zope2=".interfaces.Dynamic.DynamicType"
- package=".interfaces"
- name="IDynamicType"
- />
-
- <bridge
- zope2=".interfaces.Folderish.Folderish"
- package=".interfaces"
- name="IFolderish"
- />
-
- <bridge
- zope2=".interfaces.IOpaqueItems.ICallableOpaqueItem"
- package=".interfaces"
- name="ICallableOpaqueItem"
- />
-
- <bridge
- zope2=".interfaces.IOpaqueItems.ICallableOpaqueItemEvents"
- package=".interfaces"
- name="ICallableOpaqueItemEvents"
- />
-
- <bridge
- zope2=".interfaces.portal_actions.portal_actions"
- package=".interfaces"
- name="IActionsTool"
- />
-
- <bridge
- zope2=".interfaces.portal_actions.ActionProvider"
- package=".interfaces"
- name="IActionProvider"
- />
-
- <bridge
- zope2=".interfaces.portal_actions.ActionCategory"
- package=".interfaces"
- name="IActionCategory"
- />
-
- <bridge
- zope2=".interfaces.portal_actions.Action"
- package=".interfaces"
- name="IAction"
- />
-
- <bridge
- zope2=".interfaces.portal_actions.ActionInfo"
- package=".interfaces"
- name="IActionInfo"
- />
-
- <bridge
- zope2=".interfaces.portal_catalog.portal_catalog"
- package=".interfaces"
- name="ICatalogTool"
- />
-
- <bridge
- zope2=".interfaces.portal_catalog.IndexableObjectWrapper"
- package=".interfaces"
- name="IIndexableObjectWrapper"
- />
-
- <bridge
- zope2=".interfaces.portal_discussion.oldstyle_portal_discussion"
- package=".interfaces"
- name="IOldstyleDiscussionTool"
- />
-
- <bridge
- zope2=".interfaces.portal_discussion.portal_discussion"
- package=".interfaces"
- name="IDiscussionTool"
- />
-
- <bridge
- zope2=".interfaces.portal_memberdata.portal_memberdata"
- package=".interfaces"
- name="IMemberDataTool"
- />
-
- <bridge
- zope2=".interfaces.portal_memberdata.MemberData"
- package=".interfaces"
- name="IMemberData"
- />
-
- <bridge
- zope2=".interfaces.portal_membership.portal_membership"
- package=".interfaces"
- name="IMembershipTool"
- />
-
- <bridge
- zope2=".interfaces.portal_metadata.portal_metadata"
- package=".interfaces"
- name="IMetadataTool"
- />
-
- <bridge
- zope2=".interfaces.portal_properties.portal_properties"
- package=".interfaces"
- name="IPropertiesTool"
- />
-
- <bridge
- zope2=".interfaces.portal_registration.portal_registration"
- package=".interfaces"
- name="IRegistrationTool"
- />
-
- <bridge
- zope2=".interfaces.portal_skins.SkinsContainer"
- package=".interfaces"
- name="ISkinsContainer"
- />
-
- <bridge
- zope2=".interfaces.portal_skins.portal_skins"
- package=".interfaces"
- name="ISkinsTool"
- />
-
- <bridge
- zope2=".interfaces.portal_types.ContentTypeInformation"
- package=".interfaces"
- name="ITypeInformation"
- />
-
- <bridge
- zope2=".interfaces.portal_types.portal_types"
- package=".interfaces"
- name="ITypesTool"
- />
-
- <bridge
- zope2=".interfaces.portal_undo.portal_undo"
- package=".interfaces"
- name="IUndoTool"
- />
-
- <bridge
- zope2=".interfaces.portal_url.portal_url"
- package=".interfaces"
- name="IURLTool"
- />
-
- <bridge
- zope2=".interfaces.portal_workflow.portal_workflow"
- package=".interfaces"
- name="IWorkflowTool"
- />
-
- <bridge
- zope2=".interfaces.portal_workflow.WorkflowDefinition"
- package=".interfaces"
- name="IWorkflowDefinition"
- />
-
- <bridge
- zope2=".interfaces.Syndicatable.Syndicatable"
- package=".interfaces"
- name="ISyndicatable"
- />
-
-</configure>
Deleted: CMF/branches/goldegg-phase-1/CMFCore/configure.zcml
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/configure.zcml 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/configure.zcml 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,9 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/zope"
- >
-
- <include file="bridge.zcml"/>
-
- <include file="implements.zcml"/>
-
-</configure>
Deleted: CMF/branches/goldegg-phase-1/CMFCore/implements.zcml
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/implements.zcml 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/implements.zcml 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,198 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/five"
- >
-
- <!-- ActionInformation -->
-
- <implements
- class=".ActionInformation.ActionCategory"
- interface=".interfaces.IActionCategory"
- />
-
- <implements
- class=".ActionInformation.Action"
- interface=".interfaces.IAction"
- />
-
- <implements
- class=".ActionInformation.ActionInfo"
- interface=".interfaces.IActionInfo"
- />
-
- <implements
- class=".ActionInformation.ActionInformation"
- interface=".interfaces.IAction"
- />
-
- <!-- ActionProviderBase -->
-
- <implements
- class=".ActionProviderBase.ActionProviderBase"
- interface=".interfaces.IActionProvider"
- />
-
- <!-- ActionsTool -->
-
- <implements
- class=".ActionsTool.ActionsTool"
- interface=".interfaces.IActionsTool"
- />
-
- <!-- CachingPolicyManager -->
-
- <implements
- class=".CachingPolicyManager.CachingPolicyManager"
- interface=".interfaces.ICachingPolicyManager"
- />
-
- <!-- CatalogTool -->
-
- <implements
- class=".CatalogTool.IndexableObjectWrapper"
- interface=".interfaces.IIndexableObjectWrapper"
- />
-
- <implements
- class=".CatalogTool.CatalogTool"
- interface=".interfaces.ICatalogTool"
- />
-
- <!-- ContentTypeRegistry -->
-
- <implements
- class=".ContentTypeRegistry.MajorMinorPredicate"
- interface=".interfaces.IContentTypeRegistryPredicate"
- />
-
- <implements
- class=".ContentTypeRegistry.ExtensionPredicate"
- interface=".interfaces.IContentTypeRegistryPredicate"
- />
-
- <implements
- class=".ContentTypeRegistry.MimeTypeRegexPredicate"
- interface=".interfaces.IContentTypeRegistryPredicate"
- />
-
- <implements
- class=".ContentTypeRegistry.NameRegexPredicate"
- interface=".interfaces.IContentTypeRegistryPredicate"
- />
-
- <implements
- class=".ContentTypeRegistry.ContentTypeRegistry"
- interface=".interfaces.IContentTypeRegistry"
- />
-
- <!-- DiscussionTool -->
-
- <implements
- class=".DiscussionTool.OldDiscussable"
- interface=".interfaces.IOldstyleDiscussable"
- />
-
- <implements
- class=".DiscussionTool.DiscussionTool"
- interface=".interfaces.IOldstyleDiscussionTool"
- />
-
- <!-- DynamicType -->
-
- <implements
- class=".DynamicType.DynamicType"
- interface=".interfaces.IDynamicType"
- />
-
- <!-- MemberDataTool -->
-
- <implements
- class=".MemberDataTool.MemberDataTool"
- interface=".interfaces.IMemberDataTool"
- />
-
- <implements
- class=".MemberDataTool.MemberData"
- interface=".interfaces.IMemberData"
- />
-
- <!-- MembershipTool -->
-
- <implements
- class=".MembershipTool.MembershipTool"
- interface=".interfaces.IMembershipTool"
- />
-
- <!-- PortalContent -->
-
- <implements
- class=".PortalContent.PortalContent"
- interface=".interfaces.IContentish"
- />
-
- <!-- PortalFolder -->
-
- <implements
- class=".PortalFolder.PortalFolder"
- interface=".interfaces.IFolderish"
- />
-
- <!-- RegistrationTool -->
-
- <implements
- class=".RegistrationTool.RegistrationTool"
- interface=".interfaces.IRegistrationTool"
- />
-
- <!-- SkinsContainer -->
-
- <implements
- class=".SkinsContainer.SkinsContainer"
- interface=".interfaces.ISkinsContainer"
- />
-
- <!-- SkinsTool -->
-
- <implements
- class=".SkinsTool.SkinsTool"
- interface=".interfaces.ISkinsTool"
- />
-
- <!-- TypesTool -->
-
- <implements
- class=".TypesTool.FactoryTypeInformation"
- interface=".interfaces.ITypeInformation"
- />
-
- <implements
- class=".TypesTool.ScriptableTypeInformation"
- interface=".interfaces.ITypeInformation"
- />
-
- <implements
- class=".TypesTool.TypesTool"
- interface=".interfaces.ITypesTool"
- />
-
- <!-- UndoTool -->
-
- <implements
- class=".UndoTool.UndoTool"
- interface=".interfaces.IUndoTool"
- />
-
- <!-- URLTool -->
-
- <implements
- class=".URLTool.URLTool"
- interface=".interfaces.IURLTool"
- />
-
- <!-- WorkflowTool -->
-
- <implements
- class=".WorkflowTool.WorkflowTool"
- interface=".interfaces.IWorkflowTool"
- />
-
-</configure>
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/CachingPolicyManager.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/CachingPolicyManager.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/CachingPolicyManager.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,21 +15,6 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class CachingPolicyManager(Interface):
- """
- Manage HTTP cache policies for skin methods.
- """
- id = Attribute( 'id', 'Must be set to "caching_policy_manager"' )
-
- def getHTTPCachingHeaders( content, view_method, keywords, time=None ):
- """
- Update HTTP caching headers in REQUEST based on 'content',
- 'view_method', and 'keywords'.
-
- If 'time' is supplied, use it instead of the current time
- (for reliable testing).
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - CachingPolicyManager
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/ContentTypeRegistry.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/ContentTypeRegistry.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/ContentTypeRegistry.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,34 +15,7 @@
$Id$
"""
-from Interface import Interface
-
-
-class ContentTypeRegistryPredicate(Interface):
- """ Express a rule for matching a given name/typ/body.
-
- predicateWidget -- Return a snipped of HTML suitable for editing the
- predicate; the snippet should arrange for values to be marshalled by
- ZPublisher as a ':record', with the ID of the predicate as the name of
- the record.
-
- The registry will call the predictate's 'edit' method, passing the fields
- of the record.
- """
-
- def __call__(name, typ, body):
- """ Return true if the rule matches, else false. """
-
- def getTypeLabel():
- """ Return a human-readable label for the predicate type. """
-
-
-class ContentTypeRegistry(Interface):
- """ Registry for rules which map PUT args to a CMF Type Object. """
-
- def findTypeName(name, typ, body):
- """\
- Perform a lookup over a collection of rules, returning the
- the Type object corresponding to name/typ/body. Return None
- if no match found.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - ContentTypeRegistryPredicate
+# - ContentTypeRegistry
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/Contentish.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/Contentish.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/Contentish.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,24 +15,6 @@
$Id$
"""
-from Interface import Interface
-
-
-class Contentish(Interface):
- """
- General interface for "contentish" items.
-
- These methods need to be implemented by any class that wants to be a
- first-class citizen in the Portal Content world.
-
- PortalContent implements this interface.
- """
-
- def SearchableText():
- """
- SearchableText is called to provide the Catalog with textual
- information about your object. It is a string usually generated
- by concatenating the string attributes of your content class. This
- string can then be used by the catalog to index your document and
- make it findable through the catalog.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - Contentish
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/Discussions.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/Discussions.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/Discussions.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,142 +15,8 @@
$Id$
"""
-from Interface import Interface
-
-
-class Discussable(Interface):
- """ Discussable is the interface for things which can have responses.
- """
-
- def createReply(title, text, Creator=None):
- """
- Create a reply in the proper place.
-
- Permission: Reply to item
- Returns: HTML (directly or via redirect)
- """
-
- def getReplies():
- """
- Return a sequence of the DiscussionResponse objects which are
- associated with this Discussable
-
- Permissions: View
- Returns: sequence of DiscussionResponses
- """
-
- def quotedContents():
- """
- Return this object's contents in a form suitable for inclusion
- as a quote in a response. The default implementation returns
- an empty string. It might be overridden to return a '>' quoted
- version of the item.
- """
-
- def _getReplyResults():
- """
- Return the ZCatalog results that represent this object's replies.
-
- Often, the actual objects are not needed. This is less expensive
- than fetching the objects.
-
- Permissions: View
- Returns: sequence of ZCatalog results representing DiscussionResponses
- """
-
-
-class OldDiscussable(Interface):
- """ Oldstyle discussable interface.
- """
-
- def createReply(title, text, REQUEST, RESPONSE):
- """
- Create a reply in the proper place.
-
- Permission: Reply to item
- Returns: HTML (directly or via redirect)
- """
-
- def getReplyLocationAndID(REQUEST):
- """
- This method determines where a user's reply should be stored, and
- what it's ID should be.
-
- You don't really want to force users to have to select a
- unique ID each time they want to reply to something. The
- present implementation selects a folder in the Member's home
- folder called 'Correspondence' (creating it if it is missing)
- and finds a free ID in that folder.
-
- createReply should use this method to determine what the reply
- it creates should be called, and where it should be placed.
-
- This method (and createReply, I expect) do not really belong in
- this interface. There should be a DiscussionManager singleton
- (probably the portal object itself) which handles this.
-
- Permissions: None assigned
- Returns: 2-tuple, containing the container object, and a string ID.
- """
-
- def getReplyResults():
- """
- Return the ZCatalog results that represent this object's replies.
-
- Often, the actual objects are not needed. This is less expensive
- than fetching the objects.
-
- Permissions: View
- Returns: sequence of ZCatalog results representing DiscussionResponses
- """
-
- def getReplies():
- """
- Return a sequence of the DiscussionResponse objects which are
- associated with this Discussable
-
- Permissions: View
- Returns: sequence of DiscussionResponses
- """
-
- def quotedContents():
- """
- Return this object's contents in a form suitable for inclusion
- as a quote in a response. The default implementation returns
- an empty string. It might be overridden to return a '>' quoted
- version of the item.
- """
-
-
-class DiscussionResponse(Interface):
- """ This interface describes the behaviour of a Discussion Response.
- """
-
- def inReplyTo(REQUEST=None):
- """
- Return the Discussable object which this item is associated with
-
- Permissions: None assigned
- Returns: a Discussable object
- """
-
- def setReplyTo(reply_to):
- """
- Make this object a response to the passed object. (Will also
- accept a path in the form of a string.) If reply_to does not
- support or accept replies, a ValueError will be raised. (This
- does not seem like the right exception.)
-
- Permissions: None assigned
- Returns: None
- """
-
- def parentsInThread(size=0):
- """
- Return the list of object which are this object's parents, from the
- point of view of the threaded discussion. Parents are ordered
- oldest to newest.
-
- If 'size' is not zero, only the closest 'size' parents will be
- returned.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - Discussable
+# - OldDiscussable
+# - DiscussionResponse
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/DublinCore.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/DublinCore.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/DublinCore.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,279 +15,8 @@
$Id$
"""
-from Interface import Interface
-
-
-class DublinCore(Interface):
- """ Dublin Core metadata elements supported by CMF and their semantics.
- """
-
- def Title():
- """ Dublin Core Title element - resource name.
-
- Permission -- View
-
- Returns -- String
- """
-
- def listCreators():
- """ List Dublin Core Creator elements - resource authors.
-
- Depending on the implementation, this returns the full name(s) of the
- author(s) of the content object or their ids.
-
- Permission -- View
-
- Returns -- Sequence of strings
- """
-
- def Creator():
- """ Dublin Core Creator element - resource author.
-
- The first Dublin Core Creator element or an empty string.
-
- Permission -- View
-
- Returns -- String
- """
-
- def Subject():
- """ Dublin Core Subject element - resource keywords.
-
- Return zero or more keywords associated with the content object.
-
- Permission -- View
-
- Returns -- Sequence of strings
- """
-
- def Description():
- """ Dublin Core Description element - resource summary.
-
- Return a natural language description of this object.
-
- Permission -- View
-
- Returns -- String
- """
-
- def Publisher():
- """ Dublin Core Publisher element - resource publisher.
-
- Return full formal name of the entity or person responsible for
- publishing the resource.
-
- Permission -- View
-
- Returns -- String
- """
-
- def listContributors():
- """ Dublin Core Contributor elements - resource collaborators.
-
- Return zero or additional collaborators.
-
- Permission -- View
-
- Returns -- Sequence of strings
- """
-
- def Contributors():
- """ Deprecated alias of listContributors.
-
- 'initial caps' names are reserved for strings.
- """
-
- def Date():
- """ Dublin Core Date element - default date.
-
- Permission -- View
-
- Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
- """
-
- def CreationDate():
- """ Dublin Core Date element - date resource created.
-
- Permission -- View
-
- Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
- """
-
- def EffectiveDate():
- """ Dublin Core Date element - date resource becomes effective.
-
- Permission -- View
-
- Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
- """
-
- def ExpirationDate():
- """ Dublin Core Date element - date resource expires.
-
- Permission -- View
-
- Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
- """
-
- def ModificationDate():
- """ Dublin Core Date element - date resource last modified.
-
- Permission -- View
-
- Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
- """
-
- def Type():
- """ Dublin Core Type element - resource type.
-
- Return a human-readable type name for the resource (perhaps mapped
- from its Zope meta_type).
-
- Permission -- View
-
- Returns -- String
- """
-
- def Format():
- """ Dublin Core Format element - resource format.
-
- Return the resource's MIME type (e.g. 'text/html', 'image/png', etc.).
-
- Permission -- View
-
- Returns -- String
- """
-
- def Identifier():
- """ Dublin Core Identifier element - resource ID.
-
- Returns unique ID (a URL) for the resource.
-
- Permission -- View
-
- Returns -- String
- """
-
- def Language():
- """ Dublin Core Language element - resource language.
-
- Return the RFC language code (e.g. 'en-US', 'pt-BR') for the resource.
-
- Permission -- View
-
- Returns -- String
- """
-
- def Rights():
- """ Dublin Core Rights element - resource copyright.
-
- Return a string describing the intellectual property status, if any,
- of the resource.
-
- Permission -- View
-
- Returns -- String
- """
-
-
-class CatalogableDublinCore(Interface):
- """ Provide Zope-internal date objects for cataloging purposes.
- """
-
- def created():
- """ Dublin Core Date element - date resource created.
-
- Permission -- View
-
- Returns -- DateTime
- """
-
- def effective():
- """ Dublin Core Date element - date resource becomes effective.
-
- Permission -- View
-
- Returns -- DateTime
- """
-
- def expires():
- """ Dublin Core Date element - date resource expires.
-
- Permission -- View
-
- Returns -- DateTime
- """
-
- def modified():
- """ Dublin Core Date element - date resource last modified.
-
- Permission -- View
-
- Returns -- DateTime
- """
-
-
-class MutableDublinCore(Interface):
- """ Update interface for mutable metadata.
- """
-
- def setTitle(title):
- """ Set Dublin Core Title element - resource name.
-
- Permission -- Modify portal content
- """
-
- def setCreators(creators):
- """ Set Dublin Core Creator elements - resource authors.
-
- Permission -- Modify portal content
- """
-
- def setSubject(subject):
- """ Set Dublin Core Subject element - resource keywords.
-
- Permission -- Modify portal content
- """
-
- def setDescription(description):
- """ Set Dublin Core Description element - resource summary.
-
- Permission -- Modify portal content
- """
-
- def setContributors(contributors):
- """ Set Dublin Core Contributor elements - resource collaborators.
-
- Permission -- Modify portal content
- """
-
- def setEffectiveDate(effective_date):
- """ Set Dublin Core Date element - date resource becomes effective.
-
- Permission -- Modify portal content
- """
-
- def setExpirationDate(expiration_date):
- """ Set Dublin Core Date element - date resource expires.
-
- Permission -- Modify portal content
- """
-
- def setFormat(format):
- """ Set Dublin Core Format element - resource format.
-
- Permission -- Modify portal content
- """
-
- def setLanguage(language):
- """ Set Dublin Core Language element - resource language.
-
- Permission -- Modify portal content
- """
-
- def setRights(rights):
- """ Set Dublin Core Rights element - resource copyright.
-
- Permission -- Modify portal content
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - DublinCore
+# - CatalogableDublinCore
+# - MutableDublinCore
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/Dynamic.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/Dynamic.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/Dynamic.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,50 +15,6 @@
$Id$
"""
-from Interface import Interface
-
-
-class DynamicType(Interface):
- """ General interface for dynamic items.
- """
-
- def getPortalTypeName():
- """ Get the portal type name that can be passed to portal_types.
-
- If the object is uninitialized, returns None.
-
- Permission -- Always available
- """
-
- def getTypeInfo():
- """ Get the TypeInformation object specified by the portal type.
-
- A shortcut to 'getTypeInfo' of portal_types.
-
- Permission -- Always available
- """
-
- def getActionInfo(action_chain, check_visibility=0, check_condition=0):
- """ Get an Action info mapping specified by a chain of actions.
-
- A shortcut to 'getActionInfo' of the related TypeInformation object.
-
- Permission -- Always available
- """
-
- def getIcon(relative_to_portal=0):
- """ Get the path to an object's icon.
-
- This method is used in the folder_contents view to generate an
- appropriate icon for the items found in the folder.
-
- If the content item does not define an attribute named "icon"
- this method will return the path "/misc_/dtmldoc.gif", which is
- the icon used for DTML Documents.
-
- If 'relative_to_portal' is true, return only the portion of
- the icon's URL which finds it "within" the portal; otherwise,
- return it as an absolute URL.
-
- Permission -- Always available
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - DynamicType
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/Folderish.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/Folderish.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/Folderish.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,53 +15,6 @@
$Id$
"""
-from Interface import Interface
-
-
-class Folderish(Interface):
- """ General interface for "folderish" items.
- """
-
- def contentItems(filter=None):
- """ List contentish and folderish sub-objects and their IDs.
-
- Provide a filtered view onto 'objectItems', allowing only
- PortalFolders and PortalContent-derivatives to show through.
-
- Permission -- Always available (not publishable)
-
- Returns -- List of (object ID, object) tuples
- """
-
- def contentIds(filter=None):
- """ List IDs of contentish and folderish sub-objects.
-
- Provide a filtered view onto 'objectIds', allowing only PortalFolders
- and PortalContent-derivatives to show through.
-
- Permission -- Always available (not publishable)
-
- Returns -- List of object IDs
- """
-
- def contentValues(filter=None):
- """ List contentish and folderish sub-objects.
-
- Provide a filtered view onto 'objectValues', allowing only
- PortalFolders and PortalContent-derivatives to show through.
-
- Permission -- Always available (not publishable)
-
- Returns -- List of objects
- """
-
- def listFolderContents(contentFilter=None):
- """ List viewable contentish and folderish sub-objects.
-
- Hook around 'contentValues' to let 'folder_contents' be protected.
- Duplicating skip_unauthorized behavior of dtml-in.
-
- Permission -- List folder contents
-
- Returns -- List of objects
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - Folderish
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/IOpaqueItems.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/IOpaqueItems.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/IOpaqueItems.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,46 +15,7 @@
$Id$
"""
-from Interface import Interface
-
-
-class ICallableOpaqueItem(Interface):
-
- """Interface for callable opaque items.
-
- Opaque items are subelements that are contained using something that
- is not an ObjectManager.
-
- On add, copy, move and delete operations a marked opaque items
- 'manage_afterAdd', 'manage_afterClone' and 'manage_beforeDelete' hooks
- get called if available. Unavailable hooks do not throw exceptions.
- """
-
- def __init__(obj, id):
- """Return the opaque item and assign it to 'obj' as attr with 'id'.
- """
-
- def __call__():
- """Return the opaque items value.
- """
-
- def getId():
- """Return the id of the opaque item.
- """
-
-class ICallableOpaqueItemEvents(Interface):
-
- """CMF specific events upon copying, renaming and deletion.
- """
-
- def manage_afterClone(item):
- """After clone event hook.
- """
-
- def manage_beforeDelete(item, container):
- """Before delete event hook.
- """
-
- def manage_afterAdd(item, container):
- """After add event hook.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - ICallableOpaqueItem
+# - ICallableOpaqueItemEvents
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/Syndicatable.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/Syndicatable.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/Syndicatable.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,19 +15,6 @@
$Id$
"""
-from Interface import Interface
-
-
-class Syndicatable(Interface):
- """\
- Returns back a list of objects which implements the DublinCore.
- """
-
- def synContentValues(self):
- """
- Returns a list of results which is to be Syndicated. For example, the normal call
- contentValues (on PortalFolders) returns a list of subObjects of the current object
- (i.e. objectValues with filtering applied). For the case of a Topic, one would
- return a sequence of objects from a catalog query, not the subObjects of the Topic.
- What is returned must implement the DublinCore.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - Syndicatable
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/__init__.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/__init__.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/__init__.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1 +1,93 @@
-""" CMFCore.interfaces package """
+##############################################################################
+#
+# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" CMFCore.interfaces package.
+
+$Id$
+"""
+
+from _content import *
+from _tools import *
+
+# BBB: will be removed in CMF 2.2
+# create zope2 interfaces
+from Interface.bridge import createZope3Bridge
+import CachingPolicyManager
+import Contentish
+import ContentTypeRegistry
+import Discussions
+import DublinCore
+import Dynamic
+import Folderish
+import IOpaqueItems
+import portal_actions
+import portal_catalog
+import portal_discussion
+import portal_memberdata
+import portal_membership
+import portal_metadata
+import portal_properties
+import portal_registration
+import portal_skins
+import portal_types
+import portal_undo
+import portal_url
+import portal_workflow
+import Syndicatable
+
+createZope3Bridge(ICachingPolicyManager, CachingPolicyManager,
+ 'CachingPolicyManager')
+createZope3Bridge(IContentish, Contentish, 'Contentish')
+createZope3Bridge(IContentTypeRegistryPredicate, ContentTypeRegistry,
+ 'ContentTypeRegistryPredicate')
+createZope3Bridge(IContentTypeRegistry, ContentTypeRegistry,
+ 'ContentTypeRegistry')
+createZope3Bridge(IDiscussable, Discussions, 'Discussable')
+createZope3Bridge(IOldstyleDiscussable, Discussions, 'OldDiscussable')
+createZope3Bridge(IDiscussionResponse, Discussions, 'DiscussionResponse')
+createZope3Bridge(IDublinCore, DublinCore, 'DublinCore')
+createZope3Bridge(ICatalogableDublinCore, DublinCore, 'CatalogableDublinCore')
+createZope3Bridge(IMutableDublinCore, DublinCore, 'MutableDublinCore')
+createZope3Bridge(IDynamicType, Dynamic, 'DynamicType')
+createZope3Bridge(IFolderish, Folderish, 'Folderish')
+createZope3Bridge(ICallableOpaqueItem, IOpaqueItems, 'ICallableOpaqueItem')
+createZope3Bridge(ICallableOpaqueItemEvents, IOpaqueItems,
+ 'ICallableOpaqueItemEvents')
+createZope3Bridge(IActionsTool, portal_actions, 'portal_actions')
+createZope3Bridge(IActionProvider, portal_actions, 'ActionProvider')
+createZope3Bridge(IActionCategory, portal_actions, 'ActionCategory')
+createZope3Bridge(IAction, portal_actions, 'Action')
+createZope3Bridge(IActionInfo, portal_actions, 'ActionInfo')
+createZope3Bridge(ICatalogTool, portal_catalog, 'portal_catalog')
+createZope3Bridge(IIndexableObjectWrapper, portal_catalog,
+ 'IndexableObjectWrapper')
+createZope3Bridge(IOldstyleDiscussionTool, portal_discussion,
+ 'oldstyle_portal_discussion')
+createZope3Bridge(IDiscussionTool, portal_discussion, 'portal_discussion')
+createZope3Bridge(IMemberDataTool, portal_memberdata, 'portal_memberdata')
+createZope3Bridge(IMemberData, portal_memberdata, 'MemberData')
+createZope3Bridge(IMembershipTool, portal_membership, 'portal_membership')
+createZope3Bridge(IMetadataTool, portal_metadata, 'portal_metadata')
+createZope3Bridge(IPropertiesTool, portal_properties, 'portal_properties')
+createZope3Bridge(IRegistrationTool, portal_registration,
+ 'portal_registration')
+createZope3Bridge(ISkinsContainer, portal_skins, 'SkinsContainer')
+createZope3Bridge(ISkinsTool, portal_skins, 'portal_skins')
+createZope3Bridge(ITypeInformation, portal_types, 'ContentTypeInformation')
+createZope3Bridge(ITypesTool, portal_types, 'portal_types')
+createZope3Bridge(IUndoTool, portal_undo, 'portal_undo')
+createZope3Bridge(IURLTool, portal_url, 'portal_url')
+createZope3Bridge(IWorkflowTool, portal_workflow, 'portal_workflow')
+createZope3Bridge(IWorkflowDefinition, portal_workflow, 'WorkflowDefinition')
+createZope3Bridge(ISyndicatable, Syndicatable, 'Syndicatable')
+
+del createZope3Bridge
Added: CMF/branches/goldegg-phase-1/CMFCore/interfaces/_content.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/_content.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/_content.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -0,0 +1,607 @@
+##############################################################################
+#
+# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" CMFCore content interfaces.
+
+$Id$
+"""
+
+from zope.interface import Interface
+from zope.interface import Attribute
+
+
+#
+# Contentish interface
+#
+class IContentish(Interface):
+
+ """ General interface for "contentish" items.
+
+ o These methods need to be implemented by any class that wants to be a
+ first-class citizen in the CMF world.
+
+ o CMFCore.PortalContent implements this interface.
+ """
+
+ def SearchableText():
+ """ Return a string containing textual information about the content.
+
+ o This string may be the content of a file, or may be synthesized
+ by concatenating the string attributes of the instance.
+
+ o Permissions: View
+ """
+
+
+#
+# Discussable interfaces
+#
+class IDiscussable(Interface):
+
+ """ Interface for things which can have responses.
+ """
+
+ def createReply(title, text, Creator=None):
+ """ Create a reply in the proper place.
+
+ o Returns: HTML (directly or via redirect) # XXX
+
+ o Permission: Reply to item
+ """
+
+ def getReplies():
+ """ Return a sequence of IDiscussionResponse objects which are
+ replies to this IDiscussable
+
+ o Permission: View
+ """
+
+ def quotedContents():
+ """ Return this object's contents in a form suitable for inclusion
+ as a quote in a response.
+
+ o The default implementation returns an empty string. It might be
+ overridden to return a '>' quoted version of the item.
+
+ o Permission: Reply to item
+ """
+
+ def _getReplyResults():
+ """ Return the ZCatalog results that represent this object's replies.
+
+ o XXX: Huh?
+
+ o Often, the actual objects are not needed. This is less expensive
+ than fetching the objects.
+
+ o Permission: View
+ """
+
+
+class IOldstyleDiscussable(Interface):
+
+ """ Oldstyle discussable interface.
+ """
+
+ def createReply(title, text, REQUEST, RESPONSE):
+ """ Create a reply in the proper place.
+
+ o Returns: HTML (directly or via redirect) # XXX
+
+ o Permission: Reply to item
+ """
+
+ def getReplyLocationAndID(REQUEST):
+ """
+ This method determines where a user's reply should be stored, and
+ what it's ID should be.
+
+ You don't really want to force users to have to select a
+ unique ID each time they want to reply to something. The
+ present implementation selects a folder in the Member's home
+ folder called 'Correspondence' (creating it if it is missing)
+ and finds a free ID in that folder.
+
+ createReply should use this method to determine what the reply
+ it creates should be called, and where it should be placed.
+
+ This method (and createReply, I expect) do not really belong in
+ this interface. There should be a DiscussionManager singleton
+ (probably the portal object itself) which handles this.
+
+ Permissions: None assigned
+ Returns: 2-tuple, containing the container object, and a string ID.
+ """
+
+ def getReplyResults():
+ """
+ Return the ZCatalog results that represent this object's replies.
+
+ Often, the actual objects are not needed. This is less expensive
+ than fetching the objects.
+
+ Permissions: View
+ Returns: sequence of ZCatalog results representing DiscussionResponses
+ """
+
+ def getReplies():
+ """
+ Return a sequence of the DiscussionResponse objects which are
+ associated with this Discussable
+
+ Permissions: View
+ Returns: sequence of DiscussionResponses
+ """
+
+ def quotedContents():
+ """
+ Return this object's contents in a form suitable for inclusion
+ as a quote in a response. The default implementation returns
+ an empty string. It might be overridden to return a '>' quoted
+ version of the item.
+ """
+
+
+class IDiscussionResponse(Interface):
+
+ """ Interface for objects which are replies to IDiscussable objects.
+ """
+
+ def inReplyTo(REQUEST=None):
+ """ Return the IDiscussable object to which this item is a reply.
+
+ o Permission: None assigned
+ """
+
+ def setReplyTo(reply_to):
+ """ Make this object a response to the passed object.
+
+ o 'reply_to' is an IDiscussable, or a path (as a string) to one.
+
+ o Raise ValueError if 'reply_to' is not an IDiscussable (or doesn't
+ resolve to one as a path).
+
+ o XXX This does not seem like the right exception.
+
+ o Permission: None assigned
+ """
+
+ def parentsInThread(size=0):
+ """ Return a sequence of IDiscussables which are this object's parents,
+ from the point of view of the threaded discussion.
+
+ o Parents are ordered oldest to newest.
+
+ o If 'size' is not zero, only the closest 'size' parents will be
+ returned.
+ """
+
+
+#
+# DublinCore interfaces
+#
+class IDublinCore(Interface):
+
+ """ Dublin Core metadata elements supported by CMF and their semantics.
+ """
+
+ def Title():
+ """ Return a single string, the DCMI Title element (resource name).
+
+ o Permission: View
+ """
+
+ def listCreators():
+ """ Return a sequence of DCMI Creator elements (resource authors).
+
+ o Depending on the implementation, this returns the full name(s) of the
+ author(s) of the content object or their ids.
+
+ o Permission: View
+ """
+
+ def Creator():
+ """ Return the first DCMI Creator element, or an empty string.
+
+ o Permission: View
+ """
+
+ def Subject():
+ """ Return a sequence of DCMI Subject elements (resource keywords).
+
+ o Result is zero or more keywords associated with the content object.
+
+ o Permission: View
+ """
+
+ def Description():
+ """ Reuturn the DCMI Description element (resource summary).
+
+ o Result is a natural language description of this object.
+
+ o Permission: View
+ """
+
+ def Publisher():
+ """ Return the DCMI Publisher element (resource publisher).
+
+ o Result is the full formal name of the entity or person responsible
+ for publishing the resource.
+
+ o Permission: View
+ """
+
+ def listContributors():
+ """ Return a sequence of DCMI Contributor elements (resource
+ collaborators).
+
+ o Return zero or more collaborators (beyond thos returned by
+ 'listCreators').
+
+ o Permission: View
+ """
+
+ def Contributors():
+ """ Deprecated alias for 'listContributors'.
+
+ o 'initial caps' names are reserved for strings.
+ """
+
+ def Date():
+ """ Return the DCMI Date element (default resource date).
+
+ o Result is a string, formatted 'YYYY-MM-DD H24:MN:SS TZ'.
+
+ o Permission: View
+ """
+
+ def CreationDate():
+ """ Return the DCMI Date element (date resource created).
+
+ o Result is a string, formatted 'YYYY-MM-DD H24:MN:SS TZ'.
+
+ o Permission: View
+ """
+
+ def EffectiveDate():
+ """ Return the DCMI Date element (date resource becomes effective).
+
+ o Result is a string, formatted 'YYYY-MM-DD H24:MN:SS TZ', or
+ None.
+
+ o Permission: View
+ """
+
+ def ExpirationDate():
+ """ Return the DCMI Date element (date resource expires).
+
+ o Result is a string, formatted 'YYYY-MM-DD H24:MN:SS TZ', or
+ None.
+
+ o Permission: View
+ """
+
+ def ModificationDate():
+ """ DCMI Date element - date resource last modified.
+
+ o Result is a string, formatted 'YYYY-MM-DD H24:MN:SS TZ'.
+
+ o Permission: View
+ """
+
+ def Type():
+ """ Return the DCMI Type element (resource type).
+
+ o Result a human-readable type name for the resource (typically
+ the Title of its type info object).
+
+ o Permission: View
+ """
+
+ def Format():
+ """ Return the DCMI Format element (resource format).
+
+ o Result is the resource's MIME type (e.g. 'text/html',
+ 'image/png', etc.).
+
+ o Permission: View
+ """
+
+ def Identifier():
+ """ Return the DCMI Identifier element (resource ID).
+
+ o Result is a unique ID (a URL) for the resource.
+
+ o Permission: View
+ """
+
+ def Language():
+ """ DCMI Language element (resource language).
+
+ o Result it the RFC language code (e.g. 'en-US', 'pt-BR') for the
+ resource.
+
+ o Permission: View
+ """
+
+ def Rights():
+ """ Reutrn the DCMI Rights element (resource copyright).
+
+ o Return a string describing the intellectual property status, if
+ any, of the resource.
+
+ o Permission: View
+ """
+
+
+class ICatalogableDublinCore(Interface):
+
+ """ Provide Zope-internal date attributes for cataloging purposes.
+ """
+
+ def created():
+ """ Return the DateTime form of CreationDate.
+
+ o Permission: View
+ """
+
+ def effective():
+ """ Return the DateTime form of EffectiveDate.
+
+ o Permission: View
+ """
+
+ def expires():
+ """ Return the DateTime form of ExpirationDate.
+
+ o Permission: View
+ """
+
+ def modified():
+ """ Return the DateTime form of ModificationDate
+
+ o Permission: View
+ """
+
+
+class IMutableDublinCore(Interface):
+
+ """ Update interface for mutable metadata.
+ """
+
+ def setTitle(title):
+ """ Set DCMI Title element - resource name.
+
+ o Permission: Modify portal content
+ """
+
+ def setCreators(creators):
+ """ Set DCMI Creator elements - resource authors.
+
+ o Permission: Modify portal content
+ """
+
+ def setSubject(subject):
+ """ Set DCMI Subject element - resource keywords.
+
+ o Permission: Modify portal content
+ """
+
+ def setDescription(description):
+ """ Set DCMI Description element - resource summary.
+
+ o Permission: Modify portal content
+ """
+
+ def setContributors(contributors):
+ """ Set DCMI Contributor elements - resource collaborators.
+
+ o Permission: Modify portal content
+ """
+
+ def setEffectiveDate(effective_date):
+ """ Set DCMI Date element - date resource becomes effective.
+
+ o Permission: Modify portal content
+ """
+
+ def setExpirationDate(expiration_date):
+ """ Set DCMI Date element - date resource expires.
+
+ o Permission: Modify portal content
+ """
+
+ def setFormat(format):
+ """ Set DCMI Format element - resource format.
+
+ o Permission: Modify portal content
+ """
+
+ def setLanguage(language):
+ """ Set DCMI Language element - resource language.
+
+ o Permission: Modify portal content
+ """
+
+ def setRights(rights):
+ """ Set DCMI Rights element - resource copyright.
+
+ o Permission: Modify portal content
+ """
+
+
+#
+# DynamicType interfaces
+#
+class IDynamicType(Interface):
+
+ """ General interface for dynamic items.
+ """
+
+ def getPortalTypeName():
+ """ Return the name of the type information for this object.
+
+ o If the object is uninitialized, return None.
+
+ o Permission: Public
+ """
+
+ def getTypeInfo():
+ """ Return the ITypeInformation object for this object.
+
+ o A shortcut to 'getTypeInfo' of portal_types.
+
+ o Permission: Public
+ """
+
+ def getActionInfo(action_chain, check_visibility=0, check_condition=0):
+ """ Get an Action info mapping specified by a chain of actions.
+
+ o A shortcut to 'getActionInfo' of the related ITypeInformation
+ object.
+
+ o Permission: Public
+ """
+
+ def getIcon(relative_to_portal=False):
+ """ Get the path to an object's icon.
+
+ o This method is used in the 'folder_contents' view to generate an
+ appropriate icon for the items found in the folder.
+
+ o If the content item does not define an attribute named "icon"
+ return a "default" icon path (e.g., '/misc_/dtmldoc.gif', which is
+ the icon used for DTML Documents).
+
+ o If 'relative_to_portal' is True, return only the portion of
+ the icon's URL which finds it "within" the portal; otherwise,
+ return it as an absolute URL.
+
+ o Permission: Public
+ """
+
+
+#
+# Folderish interface
+#
+class IFolderish(Interface):
+
+ """ General interface for "folderish" content items.
+ """
+
+ def contentItems(filter=None):
+ """ Return a sequence of (object ID, object) tuples for
+ IContentish and IFolderish sub-objects.
+
+ o Provide a filtered view onto 'objectItems', allowing only
+ "content space" objects to show through.
+
+ o Permission: Public (not publishable)
+ """
+
+ def contentIds(filter=None):
+ """ Return a sequence of IDs of IContentish and IFolderish sub-objects.
+
+ o Provide a filtered view onto 'objectIds', allowing only
+ "content space" objects to show through.
+
+ o Permission: Public (not publishable)
+
+ Returns -- List of object IDs
+ """
+
+ def contentValues(filter=None):
+ """ Return a sequence of IContentish and IFolderish sub-objects.
+
+ o Provide a filtered view onto 'objectValues', allowing only
+ "content space" objects to show through.
+
+ o Permission: Public (not publishable)
+
+ Returns -- List of objects
+ """
+
+ def listFolderContents(contentFilter=None):
+ """ Return a sequence of IContentish and IFolderish sub-objects,
+ filtered by the current user's possession of the View permission.
+
+ o Hook around 'contentValues' to let 'folder_contents' be protected.
+
+ o Duplicates 'skip_unauthorized' behavior of 'dtml-in'.
+
+ o Permission -- List folder contents
+ """
+
+
+#
+# IOpaqueItems interfaces
+#
+class ICallableOpaqueItem(Interface):
+
+ """ Interface for callable opaque items.
+
+ o Opaque items are subelements that are contained using something that
+ is not an ObjectManager.
+
+ o On add, copy, move and delete operations, a marked opaque items
+ 'manage_afterAdd', 'manage_afterClone' and 'manage_beforeDelete'
+ hooks get called if available. Unavailable hooks do not throw
+ exceptions.
+ """
+
+ def __init__(obj, id):
+ """Return the opaque item and assign it to 'obj' as attr with 'id'.
+ """
+
+ def __call__():
+ """Return the opaque items value.
+ """
+
+ def getId():
+ """Return the id of the opaque item.
+ """
+
+
+class ICallableOpaqueItemEvents(Interface):
+
+ """CMF specific events upon copying, renaming and deletion.
+ """
+
+ def manage_afterClone(item):
+ """After clone event hook.
+ """
+
+ def manage_beforeDelete(item, container):
+ """Before delete event hook.
+ """
+
+ def manage_afterAdd(item, container):
+ """After add event hook.
+ """
+
+
+#
+# Syndicatable interface
+#
+class ISyndicatable(Interface):
+
+ """ Filter content for syndication.
+ """
+
+ def synContentValues():
+ """ Return a list of IDublinCore objects to be syndicated.
+
+ o For example, 'IFolderish' containers might returns a list of
+ recently-created or modified subobjects.
+
+ o Topics might return a sequence of objects from a catalog query.
+ """
Property changes on: CMF/branches/goldegg-phase-1/CMFCore/interfaces/_content.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: CMF/branches/goldegg-phase-1/CMFCore/interfaces/_tools.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/_tools.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/_tools.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -0,0 +1,1732 @@
+##############################################################################
+#
+# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" CMFCore tool interfaces.
+
+$Id$
+"""
+
+from zope.interface import Interface
+from zope.interface import Attribute
+
+_marker = object()
+
+
+#
+# Action subsystem interfaces
+#
+class IActionsTool(Interface):
+
+ """ Generate the list of "actions" which the user is allowed to perform.
+
+ o Synthesize this list from the actions managed by a set of "action
+ providers".
+ """
+
+ id = Attribute('id',
+ """ The ID of the tool.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IActionsTool)'.
+
+ o Must be set to "portal_actions"
+ """,
+ )
+
+ def listActionProviders():
+ """ Return a sequence of names of all IActionProvider utilities
+ registered with this tool.
+
+ o The returned list of names will be a subset of the set available
+ via 'zapi.getUtilitiesFor(IActionProvider)' (which returns
+ '(name, value)' tuples).
+
+ o Deprecated: In the future, expect to use 'getUtilitiesFor' instead
+ (presuming either that ordering either doesn't matter or that
+ ordering is supported by the utility registry).
+
+ o Permission: Manage portal
+ """
+
+ def addActionProvider(provider_name):
+ """ Register an IActionProvider to the set queried by this tool.
+
+ o 'provider_name' is appended to the set of names already registered
+ with the tool.
+
+ o Raise ComponentLookupError if no utility of that name is registered
+ for IActionProvider.
+
+ o Deprecated: In the future, expect to use 'getUtilitiesFor' instead
+ (presuming either that ordering either doesn't matter or that
+ ordering is supported by the utility registry).
+
+ o Permission: Manage portal
+ """
+
+ def deleteActionProvider(provider_name):
+ """ Remove an IActionProvider from the set queried by this tool.
+
+ o Return silently if 'provider_name' is not already registered with
+ the tool.
+
+ o Deprecated: In the future, expect to use 'getUtilitiesFor' instead
+ (presuming either that ordering either doesn't matter or that
+ ordering is supported by the utility registry).
+
+ o Permission: Manage portal
+ """
+
+ def listFilteredActionsFor(object=None):
+ """ Map actions available to the user by category.
+
+ o Returned mapping will have category IDs as keys, and sequences
+ of IActionInformation objects as the corresponding values for each
+ category.
+
+ o Categories may be arbitrarily extended.
+
+ o Permission: Public
+ """
+
+
+class IActionProvider(Interface):
+
+ """ Objects that can be queried for actions.
+ """
+
+ def listActions(info=None, object=None):
+ """ List known action informations.
+
+ o Return a sequence of IActionInformation intances.
+
+ o Both the 'object' and the 'info' arguments are deprecated and
+ ignored (use 'listActionInfos' to filter actions by context).
+ """
+
+ def listActionInfos(action_chain=None, object=None, check_visibility=True,
+ check_permissions=True, check_condition=True, max=None):
+ """ Return a sequence of IActionInformation matching the given criteria.
+
+ o 'action_chain' is a sequence of one or more action paths
+ (e.g. 'object/view'); each path is formatted as
+ 'category_id/action_id'. If specified, only matching actions will
+ be returned, and in the given order (paths with no matches are
+ ignored silently).
+
+ o If 'object' is specified, only actions specific to that object
+ are included.
+
+ o If 'check_visibility' is True, return only actions whos "visible"
+ flag is set.
+
+ o If 'check_permissions' is True, return only actions for whose
+ permissions the current user is authorized.
+
+ o If 'check_condition' is True, return only actions whose condition
+ expression evaluates True.
+
+ o If 'max' is specified, return only the first 'max' Actions.
+
+ o Permission: Public (but not URL-publishable)
+ """
+
+ def getActionInfo(action_chain, object=None, check_visibility=False,
+ check_condition=False):
+ """ Return the first IActionInformation matching the given criteria.
+
+ o If no action is found matching the criteria, raise ValueError.
+
+ o 'action_chain' is a sequence of one or more action paths
+ (e.g. 'object/view'); each path is formatted as
+ 'category_id/action_id'. If specified, only matching actions will
+ be returned, and in the given order (paths with no matches are
+ ignored silently).
+
+ o If 'check_visibility' is True, return only actions whos "visible"
+ flag is set.
+
+ o If 'check_condition' is True, return only actions whose condition
+ expression evaluates True.
+
+ o Permission: Public
+ """
+
+
+class IActionCategory(Interface):
+
+ """ Group of IAction objects and child categories.
+ """
+
+ def listActions():
+ """ Return a sequence of IActionInformation defined by this category
+
+ o Include actions defined by subcategories.
+
+ o Permission: Private (Python only)
+ """
+
+
+class IAction(Interface):
+
+ """ Specification for an action.
+ """
+
+ def getInfoData():
+ """ Return a lazy mapping of the data needed to create an
+ IActionInformation.
+
+ o Returned value is actually a tuple, '(lazy_map, lazy_keys)'.
+
+ o Default keys are: 'id', 'category', 'title', 'description', 'url',
+ 'icon', 'available', 'permissions' and 'visible'.
+
+ o Instead of computed values callable expression objects or methods
+ are returned. For performance reasons, these objects are called
+ later and only if the values are actually needed. The keys for all
+ these lazy values are registered in a separate list.
+ """
+
+
+class IActionInfo(Interface):
+
+ """ A lazy dictionary for Action infos.
+
+ o Each ActionInfo object has the following keys:
+
+ - id (string): not unique identifier
+
+ - title (string)
+
+ - url (string): URL to access the action
+
+ - category (string): one of "user", "folder", "object", "global",
+ "workflow" or a custom category
+
+ - visible (boolean)
+
+ - available (boolean): the result of checking the condition
+
+ - allowed (boolean): the result of checking permissions;
+ The user must have at least one of the listed permissions to access
+ the action. If the list is empty, the user is allowed.
+ """
+
+
+#
+# Caching policy tool interfaces
+#
+class ICachingPolicyManager(Interface):
+
+ """ Compute HTTP cache headers for skin methods.
+ """
+
+ id = Attribute('id',
+ """ The ID of the tool.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(ICachingPolicyManager)'.
+
+ o Must be set to 'caching_policy_manager'.
+ """,
+ )
+
+ def getHTTPCachingHeaders(content, view_method, keywords, time=None):
+ """ Update HTTP caching headers in REQUEST
+
+ o 'content' is the content object being published.
+
+ o 'view_method' is the name of the view being published
+
+ o 'keywords' is a set of extra keywords modifying the view.
+
+ o If 'time' is supplied, use it instead of the current time
+ (for reliable testing).
+ """
+
+
+#
+# Catalog tool interfaces
+#
+class ICatalogTool(Interface):
+
+ """Wrap the "stock" ZCatalog with custom behavior for the CMF.
+ """
+
+ id = Attribute('id', 'Must be set to "portal_catalog"')
+
+ # searchResults inherits security assertions from ZCatalog.
+ def searchResults(REQUEST=None, **kw):
+ """ Decorate ZCatalog.searchResults() with extra arguments
+
+ o The extra arguments that the results to what the user would be
+ allowed to see.
+ """
+
+ # __call__ inherits security assertions from ZCatalog.
+ def __call__(REQUEST=None, **kw):
+ """Alias for searchResults().
+ """
+
+ def unrestrictedSearchResults(REQUEST=None, **kw):
+ """Calls ZCatalog.searchResults() without any CMF-specific processing.
+
+ o Permission: Private (Python only)
+ """
+
+ def indexObject(object):
+ """ Add 'object' to the catalog.
+
+ o Permission: Private (Python only)
+ """
+
+ def unindexObject(object):
+ """ Remove 'object' from the catalog.
+
+ o Permission: Private (Python only)
+ """
+
+ def reindexObject(object, idxs=[], update_metadata=True):
+ """ Update 'object' in catalog.
+
+ o 'idxs', if passed, is a list of specific indexes to update
+ (by default, all indexes are updated).
+
+ o If 'update_metadata' is True, then update the metadata record
+ in the catalog as well.
+
+ o Permission: Private (Python only)
+ """
+
+
+class IIndexableObjectWrapper(Interface):
+
+ """ Wrapper for catalogued objects, for indexing "virtual" attributes.
+ """
+
+ def allowedRolesAndUsers():
+ """ Return a sequence roles and users with View permission.
+
+ o PortalCatalog indexes this sequence to allow filtering out items
+ a user is not allowed to see.
+ """
+
+
+#
+# PUT factory handler interfaces
+#
+class IContentTypeRegistryPredicate(Interface):
+
+ """ Match a given name/typ/body to a portal type.
+
+ The registry will call the predictate's 'edit' method, passing the fields
+ of the record.
+ """
+
+ def __call__(name, typ, body):
+ """ Return true if the rule matches, else false. """
+
+ def getTypeLabel():
+ """ Return a human-readable label for the predicate type. """
+
+ def predicateWidget():
+ """ Return a snippet of HTML suitable for editing the predicate.
+
+ o This method may be defined via DTMLFile or PageTemplateFile
+ (the tool will call it appropriately, if it is DTML).
+
+ o The snippet should arrange for values to be marshalled by
+ ZPublisher as a ':record', with the ID of the predicate as the
+ name of the record.
+ """
+
+
+class IContentTypeRegistry(Interface):
+
+ """ Apply policy mapping PUT arguments to a CMF portal type.
+ """
+
+ def findTypeName(name, typ, body):
+ """ Return the the portal type (an ID) for a PUT request.
+
+ o 'name' is the filename supplied as the end of the path of the
+ PUT request.
+
+ o 'typ' is the MIME type for the request (which may have been guessed
+ already from the extension or the body).
+
+ o 'body' is the actual payload of the PUT request.
+
+ o Return None if no match found.
+ """
+
+
+#
+# Discussion tool interfaces.
+#
+class IOldstyleDiscussionTool(Interface):
+
+ """ Links content to discussions.
+ """
+
+ id = Attribute('id',
+ """ The tool's ID.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IDiscussionTool)'.
+
+ o Must be set to 'portal_discussion'.
+ """)
+
+ def getDiscussionFor(content):
+ """ Return an IDiscussionItemContainer for 'content'.
+
+ o Create the IDC if necessary.
+
+ o Raise ValueError if discussion is not allowed on 'content'.
+
+ o Permission: Public
+ """
+
+ def isDiscussionAllowedFor(content):
+ """ Return True discussion is allowed for 'content', else False.
+
+ o Result may be looked up from an object-specific value, or by place,
+ or from a site-wide policy.
+
+ o Permission: Public
+ """
+
+
+class IDiscussionTool(IOldstyleDiscussionTool):
+
+ """ Links content to discussions.
+ """
+
+ def overrideDiscussionFor(content, allowDiscussion):
+ """ Override discussability for the given object or clear the setting.
+
+ o 'allowDiscussion' may be True, False, or None.
+
+ o If 'allowDiscussion' is None, then clear any overridden setting for
+ discussability, letting the site's default policy apply.
+
+ o Otherwise, set the override to match 'allowDiscussion'.
+
+ o Permission: PUblic XXX? Should be ManageContent, or something.
+ """
+
+
+#
+# MemberData tool interfaces
+#
+class IMemberDataTool(Interface):
+
+ """ Decorate user objects with site-local data.
+ """
+
+ id = Attribute('id',
+ """ The tool's ID.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IMemberDataTool)'.
+
+ o Must be set to 'portal_memberdata'
+ """,
+ )
+
+ def wrapUser(user):
+ """Returns an IMember corresponding to the given user object.
+
+ o Permission: Private (Python-only)
+ """
+
+ def getMemberDataContents():
+ """ Returns a list containing a dictionary with information
+ about the _members BTree contents
+
+ o The key 'member_count' is the total number of member instances
+ stored in the memberdata-tool
+
+ o The key 'orphan_count' is the number of member instances
+ that for are no longer in the underlying acl_users user folder.
+
+ o The result is designed to be iterated over in a dtml-in
+
+ o XXX: why a sequence?
+
+ o Permission: Private (Python-only)
+ """
+
+ def pruneMemberDataContents():
+ """ Delete member data of all members not findable in acl_users.
+
+ o Compare the user IDs stored in the member data tool with the
+ list in the actual underlying acl_users and delete any records whose
+ user cannot be found.
+
+ o Permission: Private (Python only)
+ """
+
+ def searchMemberData(search_param, search_term, attributes=()):
+ """ Return a sequence of mappings of memberdata for the given criteria.
+
+ o 'search_param' is the property ID to be searched.
+
+ o 'search_term' is the property value to be searched.
+
+ o 'attributes', if passed, controls the keys in the returned mappings;
+ by default the returned keys are 'username' and 'email'.
+
+ o XXX: that default is silly; if it is truly needed, then it should
+ be the default value of the 'attributes' argument.
+
+ o Permission: Private (Python only)
+ """
+
+ def registerMemberData(m, id):
+ """ Add the given member data to the _members btree.
+
+ o 'm' is an object whose attributes are the memberdata for the member.
+
+ o 'id' is the userid of the member.
+
+ o Add the record late as possible to avoid side effect transactions
+ and to reduce the necessary number of entries.
+
+ o XXX: these argument names are silly; can we use more sensible
+ ones (i.e., does anyone actually depend on them)?
+
+ o Permission: Private (Python only)
+ """
+
+ def deleteMemberData(member_id):
+ """ Delete member data of specified member.
+
+ o Return True if a record was deleted, else False.
+
+ o Permission: Private (Python only)
+ """
+
+class IMemberData(Interface):
+
+ """ MemberData interface.
+ """
+
+ def setProperties(properties=None, **kw):
+ """ Allow the authenticated member to update his/her member data.
+
+ o 'properties', if passed, is a mapping of the IDs and values of
+ the properties to be changed.
+
+ o The method may also be invoked via keyword arguments (in this
+ case, do *not* pass 'properties').
+
+ o Permission: Set own properties
+ """
+
+
+#
+# Membership tool interfaces
+#
+class IMembershipTool(Interface):
+
+ """ Manage policy of how and where to store and retrieve members and
+ their member folders.
+ """
+
+ id = Attribute('id',
+ """ The tool's ID.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IMembershipTool)'.
+
+ o Must be set to 'portal_membership'.
+ """)
+
+ def setPassword(password, domains=None):
+ """ Allow the authenticated member to set his/her own password.
+
+ Permission: Set own password
+ """
+
+ def getAuthenticatedMember():
+ """ Return the currently authenticated member object
+
+ o If no valid credentials are passed in the request, return
+ the Anonymous User.
+
+ o Permission: Public
+ """
+
+ def isAnonymousUser():
+ """ Return True if no valid credentials are passed in the requeset.
+
+ o Permission: Public
+ """
+
+ def checkPermission(permissionName, object, subobjectName=None):
+ """ Return True if the current user has the given permission on
+ the given object or subobject.
+
+ o 'permissionName' is the string identifying the permission.
+
+ o 'object' is the object being checked.
+
+ o 'subobjectName', if passed, is the attribute name to be checked;
+ if None, test the main object itself.
+
+ o Permission: Public
+ """
+
+ def credentialsChanged(password):
+ """ Notify the authentication mechanism that this user has
+ changed passwords.
+
+ o The authentication mechanism can use this notification to update
+ the authentication cookie.
+
+ o Note that this call should *not* cause any change at all to user
+ databases.
+
+ o XXX: should be an event.
+
+ o XXX: should this be in scope for this tool? Or should it be
+ done by the view class for the password update view?
+
+ Permission: Public # XXX?
+ """
+
+ def getMembersFolder():
+ """ Return the folderish object which contains membmer folders.
+
+ o Return None if no members folder is set or if the specified
+ folder doesn't exist.
+
+ o Permission: Public
+ """
+
+ def getHomeFolder(id=None, verifyPermission=False):
+ """ Return a member's home folder object or None.
+
+ o 'id', if passed, is the ID of the member whose folder should be
+ returned; if not passed, use the currently-authenticated member.
+
+ o If 'verifyPermission' is True, return None when the user
+ doesn't have the View permission on the folder.
+
+ o Permission: Public
+ """
+
+ def getHomeUrl(id=None, verifyPermission=0):
+ """ Return the URL to a member's home folder or None.
+
+ o 'id', if passed, is the ID of the member whose folder should be
+ returned; if not passed, use the currently-authenticated member.
+
+ o If 'verifyPermission' is True, return None when the user
+ doesn't have the View permission on the folder.
+
+ Permission: Public
+ """
+
+ def getMemberById(id):
+ """ Returns the given IMember.
+
+ o Permission: Manage users
+ """
+
+ def listMemberIds():
+ """ Return a sequence of ids of all members.
+
+ o This may eventually be replaced with a set of methods for querying
+ pieces of the list rather than the entire list at once.
+
+ o Permission: Manage users
+ """
+
+ def listMembers():
+ """ Return a sequence of all IMembers.
+
+ o This may eventually be replaced with a set of methods for querying
+ pieces of the list rather than the entire list at once.
+
+ o Permission: Manage users
+ """
+
+ def getCandidateLocalRoles(obj):
+ """ Return a sequence local roles assignable by the current user for
+ a given object.
+
+ o 'obj' is the object to which role assignments may be made.
+
+ o Permission: Public # XXX?
+ """
+
+ def setLocalRoles(obj, member_ids, member_role, reindex=True):
+ """ Assign a local role on an item to one or more members.
+
+ o 'obj' is the object on which to assign the role.
+
+ o 'member_ids' is a sequence of user IDs to which to assign the role.
+
+ o 'member_role' is the name of the role to assign.
+
+ o If 'reindex' is True, then reindex the security-related attributes
+ of the object and all subobjects.
+
+ o Raise Unauthorized if the currently-authenticated member cannot
+ assign 'member_role' on 'obj'.
+
+ o Permission: Public # XXX?
+ """
+
+ def deleteLocalRoles(obj, member_ids, reindex=True, recursive=False):
+ """ Remove local roles of specified members from an object.
+
+ o 'obj' is the object on which to remove the role.
+
+ o 'member_ids' is a sequence of user IDs from which to remove the role.
+
+ o If 'reindex' is True, then reindex the security-related attributes
+ of the object and all subobjects.
+
+ o if 'recursive' is True, recurse over all subobjects of 'object'.
+
+ o Raise Unauthorized if the currently-authenticated member cannot
+ assign 'member_role' on 'obj'.
+
+ Permission: Public
+ """
+
+ def addMember(id, password, roles, domains):
+ """ Adds a new member to the user folder.
+
+ o Security checks will have already been performed. Called by
+ the registration tool.
+
+ Permission: Private (Python only)
+ """
+
+ def deleteMembers(member_ids, delete_memberareas=1, delete_localroles=1):
+ """ Remove specified members from the site.
+
+ o Returns a sequence of member_ids of members actually deleted.
+
+ o Remove the members from the user folder.
+
+ o 'member_ids' is a sequence of one or more user IDs to remove.
+
+ o Remove corresponding member data in the memberdata tool.
+
+ o If 'delete_memberareas' is True, delete members' home folders
+ including all content items.
+
+ o If 'delete_localroles' is true, recursively delete members' local
+ roles, starting from the site root.
+
+ o Permission: Manage users
+ """
+
+ def getPortalRoles():
+ """ Return a sequence of role names defined by the portal itself.
+
+ o Returned role names are those understood by the portal object.
+
+ o Permission: Manage portal
+ """
+
+ def setRoleMapping(portal_role, userfolder_role):
+ """ Register a mapping of a role defined by the portal to a role
+ coming from outside user sources.
+
+ o Permission: Manage portal
+ """
+
+ def getMappedRole(portal_role):
+ """ Returns a mapped role name corresponding to 'portal_role', or
+ the empty string if no mapping exists.
+
+ o Mappings are defined via 'setRoleMapping'.
+
+ o Permission: Manage portal
+ """
+
+ def getMemberareaCreationFlag():
+ """ Return True if the membership tool will create a member area for
+ a user at login.
+
+ o Permission: Manage portal
+ """
+
+ def setMemberareaCreationFlag():
+ """ Toggle the policy flag for create a member areas at login.
+
+ o XXX: Toggle is a weak semantic here; shouldn't we be passing
+ the value we want the flag to have?
+
+ o Permission: Manage portal
+ """
+
+ def createMemberArea(member_id=''):
+ """ Return a member area for the given member, creating if necessary.
+
+ o If member area creation is disabled, return None.
+
+ o 'member_id', if passed, is the ID of the member whose folder is
+ to be created; if not passed, default to the authenticated member.
+
+ o Permission: Public # XXX?
+ """
+
+ def deleteMemberArea(member_id):
+ """ Delete member area of specified member
+
+ o Return True if a member area previously existed for the member.
+
+ o 'member_id' identifies the member whose member is to be removed.
+
+ o Permission: Manage users
+ """
+
+
+#
+# Metadata tool interface
+#
+class IMetadataTool(Interface):
+
+ """ CMF metadata policies interface.
+ """
+
+ id = Attribute('id',
+ """ The tool's ID.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IMetadataTool)'.
+
+ o Must be set to 'portal_metadata'.
+ """)
+
+ #
+ # Site-wide queries.
+ #
+ def getFullName(userid):
+ """ Convert an internal userid to a "formal" name, if possible
+
+ o 'userid' is the ID of the user within the user folder.
+
+ o Used to map userid's for Creator, Contributor DCMI queries.
+ """
+
+ def getPublisher():
+ """ Return the "formal" name of the publisher of the site.
+ """
+
+ #
+ # Content-specific queries.
+ #
+ def listAllowedSubjects(content=None):
+ """ List the allowed values of the 'Subject' DCMI element.
+
+ o If 'content' is not None, return only values appropriate for
+ content's type; otherwise, return "default" values.
+
+ o 'Subject' elements should be keywords categorizing their resource.
+ """
+
+ def listAllowedFormats(content=None):
+ """ List the allowed values of the 'Format' DCMI element.
+
+ o If 'content' is not None, return only values appropriate for
+ content's type; otherwise, return "default" values.
+
+ o 'Format' elements should be usable as HTTP 'Content-type' values.
+ """
+
+ def listAllowedLanguages(content=None):
+ """ List the allowed values of the 'Language' DCMI element.
+
+ o If 'content' is not None, return only values appropriate for
+ content's type; otherwise, return "default" values.
+
+ o 'Language' element values should be suitable for generating
+ HTTP headers.
+ """
+
+ def listAllowedRights(content=None):
+ """ List the allowed values of the 'Rights' DCMI element.
+
+ o If 'content' is not None, return only values appropriate for
+ content's type; otherwise, return "default" values.
+
+ o The 'Rights' element describes copyright or other IP
+ declarations pertaining to a resource.
+ """
+
+ #
+ # Validation policy hooks.
+ #
+ def setInitialMetadata(content):
+ """ Set default initial values for content metatdata.
+ """
+
+ def validateMetadata(content):
+ """ Enforce portal-wide policies about DCMI elements.
+
+ o Such policy may, e.g., require non-empty title/description, etc.
+
+ o Called by the CMF immediately before saving changes to the
+ metadata of an object.
+
+ o XXX: Note that the default skins / edit methods do *not*
+ call this method; the choice of when to apply the validation
+ is policy.
+ """
+
+
+#
+# Site Properties tool interface
+#
+class IPropertiesTool(Interface):
+
+ """ Manage properties of the site as a whole.
+ """
+
+ id = Attribute('id',
+ """ The tool's ID.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IPropertiesTool)'.
+
+ o Must be set to 'portal_properties'.
+ """)
+
+ def editProperties(props):
+ """ Change portal settings.
+
+ o 'props' is a mapping of values to be updates.
+
+ o Permission: Manage portal
+ """
+
+ def title():
+ """ Return the site's title.
+ """
+
+ def smtp_server():
+ """ Return the configured SMTP server for the site.
+ """
+
+
+#
+# Registration tool interface
+#
+class IRegistrationTool(Interface):
+
+ """ Manage policies for member registration.
+
+ o Depends on IMembershipTool component.
+
+ o Is not aware of membership storage details.
+ """
+
+ id = Attribute('id',
+ """ The ID of the tool.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IRegistrationTool)'.
+
+ o Must be set to "portal_registration"
+ """,
+ )
+
+ def isRegistrationAllowed(REQUEST):
+ """ Return True if the current user is allowed to add a member to
+ the site, else False.
+
+ o Permission: Public
+ """
+
+ def testPasswordValidity(password, confirm=None):
+ """ Return None if the password is valid; otherwise return a string
+ explaining why not.
+
+ o 'password' is the candidate password string.
+
+ o If 'confirm' is passed, XXX?
+
+ o Permission: Public
+ """
+
+ def testPropertiesValidity(new_properties, member=None):
+ """ Return None if the supplied properties are valid; otherwise
+ return a string explaining why not.
+
+ o 'new_properties' is a mapping containing the properties to test.
+
+ o 'member', if passed, is the ID of the member for whome the
+ properties are being set; if not passed, use the currently-
+ authenticated member.
+
+ o Permission: Public
+ """
+
+ def generatePassword():
+ """ Return a generated password which is complies with the site's
+ password policy.
+
+ o Permission: Public
+ """
+
+ def addMember(id, password, roles=('Member',), domains='',
+ properties=None):
+ """ Creates and return a new member.
+
+ o 'id' is the user ID of the member to be created; raise ValueError
+ if there already exists a member with the given 'id'.
+
+ o 'password' is the user's password; raise ValueError if the
+ supplied 'password' does not comply with the site's password policy.
+
+ o 'roles' is a list of roles to grant the new member; raise
+ Unauthorized if the currently-authenticated user is not
+ allowed to grant one of the roles listed
+
+ - "Member" is a special role that can always be granted
+
+ o 'properties', if passed, is a mapping with additional member
+ properties; raise ValueError if one or more properties do not
+ comply with the site's policies.
+
+ o Permission: Add portal member
+ """
+
+ def isMemberIdAllowed(id):
+ """ Return True if 'id' is not in use as a member ID and is not
+ reserved, else False.
+
+ o Permission: Add portal member
+ """
+
+ def afterAdd(member, id, password, properties):
+ """ Notification called by portal_registration.addMember() after a
+ member has been added successfully.
+
+ o Permission: Private (Python only)
+ """
+
+ def mailPassword(forgotten_userid, REQUEST):
+ """ Email a forgotten password to a member.
+
+ o Raise ValueError if user ID is not found.
+
+ o XXX: should probably *not* raise, in order to prevent cracking.
+
+ o Permission: Mail forgotten password
+ """
+
+
+#
+# Skins tool interfaces
+#
+class ISkinsContainer(Interface):
+
+ """ An object that provides skins.
+ """
+ def getSkinPath(name):
+ """ Convert a skin name to a skin path.
+
+ o Permission: Access contents information
+ """
+
+ def getDefaultSkin():
+ """ Return the default skin name.
+
+ o Permission: Access contents information
+ """
+
+ def getRequestVarname():
+ """ Return the variable name to look for in the REQUEST.
+
+ o Permission: Access contents information
+ """
+
+ def getSkinByPath(path, raise_exc=0):
+ """ Return a skin at the given path.
+
+ o XXX: what are we doing here?
+
+ o A skin path is a search path of layers of the format:
+ 'some/path, some/other/path, ...'.
+
+ o Attributes are looked up in the layers in the named order.
+
+ o A skin is a specially wrapped object that looks through the layers
+ in the correct order.
+
+ o Permission: Private (Python only)
+ """
+
+ def getSkinByName(name):
+ """ Get the named skin.
+
+ Permission: Private (Python only)
+ """
+
+
+class ISkinsTool(ISkinsContainer):
+
+ """ An object that provides skins to a portal object.
+
+ O XXX: This shouldn't derive from ISkinsContainer?
+ """
+
+ id = Attribute('id',
+ """ The ID of the tool.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(ISkinsTool)'.
+
+ o Must be set to "portal_skind"
+ """,
+ )
+
+ def getSkinSelections():
+ """ Get the sorted list of available skin names.
+
+ o Permission: Public
+ """
+
+
+#
+# Types tool interfaces
+#
+class ITypeInformation(Interface):
+
+ """ Type definition interface.
+ """
+
+ def Metatype():
+ """ Return the Zope 'meta_type' for this content object.
+
+ o Deprecated (not all objects of a given type may even share
+ the same meta_type).
+ """
+
+ def Title():
+ """ Return the "human readable" type name
+
+ o Note that it may not map exactly to the 'meta_type', e.g.,
+ for l10n/i18n or where a single content class is being
+ used twice, under different names.
+ """
+
+ def Description():
+ """ Return a textual description of the type
+
+ o This descriptoin is used for display in a "constructor list".
+ """
+
+ def isConstructionAllowed(container):
+ """ Return True if the current user is allowed to construct an
+ instance of this type in 'container, else False.
+ """
+
+ def allowType(contentType):
+ """ Can objects of 'contentType' be added to containers of our type?
+ """
+
+ def constructInstance(container, id):
+ """ Build a "bare" instance of the appropriate type in 'container'.
+
+ o Give the new instance an ID of 'id'.
+
+ o Return the newly-created instance, seated in 'container'.
+ """
+
+ def allowDiscussion():
+ """ Return True if objects of this type are allowed to support
+ discussion, else False.
+
+ o Individual objects may still disable discussion.
+ """
+
+ def getIcon():
+ """ Return the portal-relative URL for the icon for this type.
+ """
+
+ def getMethodAliases():
+ """ Return a mapping of method aliases for this type.
+
+ o XXX: define keys and values of the mapping.
+
+ o Permission: Manage portal
+ """
+
+ def setMethodAliases(aliases):
+ """ Assign method aliases for this type.
+
+ o Return True if the operation changed any aliases, else False.
+
+ o 'aliases' is the mapping of aliases to be assigned.
+
+ o XXX: define keys and values of the mapping.
+
+ o Permission: Manage portal
+ """
+
+ def queryMethodID(alias, default=None, context=None):
+ """ Return the method ID for a given alias.
+
+ o 'context', if passed, points to the object calling this method.
+ It may be used to return dynamic values based on the caller.
+ XXX: this is unclear
+
+ o 'default' is returned if no such alias is defined.
+
+ o Permission: Public
+
+ Returns: Method ID or default value
+ """
+
+
+class ITypesTool(Interface):
+
+ """ Register content types for the site.
+ """
+
+ id = Attribute('id',
+ """ The ID of the tool.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(ITypesTool)'.
+
+ o Must be set to "portal_types"
+ """,
+ )
+
+ def getTypeInfo(contentType):
+ """ Return an ITypeInformation for the given type name / object.
+
+ o If 'contentType' is actually an object, rather than a string,
+ attempt to look up the appropriate type info using its 'portal_type'.
+
+ o Permission: Public
+ """
+
+ def listTypeInfo(container=None):
+ """ Return a sequence of ITypeInformations registered for the
+ site.
+
+ o If 'container' is passed, filter the list according to the user's
+ permissions to add content in that place.
+
+ o Permission: Public
+ """
+
+ def listContentTypes(container=None, by_metatype=0):
+ """ Return a sequence of IDs of ITypeInformations registered
+ for the site.
+
+ o If 'by_metatype' is True, return meta_types instead (this variant
+ is deprecated).
+
+ o If 'container' is passed, filter the list according to the user's
+ permissions to add content in that place.
+
+ o Permission: Public
+ """
+
+ def constructContent(contentType, container, id, RESPONSE=None,
+ *args, **kw):
+ """ Build an instance of the appropriate type in 'container'
+
+ o 'contentType' is the name of the ITypeInformation to be
+ constructed.
+
+ o Assign the instance the given 'id', if possible.
+
+ o If 'RESPONSE' is passed, redirect to the new object's
+ "initial view"; otherwise return the new object's 'id' (which
+ may have morphed during construction).
+
+ o Raise Unauthorized if the current user is not allowed to construct
+ items of the given type in 'container'.
+ """
+
+
+#
+# Undo tool interface
+#
+class IUndoTool(Interface):
+
+ """ Provide access to Zope undo functions.
+ """
+
+ id = Attribute('id',
+ """ The ID of the tool.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IUndoTool)'.
+
+ o Must be set to "portal_undo"
+ """,
+ )
+
+ def listUndoableTransactionsFor(object,
+ first_transaction=None,
+ last_transaction=None,
+ PrincipiaUndoBatchSize=None):
+ """ List all transaction IDs the user is allowed to undo on 'object'.
+
+ o Return a list of "transaction info" objects, using the given
+ parameters to batch the results.
+
+ o XXX: this needs documentation / testing.
+
+ o Permission: Undo changes
+ """
+
+ def undo(object, transaction_info):
+ """Performs an undo operation.
+
+ o Permission: Undo changes
+ """
+
+
+#
+# URL tool interface
+#
+class IURLTool(Interface):
+
+ """ CMF URL Tool interface.
+
+ This interface provides a common mechanism for finding the 'root'
+ object of a CMFSite, and for computing paths to objects relative to
+ that root.
+ """
+
+ id = Attribute('id',
+ """ The ID of the tool.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IURLTool)'.
+
+ o Must be set to "portal_url"
+ """,
+ )
+
+ def __call__(relative=0, *args, **kw):
+ """ Return URL of the site, as a string.
+
+ o If 'relative' is True, return only the "path" portion of the site
+ object's URL; otherwise, return the absolute URL
+
+ o In either case, the returned path respects virtual hosting.
+
+ o The site is the parent of the tool.
+
+ o Permission: Public
+ """
+
+ def getPortalObject():
+ """ Return the site object itself.
+
+ o The site is the parent of the tool.
+
+ o Permission: Public
+ """
+
+ def getRelativeContentPath(content):
+ """ Return the site-relative path for 'content'
+
+ o The site is the parent of the tool.
+
+ o Return a sequence of path elements.
+
+ o Permission: Public
+ """
+
+ def getRelativeContentURL(content):
+ """ Return the site-relative URL for 'content', as a string.
+
+ o The site is the parent of the tool.
+
+ o This is helpful for virtual hosting situations.
+
+ o Same method as 'getRelativeURL()'
+
+ o Permission: Public
+ """
+
+ def getRelativeUrl(content):
+ """ Return the site-relative URL for 'content', as a string.
+
+ o The site is the parent of the tool.
+
+ o This is helpful for virtual hosting situations.
+
+ o Same method as 'getRelativeContentURL()'
+
+ o Permission: Public
+ """
+
+ def getPortalPath():
+ """ Return the portal object's URL without the server URL component.
+
+ o Return a slash-delimited string.
+
+ o Permission: Public
+ """
+
+
+#
+# Workflow tool interfaces
+#
+class IWorkflowTool(Interface):
+
+ """This tool accesses and changes the workflow state of content.
+ """
+
+ id = Attribute('id',
+ """ The ID of the tool.
+
+ o BBB: for use in 'getToolByName'; in the future, prefer
+ 'zapi.getUtility(IWorkflowTool)'.
+
+ o Must be set to "portal_workflow"
+ """,
+ )
+
+ def getCatalogVariablesFor(ob):
+ """ Return a mapping of "workflow-relevant" attributes.
+
+ o Invoked by 'portal_catalog' when indexing content.
+
+ o Allows workflows to add variables to the catalog based on workflow
+ status, making it possible to implement queues.
+
+ o Permission: Private (Python only)
+ """
+
+ def getActionsFor(ob):
+ """ Return a list of action dictionaries for 'ob'
+
+ o Generate the list as though queried via
+ 'ActionsTool.listFilteredActionsFor'.
+
+ o This method is deprecated and will be removed in CMF 1.7.
+
+ o Permission: Public
+ """
+
+ def doActionFor(ob, action, wf_id=None, *args, **kw):
+ """ Perform the given workflow action on 'ob'.
+
+ o 'ob' is the target object.
+
+ o 'action' is the ID of the action to perform.
+
+ o 'wf_id', if passed, is the ID of the workflow supplying the action.
+
+ o 'args' and 'kw', if passed, are applied to the invoked action.
+
+ o Invoked by user interface code, allowing the user to request a
+ workflow action.
+
+ o The workflow object must perform its own security checks.
+
+ o Permission: Public
+ """
+
+ def getInfoFor(ob, name, default=_marker, wf_id=None):
+ """ Return the given bit of workflow information for the object.
+
+ o 'ob' is the target object.
+
+ o 'name' is the name of the information requested.
+
+ o 'default', if passed, will be returned if 'name' is not found;
+ if 'default' is not passed, then raise ValueError.
+
+ o 'wf_id', if passed, is the ID of the workflow supplying the action.
+
+ o Invoked by user interface code, allowing the user to request
+ information provided by the workflow.
+
+ o The workflow object must perform its own security checks.
+
+ o Permission: Public
+ """
+
+ def notifyCreated(ob):
+ """ Notify all applicable workflows that an object has been created.
+
+ o 'ob' is the newly-created object; it will already be "seated"
+ in its new place.
+
+ o Permission: Private (Python only)
+ """
+
+ def notifyBefore(ob, action):
+ """ Notify all applicable workflows of an action before it happens.
+
+ o 'ob' is the content object which is the target of the action.
+
+ o 'action' usually corresponds to a method name.
+
+ o Participating workflows may veto the action by raising
+ WorkflowException.
+
+ o Unless vetoed, the tool will later call either a 'notifySuccess' or
+ 'notifyException'
+
+ o Permission: Private (Python only)
+ """
+
+ def notifySuccess(ob, action, result=None):
+ """ Notify all applicable workflows that an action has taken place.
+
+ o 'ob' is the content object which is the target of the action.
+
+ o 'action' usually corresponds to a method name.
+
+ o 'result' is the value returned from the action.
+
+ o Permission: Private (Python only)
+ """
+
+ def notifyException(ob, action, exc):
+ """ Notify all applicable workflows that an action failed.
+
+ o 'ob' is the content object which is the target of the action.
+
+ o 'action' usually corresponds to a method name.
+
+ o 'exc' is the 'sys.exec_info' triple for the exception.
+
+ o Permission: Private (Python only)
+ """
+
+ def getHistoryOf(wf_id, ob):
+ """ Returns the history of an object for a given workflow.
+
+ o 'wf_id' is the id of the selected workflow.
+
+ o 'ob' is the content object.
+
+ o Invoked by workflow definitions.
+
+ o Permission: Private (Python only)
+ """
+
+ def getStatusOf(wf_id, ob):
+ """ Return the last element of a workflow history for a given workflow.
+
+ o 'wf_id' is the id of the selected workflow.
+
+ o 'ob' is the content object.
+
+ o Invoked by workflow definitions.
+
+ o Permission: Private (Python only)
+ """
+
+ def setStatusOf(wf_id, ob, status):
+ """ Append a record to the workflow history of a given workflow.
+
+ o 'wf_id' is the id of the selected workflow.
+
+ o 'ob' is the content object.
+
+ o 'status' is a mapping defining the history item to append.
+
+ o Invoked by workflow definitions.
+
+ o Permission: Private (Python only)
+ """
+
+
+class IWorkflowDefinition(Interface):
+
+ """Plugin interface for workflow definitions managed by IWorkflowTool.
+ """
+
+ def getCatalogVariablesFor(ob):
+ """ Return a mapping of attributes relevant to this workflow.
+
+ o Invoked by the workflow tool.
+
+ o Allows workflows to add variables to the catalog based on workflow
+ status, making it possible to implement queues.
+
+ o Permission: Private (Python only)
+ """
+
+ def updateRoleMappingsFor(ob):
+ """ Update the object permissions according to the current workflow
+ state of 'ob'.
+
+ o Note that having the same permission(s) controlled by more than one
+ workflow defintiion for an object results in undefined behavior.
+
+ o Permission: Private (Python only)
+ """
+
+ def listObjectActions(info):
+ """ Return a sequence of IActionInformation defining workflow actions.
+
+ o 'info' is an ObjectActionInformation structure. XXX?
+
+ o Returned actions are relevant to 'info.content' (this method is
+ called only when this workflow is applicable to 'info.content').
+
+ o Invoked by the portal_workflow tool.
+
+ o Permission: Private (Python only)
+ """
+
+ def listGlobalActions(info):
+ """ Return a sequence of IActionInformation defining workflow actions.
+
+ o 'info' is an ObjectActionInformation structure. XXX?
+
+ o Returned actions are "global", i.e. relevant to the user and the
+ site, rather than to any particular content object (this method is
+ generally called on every request!)
+
+ o Invoked by the portal_workflow tool.
+
+ o Permission: Private (Python only)
+ """
+
+ def isActionSupported(ob, action):
+ """ Return True if the given workflow action is supported by this
+ workfow for a content object, else False.
+
+ o 'ob' is the content object.
+
+ o 'action' is the ID of the requested workflow action.
+
+ o Invoked by the portal_workflow tool.
+
+ o Permission: Private (Python only)
+ """
+
+ def doActionFor(ob, action, comment=''):
+ """ Perform the requested workflow action on a content object.
+
+ o 'ob' is the content object.
+
+ o 'action' is the ID of the requested workflow action.
+
+ o 'comment' is passed to the method corresponding to 'action'.
+
+ o Invoked by the portal_workflow tool.
+
+ o Allows the user to request a workflow action.
+
+ o This method must perform its own security checks.
+
+ o Permission: Private (Python only)
+ """
+
+ def isInfoSupported(ob, name):
+ """ Return True if the given info name is supported by this workflow
+ for a given content object, else False.
+
+ o 'ob' is the content object.
+
+ o 'name' is the name of the requested workflow information.
+
+ o Invoked by the portal_workflow tool.
+
+ o Permission: Private (Python only)
+ """
+
+ def getInfoFor(ob, name, default):
+ """ Return the requested workflow information for a content object.
+
+ o 'ob' is the content object.
+
+ o 'name' is the name of the requested workflow information.
+
+ o 'default' is returned if 'name' is not found.
+
+ o Invoked by the portal_workflow tool.
+
+ o This method must perform its own security checks.
+
+ o Permission: Private (Python only)
+ """
+
+ def notifyCreated(ob):
+ """ Notification that an object has been created and put in its place.
+
+ o 'ob' is the newly-created object.
+
+ o Invoked by the portal_workflow tool.
+
+ o The workflow may set initial workflow state, etc. for the new
+ object.
+
+ o Permission: Private (Python only)
+ """
+
+ def notifyBefore(ob, action):
+ """ Notification of a workflow action before it happens.
+
+ o 'ob' is the target object of the action.
+
+ o 'action' is a string identifying the impending action;
+ usually it corresponds to a method name.
+
+ o This workflow may veto by raising WorkflowException.
+
+ o Unless some workflow raises WorkflowException is thrown,
+ the workflow tool will emit either 'notifySuccess' or
+ 'notifyException' after the action.
+
+ o Invoked by the portal_workflow tool.
+
+ o Permission: Private (Python only)
+ """
+
+ def notifySuccess(ob, action, result):
+ """ Notification that a workflow action has taken place.
+
+ o 'ob' is the target object of the action.
+
+ o 'action' is a string identifying the succesful action;
+ usually it corresponds to a method name.
+
+ o 'result' is the return value from the method called.
+
+ o Invoked by the portal_workflow tool.
+
+ o Permission: Private (Python only)
+ """
+
+ def notifyException(ob, action, exc):
+ """ Notifies this workflow that an action failed.
+
+ o 'ob' is the target object of the action.
+
+ o 'action' is a string identifying the failed action;
+ usually it corresponds to a method name.
+
+ o 'exc' is the 'sys.exc_info' triple for the exception.
+
+ o Invoked by the portal_workflow tool.
+
+ o Permission: Private (Python only)
+ """
Property changes on: CMF/branches/goldegg-phase-1/CMFCore/interfaces/_tools.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_actions.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_actions.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_actions.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,164 +15,10 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class portal_actions(Interface):
- """ Gathers a list of links which the user is allowed to view according to
- the current context.
- """
- id = Attribute('id', 'Must be set to "portal_actions"')
-
- def listActionProviders():
- """ List the ids of all Action Providers queried by this tool.
-
- Permission -- Manage portal
-
- Returns -- Tuple of Action Provider ids
- """
-
- def addActionProvider(provider_name):
- """ Add an Action Provider id to the providers queried by this tool.
-
- A provider must implement the ActionProvider Interface.
- OldstyleActionProviders are currently also supported.
-
- The provider is only added if the actions tool can find the object
- corresponding to the provider_name.
-
- Permission -- Manage portal
- """
-
- def deleteActionProvider(provider_name):
- """ Delete an Action Provider id from providers queried by this tool.
-
- The deletion only takes place if provider_name is actually found among
- the known action providers.
-
- Permission -- Manage portal
- """
-
- def listFilteredActionsFor(object=None):
- """ List all actions available to the user.
-
- See the ActionInfo interface for provided keys. 'visible', 'available'
- and 'allowed' are always True in actions returned by this method.
-
- Permission -- Always available
-
- Returns -- Dictionary of category / ActionInfo list pairs
- """
-
-
-class ActionProvider(Interface):
- """ The interface expected of an object that can provide actions.
- """
-
- def listActions(info=None, object=None):
- """ List all the actions defined by a provider.
-
- If 'object' is specified, object specific actions are included.
-
- The 'info' argument is deprecated and may be removed in a future
- version. If 'object' isn't specified, the method uses for backwards
- compatibility 'info.content' as object.
-
- Returns -- Tuple of ActionInformation objects (or Action mappings)
- """
-
- def getActionObject(action):
- """Return the actions object or None if action doesn't exist.
-
- 'action' is an action 'path' (e.g. 'object/view').
-
- Raises an ValueError exception if the action is of the wrong format.
-
- Permission -- Private
-
- Returns -- The actions object reference.
- """
-
- def listActionInfos(action_chain=None, object=None, check_visibility=1,
- check_permissions=1, check_condition=1, max=-1):
- """ List ActionInfo objects.
-
- 'action_chain' is a sequence of action 'paths' (e.g. 'object/view').
- If specified, only these actions will be returned in the given order.
-
- If 'object' is specified, object specific Actions are included.
-
- If 'max' is specified, only the first max Actions are returned.
-
- Permission -- Always available (not publishable)
-
- Returns -- Tuple of ActionInfo objects
- """
-
- def getActionInfo(action_chain, object=None, check_visibility=0,
- check_condition=0):
- """ Get an ActionInfo object specified by a chain of actions.
-
- Permission -- Always available
-
- Returns -- ActionInfo object
- """
-
-
-class ActionCategory(Interface):
- """ Group of Action objects.
- """
-
- def listActions():
- """ List the actions defined in this category and its subcategories.
-
- Permission -- Python only
-
- Returns -- Tuple of Action objects.
- """
-
-
-class Action(Interface):
- """ Reference to an action.
- """
-
- def getInfoData():
- """ Get the data needed to create an ActionInfo.
-
- Default keys are: 'id', 'category', 'title', 'description', 'url',
- 'icon', 'available', 'permissions' and 'visible'.
-
- Instead of computed values callable expression objects or methods are
- returned. For performance reasons, these objects are called later and
- only if the values are actually needed. The keys for all these lazy
- values are registered in a separate list.
-
- Permission -- Python only
-
- Returns -- Lazy info mapping and list of lazy keys.
- """
-
-
-class ActionInfo(Interface):
- """ A lazy dictionary for Action infos.
-
- Each ActionInfo object has the following keys:
-
- - id (string): not unique identifier
-
- - title (string)
-
- - url (string): URL to access the action
-
- - category (string): one of "user", "folder", "object", "global",
- "workflow" or a custom category
-
- - visible (boolean)
-
- - available (boolean): the result of checking the condition
-
- - allowed (boolean): the result of checking permissions;
- The user must have at least one of the listed permissions to access
- the action. If the list is empty, the user is allowed.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_actions
+# - ActionProvider
+# - ActionCategory
+# - Action
+# - ActionInfo
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_catalog.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_catalog.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_catalog.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,60 +15,7 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class portal_catalog(Interface):
- '''This tool interacts with a customized ZCatalog.
- '''
- id = Attribute('id', 'Must be set to "portal_catalog"')
-
- # searchResults inherits security assertions from ZCatalog.
- def searchResults(REQUEST=None, **kw):
- '''Calls ZCatalog.searchResults() with extra arguments that
- limit the results to what the user is allowed to see.
- '''
-
- # __call__ inherits security assertions from ZCatalog.
- def __call__(REQUEST=None, **kw):
- '''Same as searchResults().'''
-
- def unrestrictedSearchResults(REQUEST=None, **kw):
- '''Calls ZCatalog.searchResults() without any CMF specific
- processing.
-
- Permission -- Python only
- '''
-
- def indexObject(object):
- """ Add to catalog.
-
- Permission -- Python only
- """
-
- def unindexObject(object):
- """ Remove from catalog.
-
- Permission -- Python only
- """
-
- def reindexObject(object, idxs=[], update_metadata=1):
- """ Update entry in catalog.
-
- The optional idxs argument is a list of specific indexes
- to update (all of them by default).
-
- Permission -- Python only
- """
-
-
-class IndexableObjectWrapper(Interface):
- """ Indexable object wrapper interface.
- """
-
- def allowedRolesAndUsers():
- """
- Return a list of roles and users with View permission.
- Used by PortalCatalog to filter out items you're not allowed to see.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_catalog
+# - IndexableObjectWrapper
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_discussion.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_discussion.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_discussion.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,45 +15,7 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class oldstyle_portal_discussion(Interface):
- """ Links content to discussions.
- """
- id = Attribute('id', 'Must be set to "portal_discussion"')
-
- def getDiscussionFor(content):
- """ Get DiscussionItemContainer for content, create it if necessary.
-
- Permission -- Always available
-
- Returns -- DiscussionItemContainer object
- """
-
- def isDiscussionAllowedFor(content):
- """ Get boolean indicating whether discussion is allowed for content.
-
- This may be looked up via an object-specific value, or by place, or
- from a site-wide policy.
-
- Permission -- Always available
-
- Returns -- Boolean value
- """
-
-
-class portal_discussion(oldstyle_portal_discussion):
- """ Links content to discussions.
- """
-
- def overrideDiscussionFor(content, allowDiscussion):
- """ Override discussability for the given object or clear the setting.
-
- If 'allowDiscussion' is None, then clear any overridden setting for
- discussability, letting the site's default policy apply. Otherwise,
- set the override to match the boolean equivalent of 'allowDiscussion'.
-
- Permission -- Always available
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - oldstyle_portal_discussion
+# - portal_discussion
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_memberdata.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_memberdata.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_memberdata.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,81 +15,7 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class portal_memberdata(Interface):
- '''A helper for portal_membership that transparently adds
- member data to user objects.
- '''
- id = Attribute('id', 'Must be set to "portal_memberdata"')
-
- ## wrapUser__roles__ = () # Private.
- def wrapUser(u):
- '''
- If possible, returns the Member object that corresponds
- to the given User object.
- '''
- ## getMemberDataContents__roles__ = () # Private.
- def getMemberDataContents():
- '''
- Returns a list containing a dictionary with information
- about the _members BTree contents: member_count is the
- total number of member instances stored in the memberdata-
- tool while orphan_count is the number of member instances
- that for one reason or another are no longer in the
- underlying acl_users user folder.
- The result is designed to be iterated over in a dtml-in
- '''
-
- def pruneMemberDataContents():
- """ Delete member data of all members not listet in acl_users.
-
- Compare the user IDs stored in the member data tool with the list in
- the actual underlying acl_users and delete anything not in acl_users.
-
- Permission -- Python only
- """
-
- def searchMemberData(search_param, search_term, attributes=()):
- """ Search members.
-
- Returns a sequence of dictionaries containing data for members
- that match the query as expressed by search_param and search_term.
- The contents of each member data mapping can be influenced by
- passing in a sequence of desired attributes, by default the only
- data returned is the username and the email address.
-
- Permission -- Python only
-
- Returns -- Sequence of dictionaries
- """
-
- def registerMemberData(m, id):
- """ Add the given member data to the _members btree.
-
- This is done as late as possible to avoid side effect transactions and
- to reduce the necessary number of entries.
-
- Permission -- Python only
- """
-
- def deleteMemberData(member_id):
- """ Delete member data of specified member.
-
- Permission -- Python only
-
- Returns -- Boolean value
- """
-
-
-class MemberData(Interface):
- """ MemberData interface.
- """
-
- def setProperties(properties=None, **kw):
- """ Allows the authenticated member to set his/her own properties.
-
- Permission -- Set own properties
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_memberdata
+# - MemberData
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_membership.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_membership.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_membership.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,207 +15,6 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class portal_membership(Interface):
- """ Deals with the details of how and where to store and retrieve
- members and their member folders.
- """
- id = Attribute('id', 'Must be set to "portal_membership"')
-
- def setPassword(password, domains=None):
- """ Allows the authenticated member to set his/her own password.
-
- Permission -- Set own password
- """
-
- def getAuthenticatedMember():
- """
- Returns the currently authenticated member object
- or the Anonymous User.
-
- Permission -- Always available
- """
-
- def isAnonymousUser():
- """
- Returns 1 if the user is not logged in.
-
- Permission -- Always available
- """
-
- def checkPermission(permissionName, object, subobjectName=None):
- """
- Checks whether the current user has the given permission on
- the given object or subobject.
-
- Permission -- Always available
- """
-
- def credentialsChanged(password):
- """
- Notifies the authentication mechanism that this user has changed
- passwords. This can be used to update the authentication cookie.
- Note that this call should *not* cause any change at all to user
- databases.
-
- Permission -- Always available
- """
-
- def getMembersFolder():
- """ Get the members folder object.
-
- If no members folder is set or the set folder id doesn't exist, None
- is returned.
-
- Permission -- Always available
-
- Returns -- Members folder object or None
- """
-
- def getHomeFolder(id=None, verifyPermission=0):
- """Returns a member's home folder object or None.
- Set verifyPermission to 1 to return None when the user
- doesn't have the View permission on the folder.
-
- Permission -- Always available
- """
-
- def getHomeUrl(id=None, verifyPermission=0):
- """Returns the URL to a member's home folder or None.
- Set verifyPermission to 1 to return None when the user
- doesn't have the View permission on the folder.
-
- Permission -- Always available
- """
-
- def getMemberById(id):
- """
- Returns the given member.
-
- Permission -- Manage users
- """
-
- def listMemberIds():
- """ Lists the ids of all members.
-
- This may eventually be replaced with a set of methods for querying
- pieces of the list rather than the entire list at once.
-
- Permission -- Manage users
- """
-
- def listMembers():
- """ Gets the list of all members.
-
- Permission -- Manage users
- """
-
- def getCandidateLocalRoles(obj):
- """ What local roles can I assign?
-
- Permission -- Always available
-
- Returns -- Tuple of roles
- """
-
- def setLocalRoles(obj, member_ids, member_role, reindex=1):
- """ Add local roles on an item.
-
- Permission -- Always available
- """
-
- def deleteLocalRoles(obj, member_ids, reindex=1, recursive=0):
- """ Delete local roles of specified members.
-
- Permission -- Always available
- """
-
- def addMember(id, password, roles, domains):
- """ Adds a new member to the user folder.
-
- Security checks will have already been performed. Called by
- portal_registration.
-
- Permission -- Python only
- """
-
- def deleteMembers(member_ids, delete_memberareas=1, delete_localroles=1):
- """ Delete members specified by member_ids.
-
- Delete members in acl_users and member data in portal_memberdata.
- If delete_memberareas is true, delete members' home folders including
- all content items. If delete_localroles is true, recursively delete
- members' local roles, starting from the portal root.
-
- Permission -- Manage users
-
- Returns -- Tuple listing member_ids of deleted members
- """
-
- def getPortalRoles():
- """
- Return all local roles defined by the portal itself,
- which means roles that are useful and understood
- by the portal object
-
- Permission -- Manage portal
- """
-
- def setRoleMapping(portal_role, userfolder_role):
- """
- set the mapping of roles between roles understood by
- the portal and roles coming from outside user sources
-
- Permission -- Manage portal
- """
-
- def getMappedRole(portal_role):
- """
- returns a role name if the portal role is mapped to
- something else or an empty string if it is not
-
- Permission -- Manage portal
- """
-
- def getMemberareaCreationFlag():
- """
- Returns the flag indicating whether the membership tool
- will create a member area if an authenticated user from
- an underlying user folder logs in first without going
- through the join process
-
- Permission -- Manage portal
- """
-
- def setMemberareaCreationFlag():
- """
- sets the flag indicating whether the membership tool
- will create a member area if an authenticated user from
- an underlying user folder logs in first without going
- through the join process
-
- Permission -- Manage portal
- """
-
- def createMemberArea(member_id=''):
- """ Create a member area for 'member_id' or authenticated user.
-
- Permission -- Always available
-
- Returns -- created member folder object or None
- """
-
- def createMemberarea(member_id=''):
- """ Deprecated alias of createMemberArea.
- """
-
- def deleteMemberArea(member_id):
- """ Delete member area of member specified by member_id.
-
- Permission -- Manage users
-
- Returns -- Boolean value
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_membership
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_metadata.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_metadata.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_metadata.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,88 +15,6 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class portal_metadata(Interface):
- """
- CMF metadata policies interface.
- """
- id = Attribute('id', 'Must be set to "portal_metadata"')
-
- #
- # Site-wide queries, specific to Dublin Core metadata.
- #
- def getFullName(userid):
- """ Convert an internal userid to a "formal" name.
-
- o Convert only if possible, perhaps using the 'portal_membership'
- tool; otherwise, return 'userid'.
-
- o Used to map userid's for Creator, Contributor DCMI queries.
- """
-
- def getPublisher():
- """ Return the "formal" name of the publisher of the site.
- """
-
- #
- # Content-specific queries, for Dublin Core metadata.
- #
- def listAllowedSubjects(content=None):
- """ List the allowed values of the 'Subject' DCMI element.
-
- o 'Subject' elements should be keywords categorizing their resource.
-
- o Return only values appropriate for content's type, or all values
- if content is None.
- """
-
- def listAllowedFormats(content=None):
- """ List the allowed values of the 'Format' DCMI element.
-
- o These items should be usable as HTTP 'Content-type' values.
-
- o Return only values appropriate for content's type, or all values
- if content is None.
- """
-
- def listAllowedLanguages(content=None):
- """ List the allowed values of the 'Language' DCMI element.
-
- o 'Language' element values should be suitable for generating
- HTTP headers.
-
- o Return only values appropriate for content's type, or all values if
- content is None.
- """
-
- def listAllowedRights(content=None):
- """ List the allowed values of the 'Rights' DCMI element.
-
- o The 'Rights' element describes copyright or other IP declarations
- pertaining to a resource.
-
- o Return only values appropriate for content's type, or all values if
- content is None.
- """
-
- #
- # Validation policy hooks.
- #
- def setInitialMetadata(content):
- """ Set initial values for content metatdata.
-
- o Supply any site-specific defaults.
- """
-
- def validateMetadata(content):
- """ Enforce portal-wide policies about metadata.
-
- o E.g., policies may require non-empty title/description, etc.
-
- o This method may be called by view / workflow code at "appropriate"
- times, such as immediately before saving changes to the metadata of
- an object.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_metadata
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_properties.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_properties.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_properties.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,31 +15,6 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class portal_properties(Interface):
- """ CMF Properties Tool interface.
-
- This interface provides access to "portal-wide" properties.
- """
- id = Attribute('id', 'Must be set to "portal_properties"')
-
- def editProperties(props):
- """ Change portal settings.
-
- Permission -- Manage portal
- """
-
- def title():
- """ Get portal title.
-
- Returns -- String
- """
-
- def smtp_server():
- """ Get local SMTP server.
-
- Returns -- String
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_properties
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_registration.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_registration.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_registration.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,64 +15,6 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class portal_registration(Interface):
- '''Establishes policies for member registration. Depends on
- portal_membership. Is not aware of membership storage details.
- '''
- id = Attribute('id', 'Must be set to "portal_registration"')
-
- #isRegistrationAllowed__roles__ = None # Anonymous permission
- def isRegistrationAllowed(REQUEST):
- '''Returns a boolean value indicating whether the user
- is allowed to add a member to the portal.
- '''
-
- #testPasswordValidity__roles__ = None # Anonymous permission
- def testPasswordValidity(password, confirm=None):
- '''If the password is valid, returns None. If not, returns
- a string explaining why.
- '''
-
- #testPropertiesValidity__roles__ = None # Anonymous permission
- def testPropertiesValidity(new_properties, member=None):
- '''If the properties are valid, returns None. If not, returns
- a string explaining why.
- '''
-
- #generatePassword__roles__ = None # Anonymous permission
- def generatePassword():
- '''Generates a password which is guaranteed to comply
- with the password policy.
- '''
-
- # permission: 'Add portal member'
- def addMember(id, password, roles=('Member',), domains='',
- properties=None):
- '''Creates a PortalMember and returns it. The properties argument
- can be a mapping with additional member properties. Raises an
- exception if the given id already exists, the password does not
- comply with the policy in effect, or the authenticated user is not
- allowed to grant one of the roles listed (where Member is a special
- role that can always be granted); these conditions should be
- detected before the fact so that a cleaner message can be printed.
- '''
-
- # permission: 'Add portal member'
- def isMemberIdAllowed(id):
- '''Returns 1 if the ID is not in use and is not reserved.
- '''
-
- #afterAdd__roles__ = () # No permission.
- def afterAdd(member, id, password, properties):
- '''Called by portal_registration.addMember()
- after a member has been added successfully.'''
-
- # permission: 'Mail forgotten password'
- def mailPassword(forgotten_userid, REQUEST):
- '''Email a forgotten password to a member. Raises an exception
- if user ID is not found.
- '''
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_registration
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_skins.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_skins.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_skins.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,58 +15,7 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class SkinsContainer(Interface):
- """ An object that provides skins.
- """
-
- def getSkinPath(name):
- """ Convert a skin name to a skin path.
-
- Permission -- Access contents information
- """
-
- def getDefaultSkin():
- """ Get the default skin name.
-
- Permission -- Access contents information
- """
-
- def getRequestVarname():
- """ Get the variable name to look for in the REQUEST.
-
- Permission -- Access contents information
- """
-
- def getSkinByPath(path, raise_exc=0):
- """ Get a skin at the given path.
-
- A skin path is of the format:
- 'some/path, some/other/path, ...' The first part has precedence.
-
- A skin is a specially wrapped object that looks through the layers
- in the correct order.
-
- Permission -- Python only
- """
-
- def getSkinByName(name):
- """ Get the named skin.
-
- Permission -- Python only
- """
-
-
-class portal_skins(SkinsContainer):
- """ An object that provides skins to a portal object.
- """
- id = Attribute('id', 'Must be set to "portal_skins"')
-
- def getSkinSelections():
- """ Get the sorted list of available skin names.
-
- Permission -- Always available
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - SkinsContainer
+# - portal_skins
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_types.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_types.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_types.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,135 +15,7 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class ContentTypeInformation(Interface):
- """
- Registry entry interface.
- """
- def Metatype():
- """
- Return the Zope 'meta_type' for this content object.
-
- o Deprecated (not all objects of a given type may even share
- the same meta_type).
- """
-
- def Title():
- """
- Return the "human readable" type name (note that it
- may not map exactly to the 'meta_type', e.g., for
- l10n/i18n or where a single content class is being
- used twice, under different names.
- """
-
- def Description():
- """
- Textual description of the class of objects (intended
- for display in a "constructor list").
- """
-
- def isConstructionAllowed(container):
- """
- Does the current user have the permission required in
- order to construct an instance?
- """
-
- def allowType(contentType):
- """
- Can objects of 'contentType' be added to containers whose
- type object we are?
- """
-
- def constructInstance(container, id):
- """
- Build a "bare" instance of the appropriate type in
- 'container', using 'id' as its id. Return the instance,
- seated in the container.
- """
-
- def allowDiscussion():
- """
- Can this type of object support discussion?
- """
-
- def getIcon():
- """
- Returns the portal-relative icon for this type.
- """
-
- def getMethodAliases():
- """ Get method aliases dict.
-
- Permission -- Manage portal
-
- Returns -- Dictionary
- """
-
- def setMethodAliases(aliases):
- """ Set method aliases dict.
-
- Permission -- Manage portal
-
- Returns -- Boolean value
- """
-
- def queryMethodID(alias, default=None, context=None):
- """ Query method ID by alias.
-
- context points to the object that calls queryMethodID. It may be used to
- return dynamic values based on the caller.
-
- Permission -- Always available
-
- Returns -- Method ID or default value
- """
-
-
-class portal_types(Interface):
- """
- Provides a configurable registry of portal content types.
- """
- id = Attribute('id', 'Must be set to "portal_types"')
-
- # getType__roles__ = None # Public
- def getTypeInfo(contentType):
- """
- Return an instance which implements the
- ContentTypeInformation interface, corresponding to
- the specified 'contentType'. If contentType is actually
- an object, rather than a string, attempt to look up
- the appropriate type info using its portal_type.
- """
-
- # listTypeInfo__roles__ = None # Public
- def listTypeInfo(container=None):
- """
- Return a sequence of instances which implement the
- ContentTypeInformation interface, one for each content
- type regisetered in the portal. If the container
- is specified, the list will be filtered according to
- the user's permissions.
- """
-
- def listContentTypes(container=None, by_metatype=0):
- """ List type info IDs.
-
- If 'container' is passed, then filter the list to include only types
- which are addable in 'container'.
-
- Passing 'by_metatype' is deprecated (type information may not
- correspond 1:1 to an underlying meta_type). This argument will be
- removed when CMFCore/dtml/catalogFind.dtml doesn't need it anymore.
- """
-
- def constructContent(contentType, container, id, RESPONSE=None
- , *args, **kw):
- """
- Build an instance of the appropriate content class in
- 'container', using 'id'. If RESPONSE is provided, redirect
- to the new object's "initial view", otherwise return the
- new object's Id string.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - ContentTypeInformation
+# - portal_types
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_undo.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_undo.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_undo.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,24 +15,6 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class portal_undo(Interface):
- '''Provides access to Zope undo functions.
- '''
- id = Attribute('id', 'Must be set to "portal_undo"')
-
- # permission: 'Undo changes'
- def listUndoableTransactionsFor(object,
- first_transaction=None,
- last_transaction=None,
- PrincipiaUndoBatchSize=None):
- '''Lists all transaction IDs the user is allowed to undo.
- '''
-
- # permission: 'Undo changes'
- def undo(object, transaction_info):
- '''Performs an undo operation.
- '''
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_undo
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_url.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_url.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_url.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,69 +15,6 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-
-class portal_url(Interface):
- """ CMF URL Tool interface.
-
- This interface provides a common mechanism for finding the 'root'
- object of a CMFSite, and for computing paths to objects relative to
- that root.
- """
- id = Attribute('id', 'Must be set to "portal_url"')
-
- def __call__(relative=0, *args, **kw):
- """ Get by default the absolute URL of the portal.
-
- Permission -- Always available
-
- Returns -- Slash-separated string
- """
-
- def getPortalObject():
- """ Get the portal object itself.
-
- Permission -- Always available
-
- Returns -- CMFSite object
- """
-
- def getRelativeContentPath(content):
- """ Get the path for an object, relative to the portal root.
-
- Permission -- Always available
-
- Returns -- Tuple of IDs
- """
-
- def getRelativeContentURL(content):
- """ Get the URL for an object, relative to the portal root.
-
- This is helpful for virtual hosting situations.
- Same method as 'getRelativeURL()'
-
- Permission -- Always available
-
- Returns -- Slash-separated string
- """
-
- def getRelativeUrl(content):
- """ Get the URL for an object, relative to the portal root.
-
- This is helpful for virtual hosting situations.
- Same method as 'getRelativeContentURL()'
-
- Permission -- Always available
-
- Returns -- Slash-separated string
- """
-
- def getPortalPath():
- """ Get the portal object's URL without the server URL component.
-
- Permission -- Always available
-
- Returns -- Slash-separated string
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_url
Modified: CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_workflow.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_workflow.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFCore/interfaces/portal_workflow.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,203 +15,7 @@
$Id$
"""
-from Interface import Attribute
-from Interface import Interface
-
-_marker = []
-
-
-class portal_workflow(Interface):
- '''This tool accesses and changes the workflow state of content.
- '''
- id = Attribute('id', 'Must be set to "portal_workflow"')
-
- # security.declarePrivate('getCatalogVariablesFor')
- def getCatalogVariablesFor(ob):
- '''
- Invoked by portal_catalog. Allows workflows
- to add variables to the catalog based on workflow status,
- making it possible to implement queues.
- Returns a mapping containing the catalog variables
- that apply to ob.
- '''
-
- # security.declarePublic('getActionsFor')
- def getActionsFor(ob):
- '''
- This method is deprecated and will be removed in CMF 1.7.
-
- Return a list of action dictionaries for 'ob', just as though
- queried via 'ActionsTool.listFilteredActionsFor'.
- '''
-
- # security.declarePublic('doActionFor')
- def doActionFor(ob, action, wf_id=None, *args, **kw):
- '''
- Invoked by user interface code.
- Allows the user to request a workflow action. The workflow object
- must perform its own security checks.
- '''
-
- # security.declarePublic('getInfoFor')
- def getInfoFor(ob, name, default=_marker, wf_id=None, *args, **kw):
- '''
- Invoked by user interface code. Allows the user to request
- information provided by the workflow. The workflow object
- must perform its own security checks.
- '''
-
- # security.declarePrivate('notifyCreated')
- def notifyCreated(ob):
- '''
- Notifies all applicable workflows after an object has been created
- and put in its new place.
- '''
-
- # security.declarePrivate('notifyBefore')
- def notifyBefore(ob, action):
- '''
- Notifies all applicable workflows of an action before it happens,
- allowing veto by exception. Unless an exception is thrown, either
- a notifySuccess() or notifyException() can be expected later on.
- The action usually corresponds to a method name.
- '''
-
- # security.declarePrivate('notifySuccess')
- def notifySuccess(ob, action, result=None):
- '''
- Notifies all applicable workflows that an action has taken place.
- '''
-
- # security.declarePrivate('notifyException')
- def notifyException(ob, action, exc):
- '''
- Notifies all applicable workflows that an action failed.
- '''
-
- # security.declarePrivate('getHistoryOf')
- def getHistoryOf(wf_id, ob):
- '''
- Invoked by workflow definitions. Returns the history
- of an object.
- '''
-
- # security.declarePrivate('getStatusOf')
- def getStatusOf(wf_id, ob):
- '''
- Invoked by workflow definitions. Returns the last element of a
- history.
- '''
-
- # security.declarePrivate('setStatusOf')
- def setStatusOf(wf_id, ob, status):
- '''
- Invoked by workflow definitions. Appends to the workflow history.
- '''
-
-
-class WorkflowDefinition(Interface):
- '''The interface expected of workflow definitions objects.
- Accesses and changes the workflow state of objects.
- '''
-
- # security.declarePrivate('getCatalogVariablesFor')
- def getCatalogVariablesFor(ob):
- '''
- Invoked by the portal_workflow tool.
- Allows this workflow to make workflow-specific variables
- available to the catalog, making it possible to implement
- queues in a simple way.
- Returns a mapping containing the catalog variables
- that apply to ob.
- '''
-
- #security.declarePrivate('updateRoleMappingsFor')
- def updateRoleMappingsFor(ob):
- '''
- Updates the object permissions according to the current
- workflow state.
- '''
-
- # security.declarePrivate('listObjectActions')
- def listObjectActions(info):
- '''
- Invoked by the portal_workflow tool.
- Allows this workflow to
- include actions to be displayed in the actions box.
- Called only when this workflow is applicable to
- info.content.
- Returns the actions to be displayed to the user.
- '''
-
- # security.declarePrivate('listGlobalActions')
- def listGlobalActions(info):
- '''
- Invoked by the portal_workflow tool.
- Allows this workflow to
- include actions to be displayed in the actions box.
- Generally called on every request!
- Returns the actions to be displayed to the user.
- '''
-
- # security.declarePrivate('isActionSupported')
- def isActionSupported(ob, action):
- '''
- Invoked by the portal_workflow tool.
- Returns a true value if the given action name is supported.
- '''
-
- # security.declarePrivate('doActionFor')
- def doActionFor(ob, action, comment=''):
- '''
- Invoked by the portal_workflow tool.
- Allows the user to request a workflow action. This method
- must perform its own security checks.
- '''
-
- # security.declarePrivate('isInfoSupported')
- def isInfoSupported(ob, name):
- '''
- Invoked by the portal_workflow tool.
- Returns a true value if the given info name is supported.
- '''
-
- # security.declarePrivate('getInfoFor')
- def getInfoFor(ob, name, default):
- '''
- Invoked by the portal_workflow tool.
- Allows the user to request information provided by the
- workflow. This method must perform its own security checks.
- '''
-
- # security.declarePrivate('notifyCreated')
- def notifyCreated(ob):
- '''
- Invoked by the portal_workflow tool.
- Notifies this workflow after an object has been created
- and put in its new place.
- '''
-
- # security.declarePrivate('notifyBefore')
- def notifyBefore(ob, action):
- '''
- Invoked by the portal_workflow tool.
- Notifies this workflow of an action before it happens,
- allowing veto by exception. Unless an exception is thrown, either
- a notifySuccess() or notifyException() can be expected later on.
- The action usually corresponds to a method name.
- '''
-
- # security.declarePrivate('notifySuccess')
- def notifySuccess(ob, action, result):
- '''
- Invoked by the portal_workflow tool.
- Notifies this workflow that an action has taken place.
- '''
-
- # security.declarePrivate('notifyException')
- def notifyException(ob, action, exc):
- '''
- Invoked by the portal_workflow tool.
- Notifies this workflow that an action failed.
- '''
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_workflow
+# - WorkflowDefinition
Modified: CMF/branches/goldegg-phase-1/CMFDefault/DefaultWorkflow.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/DefaultWorkflow.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/DefaultWorkflow.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -21,9 +21,11 @@
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
from Globals import InitializeClass
+from zope.interface import implements
+from Products.CMFCore.interfaces import IWorkflowDefinition
from Products.CMFCore.interfaces.portal_workflow \
- import WorkflowDefinition as IWorkflowDefinition
+ import WorkflowDefinition as z2IWorkflowDefinition
from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.utils import _modifyPermissionMappings
from Products.CMFCore.utils import getToolByName
@@ -37,10 +39,12 @@
class DefaultWorkflowDefinition (SimpleItemWithProperties):
+
""" Default workflow definition.
"""
- __implements__ = IWorkflowDefinition
+ implements(IWorkflowDefinition)
+ __implements__ = z2IWorkflowDefinition
meta_type = 'Workflow'
id = 'default_workflow'
Modified: CMF/branches/goldegg-phase-1/CMFDefault/DiscussionItem.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/DiscussionItem.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/DiscussionItem.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -22,9 +22,14 @@
from Globals import Persistent
from Globals import PersistentMapping
from OFS.Traversable import Traversable
+from zope.interface import implements
-from Products.CMFCore.interfaces.Discussions import Discussable
-from Products.CMFCore.interfaces.Discussions import DiscussionResponse
+from Products.CMFCore.interfaces import IDiscussable
+from Products.CMFCore.interfaces import IDiscussionResponse
+from Products.CMFCore.interfaces.Discussions \
+ import Discussable as z2IDiscussable
+from Products.CMFCore.interfaces.Discussions \
+ import DiscussionResponse as z2IDiscussionResponse
from Products.CMFCore.utils import getToolByName
from Document import Document
@@ -62,9 +67,9 @@
def addDiscussionItem(self, id, title, description, text_format, text,
reply_to, RESPONSE=None):
- """
- Add a discussion item
+ """ Add a discussion item
+
'title' is also used as the subject header
if 'description' is blank, it is filled with the contents of 'title'
'reply_to' is the object (or path to the object) which this is a reply to
@@ -89,11 +94,12 @@
class DiscussionItem(Document):
+
+ """ Class for content which is a response to other content.
"""
- Class for content which is a response to other content.
- """
- __implements__ = (DiscussionResponse, Document.__implements__)
+ implements(IDiscussionResponse)
+ __implements__ = (z2IDiscussionResponse, Document.__implements__)
meta_type = 'Discussion Item'
portal_type = 'Discussion Item'
@@ -117,12 +123,11 @@
return self.creators
#
- # DiscussionResponse interface
+ # IDiscussionResponse interface
#
security.declareProtected(View, 'inReplyTo')
def inReplyTo( self, REQUEST=None ):
- """
- Return the Discussable object to which we are a reply.
+ """ Return the IDiscussable object to which we are a reply.
Two cases obtain:
@@ -171,6 +176,7 @@
class DiscussionItemContainer( Persistent, Implicit, Traversable ):
+
"""
Store DiscussionItem objects. Discussable content that
has DiscussionItems associated with it will have an
@@ -178,7 +184,8 @@
hold the discussion threads.
"""
- __implements__ = Discussable
+ implements(IDiscussable)
+ __implements__ = z2IDiscussable
# for the security machinery to allow traversal
#__roles__ = None
@@ -283,7 +290,7 @@
return self._container.values()
#
- # Discussable interface
+ # IDiscussable interface
#
security.declareProtected(ReplyToItem, 'createReply')
def createReply( self, title, text, Creator=None, text_format='structured-text' ):
@@ -368,8 +375,7 @@
security.declareProtected(View, 'getReplies')
def getReplies( self ):
- """
- Return a sequence of the DiscussionResponse objects which are
+ """ Return a sequence of the IDiscussionResponse objects which are
associated with this Discussable
"""
objects = []
Modified: CMF/branches/goldegg-phase-1/CMFDefault/DiscussionTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/DiscussionTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/DiscussionTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -20,12 +20,14 @@
from Globals import DTMLFile
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements
from Products.CMFCore.ActionProviderBase import ActionProviderBase
+from Products.CMFCore.interfaces import IDiscussionTool
from Products.CMFCore.interfaces.Discussions \
- import DiscussionResponse as IDiscussionResponse
+ import DiscussionResponse as z2IDiscussionResponse
from Products.CMFCore.interfaces.portal_discussion \
- import portal_discussion as IDiscussionTool
+ import portal_discussion as z2IDiscussionTool
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.utils import UniqueObject
@@ -43,7 +45,8 @@
""" Links content to discussions.
"""
- __implements__ = (IDiscussionTool, ActionProviderBase.__implements__)
+ implements(IDiscussionTool)
+ __implements__ = (z2IDiscussionTool, ActionProviderBase.__implements__)
id = 'portal_discussion'
meta_type = 'Default Discussion Tool'
@@ -86,7 +89,7 @@
if not self.isDiscussionAllowedFor( content ):
raise DiscussionNotAllowed
- if not IDiscussionResponse.isImplementedBy(content) and \
+ if not z2IDiscussionResponse.isImplementedBy(content) and \
getattr( aq_base(content), 'talkback', None ) is None:
# Discussion Items use the DiscussionItemContainer object of the
# related content item, so only create one for other content items
Modified: CMF/branches/goldegg-phase-1/CMFDefault/Document.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/Document.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/Document.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,6 +15,7 @@
$Id$
"""
+import transaction
from AccessControl import ClassSecurityInfo
from AccessControl import getSecurityManager
from Acquisition import aq_base
@@ -22,7 +23,7 @@
from Globals import DTMLFile
from Globals import InitializeClass
from StructuredText.StructuredText import HTML
-import transaction
+from zope.interface import implements
from Products.CMFCore.PortalContent import PortalContent
from Products.CMFCore.utils import contributorsplitter
@@ -31,8 +32,10 @@
from DublinCore import DefaultDublinCoreImpl
from exceptions import EditingConflict
from exceptions import ResourceLockedError
-from interfaces.Document import IDocument
-from interfaces.Document import IMutableDocument
+from interfaces import IDocument
+from interfaces import IMutableDocument
+from interfaces.Document import IDocument as z2IDocument
+from interfaces.Document import IMutableDocument as z2IMutableDocument
from permissions import ModifyPortalContent
from permissions import View
from utils import _dtmldir
@@ -84,9 +87,11 @@
class Document(PortalContent, DefaultDublinCoreImpl):
+
""" A Document - Handles both StructuredText and HTML """
- __implements__ = (IDocument, IMutableDocument,
+ implements(IDocument, IMutableDocument)
+ __implements__ = (z2IDocument, z2IMutableDocument,
PortalContent.__implements__,
DefaultDublinCoreImpl.__implements__)
Modified: CMF/branches/goldegg-phase-1/CMFDefault/DublinCore.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/DublinCore.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/DublinCore.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -21,10 +21,17 @@
from Globals import DTMLFile
from Globals import InitializeClass
from OFS.PropertyManager import PropertyManager
+from zope.interface import implements
-from Products.CMFCore.interfaces.DublinCore import CatalogableDublinCore
-from Products.CMFCore.interfaces.DublinCore import DublinCore
-from Products.CMFCore.interfaces.DublinCore import MutableDublinCore
+from Products.CMFCore.interfaces import ICatalogableDublinCore
+from Products.CMFCore.interfaces import IDublinCore
+from Products.CMFCore.interfaces import IMutableDublinCore
+from Products.CMFCore.interfaces.DublinCore \
+ import CatalogableDublinCore as z2ICatalogableDublinCore
+from Products.CMFCore.interfaces.DublinCore \
+ import DublinCore as z2IDublinCore
+from Products.CMFCore.interfaces.DublinCore \
+ import MutableDublinCore as z2IMutableDublinCore
from Products.CMFCore.utils import getToolByName
from permissions import ModifyPortalContent
@@ -38,12 +45,17 @@
# For http://www.zope.org/Collectors/CMF/325
# We only really need this once, at startup.
_zone = DateTime().timezone()
-
+
+
class DefaultDublinCoreImpl( PropertyManager ):
+
""" Mix-in class which provides Dublin Core methods.
"""
- __implements__ = DublinCore, CatalogableDublinCore, MutableDublinCore
+ implements(IDublinCore, ICatalogableDublinCore, IMutableDublinCore)
+ __implements__ = (z2IDublinCore, z2ICatalogableDublinCore,
+ z2IMutableDublinCore)
+
security = ClassSecurityInfo()
def __init__( self
Modified: CMF/branches/goldegg-phase-1/CMFDefault/MembershipTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/MembershipTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/MembershipTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -21,6 +21,7 @@
from Acquisition import aq_parent
from Globals import DTMLFile
from Globals import InitializeClass
+from zope.interface import implements
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.MembershipTool import MembershipTool as BaseTool
@@ -29,8 +30,9 @@
from Products.CMFCore.utils import getToolByName
from Document import addDocument
+from interfaces import IMembershipTool
from interfaces.portal_membership \
- import portal_membership as IMembershipTool
+ import portal_membership as z2IMembershipTool
from permissions import ListPortalMembers
from permissions import ManagePortal
from permissions import ManageUsers
@@ -54,7 +56,8 @@
""" Implement 'portal_membership' interface using "stock" policies.
"""
- __implements__ = (IMembershipTool, ActionProviderBase.__implements__)
+ implements(IMembershipTool)
+ __implements__ = (z2IMembershipTool, ActionProviderBase.__implements__)
meta_type = 'Default Membership Tool'
membersfolder_id = 'Members'
Modified: CMF/branches/goldegg-phase-1/CMFDefault/MetadataTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/MetadataTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/MetadataTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -21,10 +21,12 @@
from Globals import InitializeClass
from Globals import PersistentMapping
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements
from Products.CMFCore.ActionProviderBase import ActionProviderBase
+from Products.CMFCore.interfaces import IMetadataTool
from Products.CMFCore.interfaces.portal_metadata \
- import portal_metadata as IMetadataTool
+ import portal_metadata as z2IMetadataTool
from Products.CMFCore.utils import UniqueObject
from exceptions import MetadataError
@@ -204,7 +206,8 @@
class MetadataTool( UniqueObject, SimpleItem, ActionProviderBase ):
- __implements__ = (IMetadataTool, ActionProviderBase.__implements__)
+ implements(IMetadataTool)
+ __implements__ = (z2IMetadataTool, ActionProviderBase.__implements__)
id = 'portal_metadata'
meta_type = 'Default Metadata Tool'
Modified: CMF/branches/goldegg-phase-1/CMFDefault/PropertiesTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/PropertiesTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/PropertiesTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -19,10 +19,12 @@
from Acquisition import aq_inner, aq_parent
from Globals import InitializeClass, DTMLFile
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements
from Products.CMFCore.ActionProviderBase import ActionProviderBase
+from Products.CMFCore.interfaces import IPropertiesTool
from Products.CMFCore.interfaces.portal_properties \
- import portal_properties as IPropertiesTool
+ import portal_properties as z2IPropertiesTool
from Products.CMFCore.utils import UniqueObject
from permissions import ManagePortal
@@ -31,7 +33,8 @@
class PropertiesTool(UniqueObject, SimpleItem, ActionProviderBase):
- __implements__ = (IPropertiesTool, ActionProviderBase.__implements__)
+ implements(IPropertiesTool)
+ __implements__ = (z2IPropertiesTool, ActionProviderBase.__implements__)
id = 'portal_properties'
meta_type = 'Default Properties Tool'
Deleted: CMF/branches/goldegg-phase-1/CMFDefault/bridge.zcml
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/bridge.zcml 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/bridge.zcml 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,23 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/five"
- >
-
- <bridge
- zope2=".interfaces.Document.IDocument"
- package=".interfaces"
- name="IDocument"
- />
-
- <bridge
- zope2=".interfaces.Document.IMutableDocument"
- package=".interfaces"
- name="IMutableDocument"
- />
-
- <bridge
- zope2=".interfaces.portal_membership.portal_membership"
- package=".interfaces"
- name="IMembershipTool"
- />
-
-</configure>
Modified: CMF/branches/goldegg-phase-1/CMFDefault/configure.zcml
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/configure.zcml 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/configure.zcml 2005-09-24 14:27:06 UTC (rev 38588)
@@ -2,10 +2,6 @@
xmlns="http://namespaces.zope.org/zope"
>
- <include file="bridge.zcml"/>
-
- <include file="implements.zcml"/>
-
<include package=".browser"/>
</configure>
Deleted: CMF/branches/goldegg-phase-1/CMFDefault/implements.zcml
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/implements.zcml 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/implements.zcml 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,81 +0,0 @@
-<configure
- xmlns="http://namespaces.zope.org/five"
- >
-
- <!-- DefaultWorkflow -->
-
- <implements
- class=".DefaultWorkflow.DefaultWorkflowDefinition"
- interface="Products.CMFCore.interfaces.IWorkflowDefinition"
- />
-
- <!-- DiscussionItem -->
-
- <implements
- class=".DiscussionItem.DiscussionItem"
- interface="Products.CMFCore.interfaces.IDiscussionResponse"
- />
-
- <implements
- class=".DiscussionItem.DiscussionItemContainer"
- interface="Products.CMFCore.interfaces.IDiscussable"
- />
-
- <!-- DiscussionTool -->
-
- <implements
- class=".DiscussionTool.DiscussionTool"
- interface="Products.CMFCore.interfaces.IDiscussionTool"
- />
-
- <!-- Document -->
-
- <implements
- class=".Document.Document"
- interface=".interfaces.IDocument"
- />
-
- <implements
- class=".Document.Document"
- interface=".interfaces.IMutableDocument"
- />
-
- <!-- DublinCore -->
-
- <implements
- class=".DublinCore.DefaultDublinCoreImpl"
- interface="Products.CMFCore.interfaces.IDublinCore"
- />
-
- <implements
- class=".DublinCore.DefaultDublinCoreImpl"
- interface="Products.CMFCore.interfaces.ICatalogableDublinCore"
- />
-
- <implements
- class=".DublinCore.DefaultDublinCoreImpl"
- interface="Products.CMFCore.interfaces.IMutableDublinCore"
- />
-
- <!-- MembershipTool -->
-
- <implements
- class=".MembershipTool.MembershipTool"
- interface=".interfaces.IMembershipTool"
- />
-
- <!-- MetadataTool -->
-
- <implements
- class=".MetadataTool.MetadataTool"
- interface="Products.CMFCore.interfaces.IMetadataTool"
- />
-
- <!-- PropertiesTool -->
-
- <implements
- class=".PropertiesTool.PropertiesTool"
- interface="Products.CMFCore.interfaces.IPropertiesTool"
- />
-
-</configure>
Modified: CMF/branches/goldegg-phase-1/CMFDefault/interfaces/Document.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/interfaces/Document.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/interfaces/Document.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,32 +15,6 @@
$Id$
"""
-from Interface import Interface
-
-
-class IDocument(Interface):
-
- """ Textual content, in one of several formats.
-
- o Allowed formats include: structured text, HTML, plain text.
- """
-
- def CookedBody():
- """ Get the "cooked" (ready for presentation) form of the text.
- """
-
- def EditableBody():
- """ Get the "raw" (as edited) form of the text.
- """
-
-class IMutableDocument(IDocument):
-
- """ Updatable form of IDocument.
- """
-
- def edit(text_format, text, file='', safety_belt=''):
- """ Update the document.
-
- o 'safety_belt', if passed, must match the value issued when the edit
- began.
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - IDocument
Modified: CMF/branches/goldegg-phase-1/CMFDefault/interfaces/__init__.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/interfaces/__init__.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/interfaces/__init__.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -14,3 +14,18 @@
$Id$
"""
+
+from _content import *
+from _tools import *
+
+# BBB: will be removed in CMF 2.2
+# create zope2 interfaces
+from Interface.bridge import createZope3Bridge
+import Document
+import portal_membership
+
+createZope3Bridge(IDocument, Document, 'IDocument')
+createZope3Bridge(IMutableDocument, Document, 'IMutableDocument')
+createZope3Bridge(IMembershipTool, portal_membership, 'portal_membership')
+
+del createZope3Bridge
Added: CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_content.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_content.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_content.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -0,0 +1,47 @@
+##############################################################################
+#
+# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" CMFDefault content interfaces.
+
+$Id$
+"""
+
+from zope.interface import Interface
+
+
+class IDocument(Interface):
+
+ """ Textual content, in one of several formats.
+
+ o Allowed formats include: structured text, HTML, plain text.
+ """
+
+ def CookedBody():
+ """ Get the "cooked" (ready for presentation) form of the text.
+ """
+
+ def EditableBody():
+ """ Get the "raw" (as edited) form of the text.
+ """
+
+
+class IMutableDocument(IDocument):
+
+ """ Updatable form of IDocument.
+ """
+
+ def edit(text_format, text, file='', safety_belt=''):
+ """ Update the document.
+
+ o 'safety_belt', if passed, must match the value issued when the edit
+ began.
+ """
Property changes on: CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_content.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_tools.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_tools.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_tools.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -0,0 +1,34 @@
+##############################################################################
+#
+# Copyright (c) 2005 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" CMFDefault tool interfaces.
+
+$Id$
+"""
+
+from Products.CMFCore.interfaces import IMembershipTool as BaseInterface
+
+
+class IMembershipTool(BaseInterface):
+
+ """ Declare product-specific APIs for CMFDefault's tool.
+ """
+
+ def setMembersFolderById(id=''):
+ """ Set the members folder object by its id.
+
+ The members folder has to be in the same container as the membership
+ tool. id is the id of an existing folder. If id is empty, member areas
+ are disabled.
+
+ Permission -- Manage portal
+ """
Property changes on: CMF/branches/goldegg-phase-1/CMFDefault/interfaces/_tools.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: CMF/branches/goldegg-phase-1/CMFDefault/interfaces/portal_membership.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFDefault/interfaces/portal_membership.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFDefault/interfaces/portal_membership.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,20 +15,6 @@
$Id$
"""
-from Products.CMFCore.interfaces.portal_membership \
- import portal_membership as BaseInterface
-
-
-class portal_membership(BaseInterface):
- """ Declare product-specific APIs for CMFDefault's tool.
- """
-
- def setMembersFolderById(id=''):
- """ Set the members folder object by its id.
-
- The members folder has to be in the same container as the membership
- tool. id is the id of an existing folder. If id is empty, member areas
- are disabled.
-
- Permission -- Manage portal
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - portal_membership
Modified: CMF/branches/goldegg-phase-1/CMFSetup/actions.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFSetup/actions.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFSetup/actions.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -19,7 +19,8 @@
from Globals import InitializeClass
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from Products.CMFCore.ActionProviderBase import IActionProvider
+from Products.CMFCore.interfaces.portal_actions \
+ import ActionProvider as IActionProvider
from Products.CMFCore.utils import getToolByName
from permissions import ManagePortal
Deleted: CMF/branches/goldegg-phase-1/CMFSetup/tests/conformance.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFSetup/tests/conformance.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFSetup/tests/conformance.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,100 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" Base classes for testing interface conformance.
-
-Derived testcase classes should define '_getTargetClass()', which must
-return the class being tested for conformance.
-
-$Id$
-"""
-
-class ConformsToISetupContext:
-
- def test_ISetupContext_conformance( self ):
-
- from Products.CMFSetup.interfaces import ISetupContext
- from Interface.Verify import verifyClass
-
- verifyClass( ISetupContext, self._getTargetClass() )
-
-class ConformsToIImportContext:
-
- def test_IImportContext_conformance( self ):
-
- from Products.CMFSetup.interfaces import IImportContext
- from Interface.Verify import verifyClass
-
- verifyClass( IImportContext, self._getTargetClass() )
-
-class ConformsToIExportContext:
-
- def test_IExportContext_conformance( self ):
-
- from Products.CMFSetup.interfaces import IExportContext
- from Interface.Verify import verifyClass
-
- verifyClass( IExportContext, self._getTargetClass() )
-
-class ConformsToIStepRegistry:
-
- def test_IStepRegistry_conformance( self ):
-
- from Products.CMFSetup.interfaces import IStepRegistry
- from Interface.Verify import verifyClass
-
- verifyClass( IStepRegistry, self._getTargetClass() )
-
-class ConformsToIImportStepRegistry:
-
- def test_IImportStepRegistry_conformance( self ):
-
- from Products.CMFSetup.interfaces import IImportStepRegistry
- from Interface.Verify import verifyClass
-
- verifyClass( IImportStepRegistry, self._getTargetClass() )
-
-class ConformsToIExportStepRegistry:
-
- def test_IExportStepRegistry_conformance( self ):
-
- from Products.CMFSetup.interfaces import IExportStepRegistry
- from Interface.Verify import verifyClass
-
- verifyClass( IExportStepRegistry, self._getTargetClass() )
-
-class ConformsToIToolsetRegistry:
-
- def test_IToolsetRegistry_conformance( self ):
-
- from Products.CMFSetup.interfaces import IToolsetRegistry
- from Interface.Verify import verifyClass
-
- verifyClass( IToolsetRegistry, self._getTargetClass() )
-
-class ConformsToIProfileRegistry:
-
- def test_IProfileRegistry_conformance( self ):
-
- from Products.CMFSetup.interfaces import IProfileRegistry
- from Interface.Verify import verifyClass
-
- verifyClass( IProfileRegistry, self._getTargetClass() )
-
-class ConformsToISetupTool:
-
- def test_ISetupTool_conformance( self ):
-
- from Products.CMFSetup.interfaces import ISetupTool
- from Interface.Verify import verifyClass
-
- verifyClass( ISetupTool, self._getTargetClass() )
Modified: CMF/branches/goldegg-phase-1/CMFTopic/DateCriteria.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFTopic/DateCriteria.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFTopic/DateCriteria.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -18,21 +18,26 @@
from AccessControl import ClassSecurityInfo
from DateTime.DateTime import DateTime
from Globals import InitializeClass
+from zope.interface import implements
+from AbstractCriterion import AbstractCriterion
+from interfaces import Criterion as z2ICriterion
+from interfaces import ICriterion
+from permissions import ChangeTopics
from permissions import View
-from permissions import ChangeTopics
-from AbstractCriterion import AbstractCriterion
-from interfaces import Criterion
from Topic import Topic
class FriendlyDateCriterion( AbstractCriterion ):
+
"""
Put a friendly interface on date range searches, like
'where effective date is less than 5 days old'.
"""
- __implements__ = ( Criterion, )
+ implements(ICriterion)
+ __implements__ = z2ICriterion
+
meta_type = 'Friendly Date Criterion'
security = ClassSecurityInfo()
Modified: CMF/branches/goldegg-phase-1/CMFTopic/ListCriterion.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFTopic/ListCriterion.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFTopic/ListCriterion.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -14,24 +14,29 @@
$Id$
"""
+
+from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
-from AccessControl import ClassSecurityInfo
+from zope.interface import implements
-
+from AbstractCriterion import AbstractCriterion
+from interfaces import Criterion as z2ICriterion
+from interfaces import ICriterion
+from permissions import ChangeTopics
from permissions import View
-from permissions import ChangeTopics
-from AbstractCriterion import AbstractCriterion
-from interfaces import Criterion
from Topic import Topic
class ListCriterion( AbstractCriterion ):
+
"""
Represent a criterion which is a list of values (for an
'OR' search).
"""
- __implements__ = ( Criterion, )
+ implements(ICriterion)
+ __implements__ = z2ICriterion
+
meta_type = 'List Criterion'
operator = None
value = ( '', )
@@ -97,8 +102,6 @@
return tuple( result )
-
-
InitializeClass( ListCriterion )
# Register as a criteria type with the Topic class
Modified: CMF/branches/goldegg-phase-1/CMFTopic/SimpleIntCriterion.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFTopic/SimpleIntCriterion.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFTopic/SimpleIntCriterion.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -17,21 +17,26 @@
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
+from zope.interface import implements
+from AbstractCriterion import AbstractCriterion
+from interfaces import Criterion as z2ICriterion
+from interfaces import ICriterion
+from permissions import ChangeTopics
from permissions import View
-from permissions import ChangeTopics
-from AbstractCriterion import AbstractCriterion
-from interfaces import Criterion
from Topic import Topic
class SimpleIntCriterion( AbstractCriterion ):
+
"""
Represent a simple field-match for an integer value, including
catalog range searches.
"""
- __implements__ = ( Criterion, )
+ implements(ICriterion)
+ __implements__ = z2ICriterion
+
meta_type = 'Integer Criterion'
security = ClassSecurityInfo()
Modified: CMF/branches/goldegg-phase-1/CMFTopic/SimpleStringCriterion.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFTopic/SimpleStringCriterion.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFTopic/SimpleStringCriterion.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,34 +1,40 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
""" Simple string-matching criterion class
$Id$
"""
+
+from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
-from AccessControl import ClassSecurityInfo
+from zope.interface import implements
+from AbstractCriterion import AbstractCriterion
+from interfaces import Criterion as z2ICriterion
+from interfaces import ICriterion
+from permissions import ChangeTopics
from permissions import View
-from permissions import ChangeTopics
-from AbstractCriterion import AbstractCriterion
from Topic import Topic
-from interfaces import Criterion
+
class SimpleStringCriterion( AbstractCriterion ):
+
+ """ Represent a simple field-match for a string value.
"""
- Represent a simple field-match for a string value.
- """
- __implements__ = ( Criterion, )
+ implements(ICriterion)
+ __implements__ = z2ICriterion
+
meta_type = 'String Criterion'
security = ClassSecurityInfo()
Modified: CMF/branches/goldegg-phase-1/CMFTopic/SortCriterion.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFTopic/SortCriterion.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFTopic/SortCriterion.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,35 +1,42 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
""" Allow topic to specify sorting.
$Id$
"""
+
+from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
-from AccessControl import ClassSecurityInfo
+from zope.interface import implements
+from AbstractCriterion import AbstractCriterion
+from interfaces import Criterion as z2ICriterion
+from interfaces import ICriterion
+from permissions import ChangeTopics
from permissions import View
-from permissions import ChangeTopics
-from AbstractCriterion import AbstractCriterion
from Topic import Topic
-from interfaces import Criterion
+
class SortCriterion( AbstractCriterion ):
+
"""
Represent a mock criterion, to allow spelling the sort order
and reversal items in a catalog query.
"""
- __implements__ = ( Criterion, )
+ implements(ICriterion)
+ __implements__ = z2ICriterion
+
meta_type = 'Sort Criterion'
security = ClassSecurityInfo()
Deleted: CMF/branches/goldegg-phase-1/CMFTopic/configure.zcml
===================================================================
--- CMF/branches/goldegg-phase-1/CMFTopic/configure.zcml 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFTopic/configure.zcml 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,36 +0,0 @@
-<configure
- xmlns:five="http://namespaces.zope.org/five"
- >
-
- <five:bridge
- zope2=".interfaces.Criterion.Criterion"
- package=".interfaces"
- name="ICriterion"
- />
-
- <five:implements
- class=".DateCriteria.FriendlyDateCriterion"
- interface=".interfaces.ICriterion"
- />
-
- <five:implements
- class=".ListCriterion.ListCriterion"
- interface=".interfaces.ICriterion"
- />
-
- <five:implements
- class=".SimpleIntCriterion.SimpleIntCriterion"
- interface=".interfaces.ICriterion"
- />
-
- <five:implements
- class=".SimpleStringCriterion.SimpleStringCriterion"
- interface=".interfaces.ICriterion"
- />
-
- <five:implements
- class=".SortCriterion.SortCriterion"
- interface=".interfaces.ICriterion"
- />
-
-</configure>
Modified: CMF/branches/goldegg-phase-1/CMFTopic/interfaces/Criterion.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFTopic/interfaces/Criterion.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFTopic/interfaces/Criterion.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -16,68 +16,6 @@
$Id$
"""
-from Interface import Interface
-
-
-class Criterion(Interface):
- """\
- A Topic is composed of Criterion objects which specify the query
- used for the Topic. By supplying some basic information, the
- Criterion objects can be plugged into Topics without the Topic
- having to be too aware of the Criteria types.
- """
-
- def Type():
- """\
- Return the type of criterion object this is (ie - 'List Criterion')
- """
-
- def Field():
- """\
- Return the field this criterion object searches on.
- """
-
- def Description():
- """\
- Return a brief description of the criteria type.
- """
-
- def editableAttributes():
- """\
- Returns a tuble of editable attributes. The values of this
- are used by the topic to build commands to send to the
- 'edit' method based on each criterion's setup.
- """
-
- def getEditForm():
- """\
- Return the name of a DTML component used to edit criterion.
- Editforms should be specific to their type of criteria.
- """
-
- def apply(command):
- """\
- To make it easier to apply values from the rather dynamic
- Criterion edit form using Python Scripts, apply takes a
- mapping object as a default and applies itself to self.edit.
-
- It's basically a nice and protected wrapper around
- self.edit(**command).
- """
-
-# XXX: Interfaces have to specify the signature.
-## def edit(**kw):
-## """\
-## The signature of this method should be specific to the
-## criterion. Using the values in the attribute
-## '_editableAttributes', the Topic can apply the right
-## commands to each criteria object as its being edited without
-## having to know too much about the structure.
-## """
-
- def getCriteriaItems():
- """\
- Return a sequence of key-value tuples, each representing
- a value to be injected into the query dictionary (and,
- therefore, tailored to work with the catalog).
- """
+# BBB: module will be removed in CMF 2.2
+# zope2 interfaces created on runtime:
+# - Criterion
Modified: CMF/branches/goldegg-phase-1/CMFTopic/interfaces/__init__.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFTopic/interfaces/__init__.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFTopic/interfaces/__init__.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,17 +1,93 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
-"""\
-Loads interface names into the package.
+""" CMFTopic product interfaces.
+
+$Id$
"""
+from zope.interface import Interface
+
+
+class ICriterion(Interface):
+ """\
+ A Topic is composed of Criterion objects which specify the query
+ used for the Topic. By supplying some basic information, the
+ Criterion objects can be plugged into Topics without the Topic
+ having to be too aware of the Criteria types.
+ """
+
+ def Type():
+ """\
+ Return the type of criterion object this is (ie - 'List Criterion')
+ """
+
+ def Field():
+ """\
+ Return the field this criterion object searches on.
+ """
+
+ def Description():
+ """\
+ Return a brief description of the criteria type.
+ """
+
+ def editableAttributes():
+ """\
+ Returns a tuble of editable attributes. The values of this
+ are used by the topic to build commands to send to the
+ 'edit' method based on each criterion's setup.
+ """
+
+ def getEditForm():
+ """\
+ Return the name of a DTML component used to edit criterion.
+ Editforms should be specific to their type of criteria.
+ """
+
+ def apply(command):
+ """\
+ To make it easier to apply values from the rather dynamic
+ Criterion edit form using Python Scripts, apply takes a
+ mapping object as a default and applies itself to self.edit.
+
+ It's basically a nice and protected wrapper around
+ self.edit(**command).
+ """
+
+# XXX: Interfaces have to specify the signature.
+## def edit(**kw):
+## """\
+## The signature of this method should be specific to the
+## criterion. Using the values in the attribute
+## '_editableAttributes', the Topic can apply the right
+## commands to each criteria object as its being edited without
+## having to know too much about the structure.
+## """
+
+ def getCriteriaItems():
+ """\
+ Return a sequence of key-value tuples, each representing
+ a value to be injected into the query dictionary (and,
+ therefore, tailored to work with the catalog).
+ """
+
+
+# BBB: will be removed in CMF 2.2
+# create zope2 interfaces
+from Interface.bridge import createZope3Bridge
+import Criterion
+
+createZope3Bridge(ICriterion, Criterion, 'Criterion')
+
from Criterion import Criterion
+del createZope3Bridge
Modified: CMF/branches/goldegg-phase-1/CMFUid/UniqueIdAnnotationTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFUid/UniqueIdAnnotationTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFUid/UniqueIdAnnotationTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -17,13 +17,14 @@
$Id$
"""
-from Globals import InitializeClass, Persistent
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base, aq_inner, aq_parent
from Acquisition import Implicit
-
+from Globals import InitializeClass
+from Globals import Persistent
from OFS.PropertyManager import PropertyManager
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements
from Products.CMFCore.utils import getToolByName, UniqueObject
from Products.CMFCore.ActionProviderBase import ActionProviderBase
@@ -33,12 +34,11 @@
class UniqueIdAnnotation(Persistent, Implicit):
+
"""Unique id object used as annotation on (content) objects.
"""
- __implements__ = (
- IUniqueIdAnnotation,
- )
+ implements(IUniqueIdAnnotation)
def __init__(self, obj, id):
"""See IUniqueIdAnnotation.
@@ -106,11 +106,13 @@
InitializeClass(UniqueIdAnnotation)
-class UniqueIdAnnotationTool(UniqueObject, SimpleItem, PropertyManager, ActionProviderBase):
+class UniqueIdAnnotationTool(UniqueObject, SimpleItem, PropertyManager,
+ ActionProviderBase):
+
__doc__ = __doc__ # copy from module
+ implements(IUniqueIdAnnotationManagement)
__implements__ = (
- IUniqueIdAnnotationManagement,
ActionProviderBase.__implements__,
SimpleItem.__implements__,
)
Modified: CMF/branches/goldegg-phase-1/CMFUid/UniqueIdGeneratorTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFUid/UniqueIdGeneratorTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFUid/UniqueIdGeneratorTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -21,6 +21,7 @@
from BTrees.Length import Length
from Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
+from zope.interface import implements
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.utils import UniqueObject
@@ -28,14 +29,15 @@
class UniqueIdGeneratorTool(UniqueObject, SimpleItem, ActionProviderBase):
+
"""Generator of unique ids.
This is a dead simple implementation using a counter. May cause
ConflictErrors under high load and the values are predictable.
"""
+ implements(IUniqueIdGenerator)
__implements__ = (
- IUniqueIdGenerator,
ActionProviderBase.__implements__,
SimpleItem.__implements__,
)
Modified: CMF/branches/goldegg-phase-1/CMFUid/UniqueIdHandlerTool.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFUid/UniqueIdHandlerTool.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFUid/UniqueIdHandlerTool.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -16,8 +16,8 @@
$Id$
"""
+
import os
-
import Missing
import zLOG
@@ -27,6 +27,7 @@
from Globals import package_home
from OFS.SimpleItem import SimpleItem
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
+from zope.interface import implements
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.permissions import ManagePortal
@@ -42,14 +43,14 @@
_wwwdir = os.path.join( package_home( globals() ), 'www' )
+
class UniqueIdHandlerTool(UniqueObject, SimpleItem, ActionProviderBase):
__doc__ = __doc__ # copy from module
+ implements(IUniqueIdHandler, IUniqueIdBrainQuery,
+ IUniqueIdUnrestrictedQuery)
__implements__ = (
- IUniqueIdHandler,
- IUniqueIdBrainQuery,
- IUniqueIdUnrestrictedQuery,
ActionProviderBase.__implements__,
SimpleItem.__implements__,
)
Modified: CMF/branches/goldegg-phase-1/CMFUid/interfaces.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFUid/interfaces.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFUid/interfaces.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -19,10 +19,11 @@
$Id$
"""
-from Interface import Interface
+from zope.interface import Interface
+from zope.interface import Attribute
-from Products.CMFCore.interfaces.IOpaqueItems import ICallableOpaqueItem
-from Products.CMFCore.interfaces.IOpaqueItems import ICallableOpaqueItemEvents
+from Products.CMFCore.interfaces import ICallableOpaqueItem
+from Products.CMFCore.interfaces import ICallableOpaqueItemEvents
class UniqueIdError(Exception):
Modified: CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidannotation.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidannotation.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidannotation.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -15,40 +15,39 @@
$Id$
"""
-from unittest import TestSuite, makeSuite, main
+import unittest
import Testing
-import Zope2
-Zope2.startup()
-from Interface.Verify import verifyObject
-
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.tests.base.testcase import SecurityTest
-from Products.CMFUid.interfaces import IUniqueIdAnnotation
-from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement
-
UID_ATTRNAME = 'cmf_uid'
-class UniqueIdAnnotationTests(SecurityTest):
- def setUp(self):
+class UniqueIdAnnotationToolTests(SecurityTest):
+
+ def _getTargetClass(self):
from Products.CMFUid.UniqueIdAnnotationTool \
import UniqueIdAnnotationTool
+ return UniqueIdAnnotationTool
+
+ def setUp(self):
SecurityTest.setUp(self)
- self.root._setObject('portal_uidannotation', UniqueIdAnnotationTool())
+ self.root._setObject('portal_uidannotation', self._getTargetClass()())
self.root._setObject('dummy', DummyContent(id='dummy'))
- def test_interface(self):
- dummy = self.root.dummy
- anno_tool = self.root.portal_uidannotation
- annotation = anno_tool(dummy, UID_ATTRNAME)
+ def test_z3interfaces(self):
+ from zope.interface.verify import verifyClass
+ from Products.CMFUid.interfaces import IUniqueIdAnnotation
+ from Products.CMFUid.interfaces import IUniqueIdAnnotationManagement
+ from Products.CMFUid.UniqueIdAnnotationTool \
+ import UniqueIdAnnotation
- verifyObject(IUniqueIdAnnotationManagement, anno_tool)
- verifyObject(IUniqueIdAnnotation, annotation)
+ verifyClass(IUniqueIdAnnotationManagement, self._getTargetClass())
+ verifyClass(IUniqueIdAnnotation, UniqueIdAnnotation)
def test_setAndGetUid(self):
dummy = self.root.dummy
@@ -136,9 +135,9 @@
def test_suite():
- return TestSuite((
- makeSuite(UniqueIdAnnotationTests),
+ return unittest.TestSuite((
+ unittest.makeSuite(UniqueIdAnnotationToolTests),
))
if __name__ == '__main__':
- main(defaultTest='test_suite')
+ unittest.main(defaultTest='test_suite')
Modified: CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidgeneration.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidgeneration.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidgeneration.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -19,24 +19,28 @@
import Testing
from BTrees.Length import Length
-from Interface.Verify import verifyObject
from Products.CMFCore.tests.base.testcase import SecurityTest
-from Products.CMFUid.interfaces import IUniqueIdGenerator
-from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool
+class UniqueIdGeneratorToolTests(SecurityTest):
-class UniqueIdGeneratorTests(SecurityTest):
+ def _getTargetClass(self):
+ from Products.CMFUid.UniqueIdGeneratorTool \
+ import UniqueIdGeneratorTool
+ return UniqueIdGeneratorTool
+
def setUp(self):
SecurityTest.setUp(self)
- self.root._setObject('portal_uidgenerator', UniqueIdGeneratorTool())
+ self.root._setObject('portal_uidgenerator', self._getTargetClass()())
- def test_interface(self):
- generator = self.root.portal_uidgenerator
- verifyObject(IUniqueIdGenerator, generator)
+ def test_z3interfaces(self):
+ from zope.interface.verify import verifyClass
+ from Products.CMFUid.interfaces import IUniqueIdGenerator
+ verifyClass(IUniqueIdGenerator, self._getTargetClass())
+
def test_returnedUidsAreValidAndDifferent(self):
generator = self.root.portal_uidgenerator
uid1 = generator()
@@ -66,7 +70,7 @@
def test_suite():
return unittest.TestSuite((
- unittest.makeSuite(UniqueIdGeneratorTests),
+ unittest.makeSuite(UniqueIdGeneratorToolTests),
))
if __name__ == '__main__':
Modified: CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidhandling.py
===================================================================
--- CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidhandling.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/CMFUid/tests/test_uidhandling.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -18,22 +18,12 @@
import unittest
import Testing
-from Interface.Verify import verifyObject
-
-from Products.CMFCore.CatalogTool import CatalogTool
from Products.CMFCore.tests.base.dummy import DummyContent
from Products.CMFCore.tests.base.dummy import DummyFolder
from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.testcase import SecurityTest
-from Products.CMFUid.interfaces import IUniqueIdBrainQuery
-from Products.CMFUid.interfaces import IUniqueIdHandler
-from Products.CMFUid.interfaces import IUniqueIdUnrestrictedQuery
-from Products.CMFUid.UniqueIdAnnotationTool import UniqueIdAnnotationTool
-from Products.CMFUid.UniqueIdGeneratorTool import UniqueIdGeneratorTool
-from Products.CMFUid.UniqueIdHandlerTool import UniqueIdHandlerTool
-
def removeUnnecessaryIndexes(catalog):
indexes = [id[0] for id in catalog.enumerateIndexes()]
columns = catalog.enumerateColumns()
@@ -49,22 +39,35 @@
class UniqueIdHandlerTests(SecurityTest):
+ def _getTargetClass(self):
+ from Products.CMFUid.UniqueIdHandlerTool import UniqueIdHandlerTool
+
+ return UniqueIdHandlerTool
+
def setUp(self):
+ from Products.CMFCore.CatalogTool import CatalogTool
+ from Products.CMFUid.UniqueIdAnnotationTool \
+ import UniqueIdAnnotationTool
+ from Products.CMFUid.UniqueIdGeneratorTool \
+ import UniqueIdGeneratorTool
SecurityTest.setUp(self)
self.root._setObject('portal_catalog', CatalogTool())
self.root._setObject('portal_uidgenerator', UniqueIdGeneratorTool())
self.root._setObject('portal_uidannotation', UniqueIdAnnotationTool())
- self.root._setObject('portal_uidhandler', UniqueIdHandlerTool())
+ self.root._setObject('portal_uidhandler', self._getTargetClass()())
self.root._setObject('dummy', DummyContent(id='dummy'))
self.root._setObject('dummy2', DummyContent(id='dummy2'))
removeUnnecessaryIndexes(self.root.portal_catalog)
- def test_interface(self):
- handler = self.root.portal_uidhandler
- verifyObject(IUniqueIdHandler, handler)
- verifyObject(IUniqueIdBrainQuery, handler)
- verifyObject(IUniqueIdUnrestrictedQuery, handler)
+ def test_z3interfaces(self):
+ from zope.interface.verify import verifyClass
+ from Products.CMFUid.interfaces import IUniqueIdBrainQuery
+ from Products.CMFUid.interfaces import IUniqueIdHandler
+ from Products.CMFUid.interfaces import IUniqueIdUnrestrictedQuery
+ verifyClass(IUniqueIdHandler, self._getTargetClass())
+ verifyClass(IUniqueIdBrainQuery, self._getTargetClass())
+ verifyClass(IUniqueIdUnrestrictedQuery, self._getTargetClass())
def test_getUidOfNotYetRegisteredObject(self):
handler = self.root.portal_uidhandler
Modified: CMF/branches/goldegg-phase-1/DCWorkflow/DCWorkflow.py
===================================================================
--- CMF/branches/goldegg-phase-1/DCWorkflow/DCWorkflow.py 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/DCWorkflow/DCWorkflow.py 2005-09-24 14:27:06 UTC (rev 38588)
@@ -25,10 +25,12 @@
from Globals import InitializeClass
from OFS.Folder import Folder
from OFS.ObjectManager import bad_id
+from zope.interface import implements
# CMFCore
+from Products.CMFCore.interfaces import IWorkflowDefinition
from Products.CMFCore.interfaces.portal_workflow \
- import WorkflowDefinition as IWorkflowDefinition
+ import WorkflowDefinition as z2IWorkflowDefinition
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import ObjectDeleted
from Products.CMFCore.WorkflowCore import ObjectMoved
@@ -53,14 +55,16 @@
return 1
-class DCWorkflowDefinition (WorkflowUIMixin, Folder):
+class DCWorkflowDefinition(WorkflowUIMixin, Folder):
+
'''
This class is the workflow engine and the container for the
workflow definition.
UI methods are in WorkflowUIMixin.
'''
- __implements__ = IWorkflowDefinition
+ implements(IWorkflowDefinition)
+ __implements__ = z2IWorkflowDefinition
meta_type = 'Workflow'
title = 'DC Workflow Definition'
Deleted: CMF/branches/goldegg-phase-1/DCWorkflow/configure.zcml
===================================================================
--- CMF/branches/goldegg-phase-1/DCWorkflow/configure.zcml 2005-09-24 12:11:13 UTC (rev 38587)
+++ CMF/branches/goldegg-phase-1/DCWorkflow/configure.zcml 2005-09-24 14:27:06 UTC (rev 38588)
@@ -1,10 +0,0 @@
-<configure
- xmlns:five="http://namespaces.zope.org/five"
- >
-
- <five:implements
- class=".DCWorkflow.DCWorkflowDefinition"
- interface="Products.CMFCore.interfaces.IWorkflowDefinition"
- />
-
-</configure>
More information about the CMF-checkins
mailing list