[CMF-checkins] CVS: CMF - DCWorkflow.py:1.3 Default.py:1.2 WorkflowUIMixin.py:1.2 __init__.py:1.2

shane@digicool.com shane@digicool.com
Mon, 11 Jun 2001 16:36:35 -0400 (EDT)


Update of /cvs-repository/CMF/DCWorkflow
In directory korak.digicool.com:/tmp/cvs-serv30558

Modified Files:
	DCWorkflow.py Default.py WorkflowUIMixin.py __init__.py 
Log Message:
Changed the factory usage so that the workflow UI is all in one place.



--- Updated File DCWorkflow.py in package CMF --
--- DCWorkflow.py	2001/06/11 20:14:16	1.2
+++ DCWorkflow.py	2001/06/11 20:36:35	1.3
@@ -106,7 +106,7 @@
 
 # CMFCore
 from Products.CMFCore.WorkflowCore import WorkflowException
-from Products.CMFCore.WorkflowTool import addWorkflowClass
+from Products.CMFCore.WorkflowTool import addWorkflowFactory
 from Products.CMFCore.CMFCorePermissions import ManagePortal
 from Products.CMFCore.utils import getToolByName
 
@@ -134,7 +134,6 @@
     '''
     meta_type = 'Workflow'
     title = 'DC Workflow Definition'
-    id = 'dc_workflow'
     _isAWorkflow = 1
 
     state_var = 'state'
@@ -558,4 +557,5 @@
 
 Globals.InitializeClass(DCWorkflowDefinition)
 
-addWorkflowClass(DCWorkflowDefinition)
+addWorkflowFactory(DCWorkflowDefinition, id='dc_workflow',
+                   title='Web-configurable workflow')

--- Updated File Default.py in package CMF --
--- Default.py	2001/06/11 19:33:47	1.1
+++ Default.py	2001/06/11 20:36:35	1.2
@@ -88,6 +88,8 @@
 '''
 __version__='$Revision$'[11:-2]
 
+from Products.CMFCore.WorkflowTool import addWorkflowFactory
+
 from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition
 
 p_access = 'Access contents information'
@@ -239,10 +241,12 @@
                               'guard_permissions':p_review})
     
 
-def manage_addDefaultWorkflow(self):
+def createDefaultWorkflow(id):
     '''
     '''
-    ob = DCWorkflowDefinition('default_workflow_rev2')
-    self._setObject(ob.id, ob)
-    setupDefaultWorkflow(self.this()._getOb(ob.id))
-    return self.manage_main(self, self.REQUEST)
+    ob = DCWorkflowDefinition(id)
+    setupDefaultWorkflow(ob)
+    return ob
+
+addWorkflowFactory(createDefaultWorkflow, id='default_workflow',
+                   title='Web-configurable workflow [default]')

--- Updated File WorkflowUIMixin.py in package CMF --
--- WorkflowUIMixin.py	2001/06/11 19:33:47	1.1
+++ WorkflowUIMixin.py	2001/06/11 20:36:35	1.2
@@ -132,7 +132,7 @@
         '''
         if p in self.permissions:
             raise ValueError, 'Already a managed permission: ' + p
-        if p not in self.getPossiblePermissions():
+        if REQUEST is not None and p not in self.getPossiblePermissions():
             raise ValueError, 'Not a valid permission name:' + p
         self.permissions = self.permissions + (p,)
         if REQUEST is not None:

--- Updated File __init__.py in package CMF --
--- __init__.py	2001/06/11 19:33:47	1.1
+++ __init__.py	2001/06/11 20:36:35	1.2
@@ -90,7 +90,7 @@
 
 from Products.CMFCore.utils import registerIcon
 import DCWorkflow, States, Transitions, Variables, Worklists, Scripts
-from Default import manage_addDefaultWorkflow
+import Default
 
 
 def initialize(context):
@@ -111,6 +111,3 @@
     Worklists.WorklistDefinition.icon = Worklists.Worklists.icon
     registerIcon(Scripts.Scripts,
                  'images/script.gif', globals())
-
-    context.registerClass(constructors=(manage_addDefaultWorkflow,),
-                          meta_type='CMF default workflow (rev 2)')