[Zope-CVS] CVS: Packages3/workflow/browser - addprocessdefinitionconfig.pt:1.1 definition.py:1.1 definition_index.pt:1.1 workflows.pt:1.1 configure.zcml:1.2

Ulrich Eck ueck@net-labs.de
Wed, 5 Feb 2003 20:10:03 -0500


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

Modified Files:
	configure.zcml 
Added Files:
	addprocessdefinitionconfig.pt definition.py 
	definition_index.pt workflows.pt 
Log Message:
- new ProcessDefinitionElementContainer
- extended tests
- Stateful ProcessDefinition/Instance:
  + basic functionality for Instance (getOutgoingTransitions/fireTransition)
  - no relevant-data, conditions yet
- Added views for basic TTW interaction


=== Added File Packages3/workflow/browser/addprocessdefinitionconfig.pt ===
<html metal:use-macro="views/standard_macros/page">
<head><title>Add a ProcessDefinition configuration</title></head>
<body>
<div metal:fill-slot="body">
 
<form action="finish.html" method="post">
  <table>
     <tr>
       <td>ProcessDefinition Name</td>
       <td><input type="text" name="definition_name" /></td>
     </tr>
     <tr>
       <td>Component</td>
       <td><select name="component_path">
             <option tal:repeat="path view/components"
                     tal:attributes="value path"
                     tal:content="path">path</option>
           </select>
       </td>
     </tr>
     <tr>
       <td>Permission</td>
       <td tal:content="structure view/permission"><input type="text"></td>
     </tr>
     <tr>
       <td>Status</td>
       <td tal:content="structure view/status"><input type="text"></td>
     </tr>
     <tr>
       <td>Title</td>
       <td tal:content="structure view/title"><input type="text"></td>
     </tr>
     <tr>
       <td>Description</td>
       <td tal:content="structure view/description"><textarea></textarea></td>
     </tr>
 
  </table>
  <input type="submit" />
</form>
 
</div></body></html>

=== Added File Packages3/workflow/browser/definition.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""ProcessDefinition configuration adding view
 
$Id: definition.py,v 1.1 2003/02/06 01:09:30 jack-e Exp $
"""
__metaclass__ = type
 
from zope.component import getServiceManager
from zope.publisher.browser import BrowserView
from zope.app.form.utility import setUpWidgets, getWidgetsDataForContent
from zope.app.interfaces.workflow import IProcessDefinitionConfiguration
from zope.app.interfaces.workflow import IProcessDefinition
from zope.app.workflow.service import ProcessDefinitionConfiguration
 
class AddProcessDefinitionConfiguration(BrowserView):
 
    def __init__(self, *args):
        super(AddProcessDefinitionConfiguration, self).__init__(*args)
        setUpWidgets(self, IProcessDefinitionConfiguration)
 
    def components(self):
        service = getServiceManager(self.context.context)
        paths = [info['path']
                 for info in service.queryComponent(type=IProcessDefinition)]
        paths.sort()
        return paths
 
    def action(self, definition_name, component_path=None):
        if not definition_name:
            raise ValueError('You must specify a ProcessDefinition name')
        if not component_path:
            raise ValueError('You must specify a component path')
        cd = ProcessDefinitionConfiguration(definition_name, component_path)
        cd = self.context.add(cd)
        getWidgetsDataForContent(self, IProcessDefinitionConfiguration, content=cd)
        self.request.response.redirect(self.context.nextURL())



class ProcessDefinitionView(BrowserView):
 
    def getName(self):
        return """I'm a dummy ProcessInstance"""


=== Added File Packages3/workflow/browser/definition_index.pt ===
<html metal:use-macro="views/standard_macros/page">
<head>
  <title>ProcessDefinition</title>
</head>
<body>
 
  <div metal:fill-slot="body">

  <p>ProcessDefinition: <tal:block tal:replace="view/getName" /></p>
 
  </div>
 
</body>
</html>

=== Added File Packages3/workflow/browser/workflows.pt ===
<html metal:use-macro="views/standard_macros/page">
<body metal:fill-slot="body">
<div metal:use-macro="view/indexMacros/macros/body">
 
  <h2 metal:fill-slot="heading">ProcessDefinitions configured in this workflow service.</h2>
 
  <p metal:fill-slot="empty_text">No ProcessDefinitions have been configured</p>
 
  <div metal:fill-slot="extra_top">
 
    <p>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>Select a ProcessDefinition name or a component name to visit the ProcessDefinition
       or component.
    </p>
 
  </div>
 
  <p metal:fill-slot="help_text">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>
</body>
</html>

=== Packages3/workflow/browser/configure.zcml 1.1 => 1.2 ===
--- Packages3/workflow/browser/configure.zcml:1.1	Tue Feb  4 16:43:36 2003
+++ Packages3/workflow/browser/configure.zcml	Wed Feb  5 20:09:30 2003
@@ -3,6 +3,15 @@
    xmlns:browser='http://namespaces.zope.org/browser'>
 
 <!-- Workflow Service -->
+<browser:page
+  for="zope.app.interfaces.workflow.IWorkflowService"
+  name="index.html"
+  template="workflows.pt"
+  class="zope.app.browser.services.namecomponentconfigurableview.NameComponentConfigurableView"
+  permission="zope.ManageServices"  
+  />
+
+
 
 <browser:menuItem
   menu="add_component"
@@ -24,5 +33,33 @@
   action="ProcessDefinition"
   title='Process Definition'
   description="A workflow process definition" />
+
+
+<browser:page
+  for="zope.app.interfaces.workflow.IProcessDefinition"
+  name="index.html"
+  template="definition_index.pt"
+  class="zope.app.browser.workflow.definition.ProcessDefinitionView"
+  permission="zope.ManageServices"  
+  />
+
+<browser:view
+  for="zope.app.interfaces.container.IAdding"
+  name="ProcessDefinitionConfiguration"
+  class="zope.app.browser.workflow.definition.AddProcessDefinitionConfiguration"
+  permission="zope.ManageServices">
+ 
+  <browser:page name="add.html" template="addprocessdefinitionconfig.pt" />
+  <browser:page name="finish.html" attribute="action" />
+</browser:view>
+
+
+<browser:menuItem
+  menu="add_configuration"
+  for="zope.app.interfaces.container.IAdding"
+  action="ProcessDefinitionConfiguration"
+  title="Process Definition"
+  description="Workflow Process Definition"
+  />
 
 </zopeConfigure>