[CMF-checkins] CVS: CMF/CMFCore - ActionsTool.py:1.41 DiscussionTool.py:1.13 TypesTool.py:1.62 WorkflowTool.py:1.41

Yvo Schubbe cvs-admin at zope.org
Fri Nov 14 03:35:26 EST 2003


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv2437/CMFCore

Modified Files:
	ActionsTool.py DiscussionTool.py TypesTool.py WorkflowTool.py 
Log Message:
- updated interfaces/portal_actions.py to document the current state of Actions
- made implementations of OldstyleActionProvider explicit
- some whitespace and import cleanup


=== CMF/CMFCore/ActionsTool.py 1.40 => 1.41 ===
--- CMF/CMFCore/ActionsTool.py:1.40	Mon Sep  1 11:18:34 2003
+++ CMF/CMFCore/ActionsTool.py	Fri Nov 14 03:34:55 2003
@@ -127,15 +127,13 @@
     #
     security.declareProtected(ManagePortal, 'listActionProviders')
     def listActionProviders(self):
-        """
-        Return a sequence of action providers known by this tool.
+        """ List the ids of all Action Providers queried by this tool.
         """
         return self.action_providers
 
     security.declareProtected(ManagePortal, 'addActionProvider')
     def addActionProvider( self, provider_name ):
-        """
-        Add the name of a new action provider.
+        """ Add an Action Provider id to the providers queried by this tool.
         """
         ap = list( self.action_providers )
         if hasattr( self, provider_name ) and provider_name not in ap:
@@ -144,8 +142,7 @@
 
     security.declareProtected(ManagePortal, 'deleteActionProvider')
     def deleteActionProvider( self, provider_name ):
-        """
-        Remove an action provider.
+        """ Delete an Action Provider id from providers queried by this tool.
         """
         ap = list( self.action_providers )
         if provider_name in ap:
@@ -157,9 +154,7 @@
     #
     security.declarePublic('listFilteredActionsFor')
     def listFilteredActionsFor(self, object=None):
-        """
-        Return a mapping containing of all actions available to the
-        user against object, bucketing into categories.
+        """ List all actions available to the user.
         """
         portal = aq_parent(aq_inner(self))
         if object is None or not hasattr(object, 'aq_base'):
@@ -256,6 +251,5 @@
         else:
             for i in a:
                 append(i)
-        
 
 InitializeClass(ActionsTool)


=== CMF/CMFCore/DiscussionTool.py 1.12 => 1.13 ===
--- CMF/CMFCore/DiscussionTool.py:1.12	Mon Sep  1 11:18:34 2003
+++ CMF/CMFCore/DiscussionTool.py	Fri Nov 14 03:34:55 2003
@@ -15,21 +15,23 @@
 $Id$
 """
 
-from utils import _dtmldir
-from utils import getToolByName
-from utils import UniqueObject
-from CMFCorePermissions import AccessContentsInformation
-from CMFCorePermissions import ManagePortal
-from CMFCorePermissions import ReplyToItem
-from CMFCorePermissions import View
 from OFS.SimpleItem import SimpleItem
 from Globals import InitializeClass, DTMLFile
 from Acquisition import Implicit
 from AccessControl import ClassSecurityInfo
 
+from CMFCorePermissions import AccessContentsInformation
+from CMFCorePermissions import ManagePortal
+from CMFCorePermissions import ReplyToItem
+from CMFCorePermissions import View
 from interfaces.Discussions import OldDiscussable as IOldDiscussable
+from interfaces.portal_actions \
+        import OldstyleActionProvider as IOldstyleActionProvider
 from interfaces.portal_discussion \
         import oldstyle_portal_discussion as IOldstyleDiscussionTool
+from utils import _dtmldir
+from utils import getToolByName
+from utils import UniqueObject
 
 
 class OldDiscussable(Implicit):
@@ -113,7 +115,7 @@
 
 class DiscussionTool (UniqueObject, SimpleItem):
 
-    __implements__ = IOldstyleDiscussionTool
+    __implements__ = (IOldstyleDiscussionTool, IOldstyleActionProvider)
 
     id = 'portal_discussion'
     meta_type = 'Oldstyle CMF Discussion Tool'
@@ -153,7 +155,6 @@
             return typeInfo.allowDiscussion()
         return 0
 
-
     security.declarePrivate('listActions')
     def listActions(self, info):
         # Return actions for reply and show replies
@@ -176,6 +177,5 @@
             )
 
         return actions
-
 
 InitializeClass(DiscussionTool)


=== CMF/CMFCore/TypesTool.py 1.61 => 1.62 ===
--- CMF/CMFCore/TypesTool.py:1.61	Mon Sep  1 11:18:34 2003
+++ CMF/CMFCore/TypesTool.py	Fri Nov 14 03:34:55 2003
@@ -899,7 +899,7 @@
             type_info = self.getTypeInfo( info.content )
 
             if type_info is not None:
-                actions.extend( type_info.listActions( info ) )
+                actions.extend( type_info.listActions() )
 
         return actions
 


=== CMF/CMFCore/WorkflowTool.py 1.40 => 1.41 ===
--- CMF/CMFCore/WorkflowTool.py:1.40	Thu Sep 25 06:16:28 2003
+++ CMF/CMFCore/WorkflowTool.py	Fri Nov 14 03:34:55 2003
@@ -23,13 +23,13 @@
 from Acquisition import aq_base, aq_inner, aq_parent
 
 from CMFCorePermissions import ManagePortal
-from WorkflowCore import WorkflowException, ObjectDeleted, ObjectMoved
-
-from interfaces.portal_workflow import portal_workflow
-
-from utils import UniqueObject
-from utils import getToolByName
+from interfaces.portal_actions \
+        import OldstyleActionProvider as IOldstyleActionProvider
+from interfaces.portal_workflow import portal_workflow as IWorkflowTool
 from utils import _dtmldir
+from utils import getToolByName
+from utils import UniqueObject
+from WorkflowCore import WorkflowException, ObjectDeleted, ObjectMoved
 
 AUTO_MIGRATE_WORKFLOW_TOOLS = 0  # Set to 1 to auto-migrate
 
@@ -55,11 +55,11 @@
 
 class WorkflowTool (UniqueObject, Folder):
 
-    """ Mediator tool, mapping workflow objects 
+    """ Mediator tool, mapping workflow objects
     """
     id = 'portal_workflow'
     meta_type = 'CMF Workflow Tool'
-    __implements__ = portal_workflow
+    __implements__ = (IWorkflowTool, IOldstyleActionProvider)
 
     _chains_by_type = None  # PersistentMapping
     _default_chain = ('default_workflow',)
@@ -211,7 +211,7 @@
         """ Returns a mapping of the catalog variables that apply to ob.
 
         o Invoked by portal_catalog.
-        
+
         o Allows workflows to add variables to the catalog based on
           workflow status, making it possible to implement queues.
         """
@@ -234,12 +234,12 @@
         """ Returns a list of actions to be displayed to the user.
 
         o Invoked by the portal_actions tool.
-        
+
         o Allows workflows to include actions to be displayed in the
           actions box.
 
         o Object actions are supplied by workflows that apply to the object.
-        
+
         o Global actions are supplied by all workflows.
         """
         chain = self.getChainFor(info.content)
@@ -278,11 +278,11 @@
     def doActionFor(self, ob, action, wf_id=None, *args, **kw):
 
         """ Execute the given workflow action for the object.
-        
+
         o Invoked by user interface code.
 
         o Allows the user to request a workflow action.
-        
+
         o The workflow object must perform its own security checks.
         """
         wfs = self.getWorkflowsFor(ob)
@@ -311,11 +311,11 @@
     def getInfoFor(self, ob, name, default=_marker, wf_id=None, *args, **kw):
 
         """ Return a given workflow-specific property for an object.
-        
+
         o Invoked by user interface code.
-        
+
         o Allows the user to request information provided by the workflow.
-        
+
         o The workflow object must perform its own security checks.
         """
         if wf_id is None:
@@ -365,7 +365,7 @@
 
         """ Notifies all applicable workflows of an action before it
             happens, allowing veto by exception.
-            
+
         o Unless an exception is thrown, either a notifySuccess() or
           notifyException() can be expected later on.
 
@@ -397,7 +397,7 @@
     def getHistoryOf(self, wf_id, ob):
 
         """ Return the history of an object.
-        
+
         o Invoked by workflow definitions.
         """
         if hasattr(aq_base(ob), 'workflow_history'):




More information about the CMF-checkins mailing list