[CMF-checkins] CVS: Products/DCWorkflow - DCWorkflow.py:1.37 Transitions.py:1.14

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Aug 24 17:13:29 EDT 2004


Update of /cvs-repository/Products/DCWorkflow
In directory cvs.zope.org:/tmp/cvs-serv4771/DCWorkflow

Modified Files:
	DCWorkflow.py Transitions.py 
Log Message:
- removed WorkflowMethod wrappers
- marked WorkflowMethod deprecated on CMF-1_5-branch and removed it on the HEAD


=== Products/DCWorkflow/DCWorkflow.py 1.36 => 1.37 ===
--- Products/DCWorkflow/DCWorkflow.py:1.36	Thu Aug 12 11:07:44 2004
+++ Products/DCWorkflow/DCWorkflow.py	Tue Aug 24 17:12:58 2004
@@ -21,7 +21,6 @@
 from AccessControl import Unauthorized
 from Acquisition import aq_inner
 from Acquisition import aq_parent
-from App.Undo import UndoSupport
 from DocumentTemplate.DT_Util import TemplateDict
 from Globals import InitializeClass
 from OFS.Folder import Folder
@@ -38,13 +37,11 @@
 
 # DCWorkflow
 from permissions import ManagePortal
-from utils import _dtmldir
 from utils import modifyRolesForPermission
 from utils import modifyRolesForGroup
 from WorkflowUIMixin import WorkflowUIMixin
 from Transitions import TRIGGER_AUTOMATIC
 from Transitions import TRIGGER_USER_ACTION
-from Transitions import TRIGGER_WORKFLOW_METHOD
 from Expression import StateChangeInfo
 from Expression import createExprContext
 
@@ -285,52 +282,6 @@
         if not self._checkTransitionGuard(tdef, ob):
             raise Unauthorized(action)
         self._changeStateOf(ob, tdef, kw)
-
-    security.declarePrivate('isWorkflowMethodSupported')
-    def isWorkflowMethodSupported(self, ob, method_id):
-        '''
-        Returns a true value if the given workflow method
-        is supported in the current state.
-        '''
-        sdef = self._getWorkflowStateOf(ob)
-        if sdef is None:
-            return 0
-        if method_id in sdef.transitions:
-            tdef = self.transitions.get(method_id, None)
-            if (tdef is not None and
-                tdef.trigger_type == TRIGGER_WORKFLOW_METHOD and
-                self._checkTransitionGuard(tdef, ob)):
-                return 1
-        return 0
-
-    security.declarePrivate('wrapWorkflowMethod')
-    def wrapWorkflowMethod(self, ob, method_id, func, args, kw):
-        '''
-        Allows the user to request a workflow action.  This method
-        must perform its own security checks.
-        '''
-        sdef = self._getWorkflowStateOf(ob)
-        if sdef is None:
-            raise WorkflowException, 'Object is in an undefined state'
-        if method_id not in sdef.transitions:
-            raise Unauthorized(method_id)
-        tdef = self.transitions.get(method_id, None)
-        if tdef is None or tdef.trigger_type != TRIGGER_WORKFLOW_METHOD:
-            raise WorkflowException, (
-                'Transition %s is not triggered by a workflow method'
-                % method_id)
-        if not self._checkTransitionGuard(tdef, ob):
-            raise Unauthorized(method_id)
-        res = func(*args, **kw)
-        try:
-            self._changeStateOf(ob, tdef)
-        except ObjectDeleted:
-            # Re-raise with a different result.
-            raise ObjectDeleted(res)
-        except ObjectMoved, ex:
-            # Re-raise with a different result.
-            raise ObjectMoved(ex.getNewObject(), res)
-        return res
 
     security.declarePrivate('isInfoSupported')
     def isInfoSupported(self, ob, name):


=== Products/DCWorkflow/Transitions.py 1.13 => 1.14 ===
--- Products/DCWorkflow/Transitions.py:1.13	Thu Aug 12 11:07:44 2004
+++ Products/DCWorkflow/Transitions.py	Tue Aug 24 17:12:58 2004
@@ -31,7 +31,6 @@
 
 TRIGGER_AUTOMATIC = 0
 TRIGGER_USER_ACTION = 1
-TRIGGER_WORKFLOW_METHOD = 2
 
 
 class TransitionDefinition (SimpleItem):



More information about the CMF-checkins mailing list