[CMF-checkins] CVS: CMF/CMFCore/interfaces -
portal_actions.py:1.12.2.1
Yvo Schubbe
cvs-admin at zope.org
Tue Nov 25 09:00:26 EST 2003
Update of /cvs-repository/CMF/CMFCore/interfaces
In directory cvs.zope.org:/tmp/cvs-serv31480/CMFCore/interfaces
Modified Files:
Tag: yuppie-listActionInfos-branch
portal_actions.py
Log Message:
refactoring (part 2):
- added listActionInfos() and getActionInfo() to the ActionProvider Interface
- made OldstyleActionProvider Interface inherit these 2 methods
- added 'object' argument to listActions() of the ActionProvider Interface
- implemented new / changed methods in ActionProviderBase and TypesTool
- added OldstyleActionProviderBase implementing OldstyleActionProvider
- WorkflowTool and CMFCore DiscussionTool now use OldstyleActionProviderBase
=== CMF/CMFCore/interfaces/portal_actions.py 1.12 => 1.12.2.1 ===
--- CMF/CMFCore/interfaces/portal_actions.py:1.12 Fri Nov 14 03:34:56 2003
+++ CMF/CMFCore/interfaces/portal_actions.py Tue Nov 25 08:59:55 2003
@@ -88,17 +88,45 @@
""" The interface expected of an object that can provide actions.
"""
- def listActions(info=None):
+ def listActions(info=None, object=None):
""" List all the actions defined by a provider.
- The info argument is currently used by 'CMF Types Tool'. It contains
- at least a 'content' attribute.
+ 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
"""
+ def listActionInfos(action_chain=None, object=None, check_visibility=1,
+ check_permissions=1, check_condition=1, max=-1):
+ """ List Action info mappings.
+
+ '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 Action info mappings
+ """
+
+ def getActionInfo(action_chain, object=None, check_visibility=0,
+ check_condition=0):
+ """ Get an Action info mapping specified by a chain of actions.
+
+ Permission -- Always available
+
+ Returns -- Action info mapping or None
+ """
+
-class OldstyleActionProvider(Interface):
+class OldstyleActionProvider(ActionProvider):
""" Deprecated interface expected of an object that can provide actions.
Still used by 'Oldstyle CMF Discussion Tool' and 'CMF Workflow Tool'.
More information about the CMF-checkins
mailing list