[CMF-checkins] CVS: CMF - WorkflowTool.py:1.13

Jens Vagelpohl jens@digicool.com
Tue, 12 Jun 2001 16:08:09 -0400 (EDT)


Update of /cvs-repository/CMF/CMFCore
In directory korak.digicool.com:/tmp/cvs-serv2087/CMFCore

Modified Files:
	WorkflowTool.py 
Log Message:
Added clumsily named method "setChainForPortalTypes" to the workflow tool which allows 
easier scripting of the workflow tool when you need to associate one or more portal types
with a workflow chain.




--- Updated File WorkflowTool.py in package CMF --
--- WorkflowTool.py	2001/06/12 16:44:03	1.12
+++ WorkflowTool.py	2001/06/12 20:08:09	1.13
@@ -264,6 +264,24 @@
                                                'Changed.')
 
     security.declareProtected(CMFCorePermissions.ManagePortal,
+                              'setChainForPortalType')
+    def setChainForPortalTypes(self, pt_names, chain):
+        """ Set a chain for a specific portal type """
+        cbt = self._chains_by_type
+        if cbt is None:
+            self._chains_by_type = cbt = PersistentMapping()
+
+        if type(chain) is type(''):
+            chain = map(strip, split(chain,','))
+
+        ti = self._listTypeInfo()
+        for t in ti:
+            id = t.getId()
+            if id in pt_names:
+                cbt[id] = tuple(chain)
+                
+
+    security.declareProtected(CMFCorePermissions.ManagePortal,
                               'updateRoleMappings')
     def updateRoleMappings(self, REQUEST=None):
         '''