[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/workflow/ Made
annotation-based adapter trusted.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Mon Aug 16 11:02:55 EDT 2004
Log message for revision 27145:
Made annotation-based adapter trusted.
Finally fixed parent problem for process instances. The content object
itself is finally the parent of the PI.
Changed:
U Zope3/trunk/src/zope/app/workflow/configure.zcml
U Zope3/trunk/src/zope/app/workflow/instance.py
U Zope3/trunk/src/zope/app/workflow/stateful/configure.zcml
-=-
Modified: Zope3/trunk/src/zope/app/workflow/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/workflow/configure.zcml 2004-08-16 13:40:02 UTC (rev 27144)
+++ Zope3/trunk/src/zope/app/workflow/configure.zcml 2004-08-16 15:02:55 UTC (rev 27145)
@@ -86,6 +86,8 @@
factory="zope.app.workflow.instance.ProcessInstanceContainerAdapter"
provides="zope.app.workflow.interfaces.IProcessInstanceContainer"
for="zope.app.annotation.interfaces.IAnnotatable"
+ permission="zope.workflow.UseProcessInstances"
+ trusted="true"
/>
<include package=".stateful" />
Modified: Zope3/trunk/src/zope/app/workflow/instance.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/instance.py 2004-08-16 13:40:02 UTC (rev 27144)
+++ Zope3/trunk/src/zope/app/workflow/instance.py 2004-08-16 15:02:55 UTC (rev 27145)
@@ -69,10 +69,6 @@
def __init__(self, context):
self.context = context
- # Band-aid, so that the process instance can have a valid
- # path. Eventually the pi should have context as parent directly.
- self.__parent__ = context
- self.__name__ = "processInstances"
annotations = IAnnotations(context)
wfdata = annotations.get(WFKey)
if not wfdata:
@@ -115,7 +111,11 @@
def __setitem__(self, key, object):
"See IProcessInstanceContainer"
+ # We cannot make the message the parent right away, since it is not
+ # added to any message board yet;
setitem(self, self.wfdata.__setitem__, key, object)
+ # Set the final parent to be the message.
+ object.__parent__ = self.context
def __delitem__(self, key):
"See IZopeWriteContainer"
Modified: Zope3/trunk/src/zope/app/workflow/stateful/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/workflow/stateful/configure.zcml 2004-08-16 13:40:02 UTC (rev 27144)
+++ Zope3/trunk/src/zope/app/workflow/stateful/configure.zcml 2004-08-16 15:02:55 UTC (rev 27145)
@@ -113,6 +113,13 @@
/>
</content>
+<class class=".instance.StatefulProcessInstance">
+ <require
+ permission="zope.workflow.UseProcessInstances"
+ interface=".interfaces.IStatefulProcessInstance"
+ />
+</class>
+
<!-- Stateful workflow import/Export -->
<adapter
for=".interfaces.IStatefulProcessDefinition"
More information about the Zope3-Checkins
mailing list