[CMF-checkins] CVS: CMF/CMFSetup - workflow.py:1.5
Tres Seaver
tseaver at zope.com
Thu Jun 3 19:11:36 EDT 2004
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv4618
Modified Files:
workflow.py
Log Message:
- workflow.py:
o Add 'listWorkflowChains' to support tool XML generation.
o Implement tool XML generation.
=== CMF/CMFSetup/workflow.py 1.4 => 1.5 ===
--- CMF/CMFSetup/workflow.py:1.4 Thu Jun 3 18:02:01 2004
+++ CMF/CMFSetup/workflow.py Thu Jun 3 19:11:34 2004
@@ -148,6 +148,13 @@
return workflow_info
+ security.declareProtected( ManagePortal, 'generateToolXML' )
+ def generateToolXML( self ):
+
+ """ Pseudo API.
+ """
+ return self._toolConfig()
+
security.declareProtected( ManagePortal, 'listWorkflowInfo' )
def listWorkflowInfo( self ):
@@ -159,9 +166,38 @@
return [ self.getWorkflowInfo( workflow_id )
for workflow_id in workflow_tool.getWorkflowIds() ]
+ security.declareProtected( ManagePortal, 'listWorkflowChains' )
+ def listWorkflowChains( self ):
+
+ """ Return a sequence of tuples binding workflows to each content type.
+
+ o Tuples are in the format, '( type_id, [ workflow_id ] )'.
+
+ o The default chain will be first in the list, with None for the
+ 'type_id'.
+
+ o The list will only include type-specific chains for types which
+ do not use the default chain.
+ """
+ workflow_tool = getToolByName( self._site, 'portal_workflow' )
+
+ result = [ ( None, workflow_tool._default_chain ) ]
+ overrides = workflow_tool._chains_by_type.items()
+ overrides.sort()
+
+ result.extend( overrides )
+
+ return result
+
#
# Helper methods
#
+ security.declarePrivate( '_toolConfig' )
+ _toolConfig = PageTemplateFile( 'wtcToolExport.xml'
+ , _xmldir
+ , __name__='toolConfig'
+ )
+
security.declarePrivate( '_extractDCWorkflowInfo' )
def _extractDCWorkflowInfo( self, workflow, workflow_info ):
More information about the CMF-checkins
mailing list