[Zope-CVS] CVS: Packages3/workflow - configure.zcml:1.5 service.py:1.6

Ulrich Eck ueck@net-labs.de
Wed, 19 Mar 2003 12:01:12 -0500


Update of /cvs-repository/Packages3/workflow
In directory cvs.zope.org:/tmp/cvs-serv20767

Modified Files:
	configure.zcml service.py 
Log Message:
checkpoint (updates for use-config/local-utility-branch changes)
(ATTENTION: this will not work until Jim has merged the local-utility-branch)
Updated everything to match the current configuration machinery


=== Packages3/workflow/configure.zcml 1.4 => 1.5 ===
--- Packages3/workflow/configure.zcml:1.4	Fri Feb  7 16:50:51 2003
+++ Packages3/workflow/configure.zcml	Wed Mar 19 12:00:41 2003
@@ -69,10 +69,8 @@
 <content class="zope.app.workflow.service.ProcessDefinitionConfiguration">
   <require
       permission="zope.ManageServices"
-      interface=
-      "zope.app.interfaces.workflow.IProcessDefinitionConfiguration"
-      set_attributes="name componentPath"
-      set_schema="zope.app.interfaces.services.interfaces.IPageConfiguration"
+      interface="zope.app.interfaces.workflow.IProcessDefinitionConfiguration"
+      set_schema="zope.app.interfaces.workflow.IProcessDefinitionConfiguration"
       />
   <require
       permission="zope.ManageServices"


=== Packages3/workflow/service.py 1.5 => 1.6 ===
--- Packages3/workflow/service.py:1.5	Thu Feb 27 07:10:54 2003
+++ Packages3/workflow/service.py	Wed Mar 19 12:00:41 2003
@@ -22,6 +22,7 @@
 
 from zope.proxy.context import ContextMethod, ContextWrapper
 
+from zope.component import getAdapter
 from zope.app.component.nextservice import queryNextService
 from zope.app.interfaces.services.configuration \
         import INameComponentConfigurable
@@ -29,8 +30,10 @@
 
 from zope.app.services.configuration import NamedComponentConfiguration
 from zope.app.services.configuration import ConfigurationStatusProperty
+from zope.app.interfaces.services.configuration import IUseConfiguration
+from zope.app.traversing import traverse, getPhysicalPathString
 
-# from zope.app.interfaces.services.interfaces import ISimpleService
+from zope.app.interfaces.services.service import ISimpleService
 from zope.app.interfaces.workflow import IProcessDefinitionConfiguration
 from zope.app.interfaces.workflow import IProcessDefinition
 from zope.app.interfaces.workflow import IWorkflowService
@@ -45,7 +48,8 @@
 
     __doc__ = IWorkflowService.__doc__
 
-    __implements__ = ILocalWorkflowService #, ISimpleService
+    __implements__ = ILocalWorkflowService, ISimpleService 
+                     
 
     ############################################################
     # Implementation methods for interface
@@ -111,8 +115,32 @@
 
     status = ConfigurationStatusProperty('Workflows')
 
-    label = "ProcessDefinition"
 
     def getInterface(self):
         return IProcessDefinition
 
+    # The following hooks are called only if we implement
+    # IAddNotifiable and IDeleteNotifiable.
+
+    def afterAddHook(self, configuration, container):
+        """Hook method will call after an object is added to container.
+
+        Defined in IAddNotifiable.
+        """
+        super(ProcessDefinitionConfiguration, self).afterAddHook(configuration,
+                                                                 container)
+        pd = configuration.getComponent()
+        adapter = getAdapter(pd, IUseConfiguration)
+        adapter.addUsage(getPhysicalPathString(configuration))
+
+
+    def beforeDeleteHook(self, configuration, container):
+        """Hook method will call before object is removed from container.
+
+        Defined in IDeleteNotifiable.
+        """
+        pd = configuration.getComponent()
+        adapter = getAdapter(pd, IUseConfiguration)
+        adapter.removeUsage(getPhysicalPathString(configuration))
+        super(ProcessDefinitionConfiguration, self).beforeDeleteHook(configuration,
+                                                                     container)