[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/browser - configure.zcml:1.2 definition.py:1.2 workflows.pt:1.2 workflows.py:1.2 useprocessdefinitionconfig.pt:NONE

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Mar 3 15:21:05 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/workflow/browser
In directory cvs.zope.org:/tmp/cvs-serv21735/src/zope/app/workflow/browser

Modified Files:
	configure.zcml definition.py workflows.pt workflows.py 
Removed Files:
	useprocessdefinitionconfig.pt 
Log Message:


Converted process definitions from being arbitrary registerable components to
be local utilities. This drastically simplified the local workflow and process
definition implementation, since they do not have to worry about any
registration stuff anymore. What an improvement!


=== Zope3/src/zope/app/workflow/browser/configure.zcml 1.1 => 1.2 ===
--- Zope3/src/zope/app/workflow/browser/configure.zcml:1.1	Fri Feb 27 11:50:37 2004
+++ Zope3/src/zope/app/workflow/browser/configure.zcml	Wed Mar  3 15:20:34 2004
@@ -9,7 +9,7 @@
       for="zope.app.workflow.interfaces.IWorkflowService"
       name="index.html"
       template="workflows.pt"
-      class=".workflows.WorkflowsRegistryView"
+      class=".workflows.WorkflowsOverview"
       permission="zope.ManageServices"  
       menu="zmi_views" title="Processes" />
 
@@ -20,37 +20,7 @@
       permission="zope.ManageServices" />
 
 
-
-<!-- ProcessDefinition Registration -->
-
-  <page
-      for="zope.app.workflow.interfaces.IProcessDefinition"
-      name="useRegistration.html"
-      template="useprocessdefinitionconfig.pt"
-      class=".definition.Registered"
-      permission="zope.workflow.ManageProcessDefinitions"
-      menu="zmi_views" title="Registrations" />
-
-
-  <addform
-      for="zope.app.workflow.interfaces.IProcessDefinition"
-      name="addRegistration.html"
-      schema="zope.app.workflow.interfaces.IProcessDefinitionRegistration"
-      class="zope.app.browser.services.registration.AddComponentRegistration"
-      permission="zope.workflow.ManageProcessDefinitions"
-      content_factory="zope.app.workflow.service.ProcessDefinitionRegistration"
-      arguments="name componentPath"
-      set_after_add="status"
-      fields="name componentPath permission status" 
-      usage="addingdialog" />
-   
-  <editform
-      name="index.html"
-      menu="zmi_views" title="Edit"
-      schema="zope.app.workflow.interfaces.IProcessDefinitionRegistration"
-      label="ProcessDefinition Registration"
-      permission="zope.workflow.ManageProcessDefinitions"
-      fields="name componentPath permission status" />
+<!-- Process Definition Import/Export -->
 
   <page
       for="zope.app.workflow.interfaces.IProcessDefinition"


=== Zope3/src/zope/app/workflow/browser/definition.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/workflow/browser/definition.py:1.1	Fri Feb 27 11:50:37 2004
+++ Zope3/src/zope/app/workflow/browser/definition.py	Wed Mar  3 15:20:34 2004
@@ -22,24 +22,6 @@
 from zope.app.interfaces.services.registration import IRegistered
 from zope.app.workflow.interfaces import IProcessDefinitionImportExport
 
-class Registered:
-    """View for displaying the registrations for a process definition"""
-
-    def uses(self):
-        """Get a sequence of registration summaries"""
-        component = self.context
-        useconfig = getAdapter(component, IRegistered)
-        result = []
-        for path in useconfig.usages():
-            config = traverse(component, path)
-            url = getView(config, 'absolute_url', self.request)
-            result.append({'name': config.name,
-                           'path': path,
-                           'url': url(),
-                           'status': config.status,
-                           })
-        return result
-
 
 class ProcessDefinitionView:
  


=== Zope3/src/zope/app/workflow/browser/workflows.pt 1.1 => 1.2 ===
--- Zope3/src/zope/app/workflow/browser/workflows.pt:1.1	Fri Feb 27 11:50:37 2004
+++ Zope3/src/zope/app/workflow/browser/workflows.pt	Wed Mar  3 15:20:34 2004
@@ -2,41 +2,25 @@
 <body>
 <div metal:fill-slot="body">
 
-  <div metal:use-macro="view/indexMacros/macros/body">
- 
-    <h2 metal:fill-slot="heading" i18n:translate="">
-      ProcessDefinitions configured in this workflow service.
-    </h2>
- 
-    <p metal:fill-slot="empty_text" i18n:translate="">
-      No ProcessDefinitions have been configured
-    </p>
- 
-    <div metal:fill-slot="extra_top">
- 
-      <p i18n:translate="">
-        For each ProcessDefinition, the ProcessDefinition name is given and all
-        of the components registered to provide the ProcessDefinition are
-        shown.  You may select the component to provide the ProcessDefinition
-        or disable the ProcessDefinition.</p>
- 
-      <p i18n:translate="">
-        Select a ProcessDefinition name or a component name to visit the
-        ProcessDefinition or component.</p>
- 
-    </div>
- 
-    <p metal:fill-slot="help_text" i18n:translate="">
-       To configure a ProcessDefinition, add a ProcessDefinition
-       component to a <em>package</em> in <a
-       href="../../../Packages">Packages</a> or to the <a
-       href="../../../Packages/default">default package</a>. After the component
-       is added, add a ProcessDefinition configuration that configures the 
-       component to provide a ProcessDefinition.
-    </p>
- 
-  </div>
+  <h2 i18n:translate="">
+    Process Definitions configured in this workflow service
+  </h2>
 
+  <ul>
+    <li tal:repeat="pd view/getProcessDefinitions">
+      <div tal:replace="pd">Publish Folder</div>
+    </li>
+  </ul>
+
+  <p i18n:translate="">
+     To configure a Process Definition, add a Process Definition
+     utility to a <em>package</em> in <a
+     href="../../../Packages">Packages</a> or to the <a
+     href="../../../Packages/default">default package</a>. After the utility
+     is added, add a Process Definition configuration that configures the 
+     component to provide a Process Definition.
+  </p>
+ 
 </div>
 </body>
 </html>


=== Zope3/src/zope/app/workflow/browser/workflows.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/workflow/browser/workflows.py:1.1	Fri Feb 27 11:50:37 2004
+++ Zope3/src/zope/app/workflow/browser/workflows.py	Wed Mar  3 15:20:34 2004
@@ -15,19 +15,10 @@
 
 $Id$
 """
-from zope.app.browser.services.registration import \
-     NameComponentRegistryView, NameRegistryView
-from zope.app.traversing import traverse, getParent
-from zope.component import getView
+from zope.app import zapi
 
-class WorkflowsRegistryView(NameComponentRegistryView):
+class WorkflowsOverview(object):
 
-    def _getItem(self, name, view, cfg):
-        item_dict = NameRegistryView._getItem(self, name, view, cfg)
-        if cfg is not None:
-            ob = traverse(getParent(getParent(cfg)), cfg.componentPath)
-            url = str(getView(ob, 'absolute_url', self.request))
-        else:
-            url = None
-        item_dict['url'] = url
-        return item_dict
+    def getProcessDefinitions(self):
+        """Return a list of all available process definitions."""
+        return self.context.getProcessDefinitionNames()

=== Removed File Zope3/src/zope/app/workflow/browser/useprocessdefinitionconfig.pt ===




More information about the Zope3-Checkins mailing list