[CMF-checkins] CVS: Products/CMFCore - WorkflowCore.py:1.16
WorkflowTool.py:1.47
Yvo Schubbe
y.2004_ at wcm-solutions.de
Tue Aug 24 17:13:28 EDT 2004
Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv4771/CMFCore
Modified Files:
WorkflowCore.py WorkflowTool.py
Log Message:
- removed WorkflowMethod wrappers
- marked WorkflowMethod deprecated on CMF-1_5-branch and removed it on the HEAD
=== Products/CMFCore/WorkflowCore.py 1.15 => 1.16 ===
--- Products/CMFCore/WorkflowCore.py:1.15 Thu Aug 12 11:07:39 2004
+++ Products/CMFCore/WorkflowCore.py Tue Aug 24 17:12:58 2004
@@ -14,11 +14,6 @@
$Id$
"""
-from Acquisition import aq_base
-from MethodObject import Method
-
-from utils import getToolByName
-
class WorkflowException( Exception ):
@@ -54,39 +49,3 @@
def getNewObject(self):
return self._ob
-
-
-class WorkflowMethod( Method ):
-
- """ Wrap a method to workflow-enable it.
- """
- _need__name__=1
-
- def __init__(self, method, id=None, reindex=1):
- self._m = method
- if id is None:
- id = method.__name__
- self._id = id
- # reindex ignored since workflows now perform the reindexing.
-
- def __call__(self, instance, *args, **kw):
-
- """ Invoke the wrapped method, and deal with the results.
- """
- wf = getToolByName(instance, 'portal_workflow', None)
- if wf is None or not hasattr(wf, 'wrapWorkflowMethod'):
- # No workflow tool found.
- try:
- res = self._m(instance, *args, **kw)
- except ObjectDeleted, ex:
- res = ex.getResult()
- else:
- if hasattr(aq_base(instance), 'reindexObject'):
- instance.reindexObject()
- else:
- res = wf.wrapWorkflowMethod(instance, self._id, self._m,
- (instance,) + args, kw)
- return res
-
-# Backward compatibility.
-WorkflowAction = WorkflowMethod
=== Products/CMFCore/WorkflowTool.py 1.46 => 1.47 ===
--- Products/CMFCore/WorkflowTool.py:1.46 Thu Aug 12 11:07:39 2004
+++ Products/CMFCore/WorkflowTool.py Tue Aug 24 17:12:58 2004
@@ -577,29 +577,6 @@
res.append(wf)
return res
- security.declarePrivate('wrapWorkflowMethod')
- def wrapWorkflowMethod(self, ob, method_id, func, args, kw):
-
- """ To be invoked only by WorkflowCore.
- Allows a workflow definition to wrap a WorkflowMethod.
- """
- wf = None
- wfs = self.getWorkflowsFor(ob)
- if wfs:
- for w in wfs:
- if (hasattr(w, 'isWorkflowMethodSupported')
- and w.isWorkflowMethodSupported(ob, method_id)):
- wf = w
- break
- else:
- wfs = ()
- if wf is None:
- # No workflow wraps this method.
- return func(*args, **kw)
- return self._invokeWithNotification(
- wfs, ob, method_id, wf.wrapWorkflowMethod,
- (ob, method_id, func, args, kw), {})
-
#
# Helper methods
#
More information about the CMF-checkins
mailing list