[Zope-CVS] CVS: Packages3/workflow/browser/stateful - addstate.pt:1.1 addtransition.pt:1.1 configure.zcml:1.2 definition.py:1.2 definition_states.pt:1.2

Ulrich Eck ueck@net-labs.de
Fri, 7 Feb 2003 10:30:00 -0500


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

Modified Files:
	configure.zcml definition.py definition_states.pt 
Added Files:
	addstate.pt addtransition.pt 
Log Message:
next steps towards a usable Stateful Workflow:
- Schema for ProcessDefinition, State, Transition
- views for TTW-Editing
- another try to get the transition-permissions working (still not done)
- configure optimization


=== Added File Packages3/workflow/browser/stateful/addstate.pt ===
<html metal:use-macro="views/standard_macros/page">
<head>
  <title>Add State</title>
</head>
<body>
 
  <div metal:fill-slot="body">
 
    <form action="." method="post" enctype="multipart/form-data">
 
      <table>
        <tbody>
 
          <tr>
            <th>Id:</th>
            <td>
              <input type="text" name="id" size="40" value="">
            </td>
          </tr>
 
        </tbody>
      </table>
 
      <input type="submit" name="action.html:method" value="Add" />
 
    </form>
 
  </div>
 
</body>
</html>

=== Added File Packages3/workflow/browser/stateful/addtransition.pt ===
<html metal:use-macro="views/standard_macros/page">
<head>
  <title>Add Transition</title>
</head>
<body>
 
  <div metal:fill-slot="body">
 
    <form action="." method="post" enctype="multipart/form-data">
 
      <table>
        <tbody>
 
          <tr>
            <th>Id:</th>
            <td>
              <input type="text" name="id" size="40" value="">
            </td>
          </tr>

          <tr>
            <th>Source State:</th>
            <td>
              <input type="text" name="source" size="40" value="">
            </td>
          </tr>
 
          <tr>
            <th>Destination State:</th>
            <td>
              <input type="text" name="destination" size="40" value="">
            </td>
          </tr>

          <tr>
            <th>Condition:</th>
            <td>
              <input type="text" name="condition" size="40" value="">
            </td>
          </tr>

          <tr>
            <th>Permission:</th>
            <td>
              <input type="text" name="permission" size="40" value="">
            </td>
          </tr>

        </tbody>
      </table>
 
      <input type="submit" name="action.html:method" value="Add" />
 
    </form>
 
  </div>
 
</body>
</html>

=== Packages3/workflow/browser/stateful/configure.zcml 1.1 => 1.2 ===
--- Packages3/workflow/browser/stateful/configure.zcml:1.1	Thu Feb  6 17:03:06 2003
+++ Packages3/workflow/browser/stateful/configure.zcml	Fri Feb  7 10:29:27 2003
@@ -19,31 +19,71 @@
   permission="zope.ManageServices">
 
   <browser:page name="index.html" template="definition_index.pt" />
-  <browser:page name="states.html" template="definition_states.pt" />
-  <browser:page name="transitions.html" template="definition_transitions.pt" />
 
 </browser:pages>
 
-<browser:menuItem
-  for="zope.app.interfaces.workflow.stateful.IStatefulProcessDefinition"
+<browser:editform
+  schema="zope.app.interfaces.workflow.stateful.IStatefulProcessDefinition"
+  name="edit.html"
   menu="zmi_views"
-  title="Overview"
-  action="index.html"
+  label="Edit a Stateful ProcessDefinition"
+  permission="zope.workflow.ManageProcessDefinitions"
   />
 
-<browser:menuItem
+<browser:menuItems
   for="zope.app.interfaces.workflow.stateful.IStatefulProcessDefinition"
+  menu="zmi_actions">
+  
+  <browser:menuItem title="Manage States" action="states/contents.html" />
+  <browser:menuItem title="Manage Transitions" action="transitions/contents.html" />
+
+</browser:menuItems>
+
+
+<!-- States Container -->
+<browser:view
+  name="+"
+  for="zope.app.interfaces.workflow.stateful.IStatefulStatesContainer"
+  permission="zope.ManageContent"
+  class="zope.app.browser.workflow.stateful.definition.AddState" >
+ 
+  <browser:page name="index.html"  template="addstate.pt" />
+  <browser:page name="action.html" attribute="action" />
+ </browser:view>
+
+
+<!-- State -->
+<browser:editform
+  schema="zope.app.interfaces.workflow.stateful.IState"
+  name="edit.html"
   menu="zmi_views"
-  title="States"
-  action="states.html"
+  label="Edit a State"
+  permission="zope.workflow.ManageProcessDefinitions"
   />
 
-<browser:menuItem
-  for="zope.app.interfaces.workflow.stateful.IStatefulProcessDefinition"
+<!-- Transitions Container -->
+<browser:view
+  name="+"
+  for="zope.app.interfaces.workflow.stateful.IStatefulTransitionsContainer"
+  permission="zope.ManageContent"
+  class="zope.app.browser.workflow.stateful.definition.AddTransition" >
+ 
+  <browser:page name="index.html"  template="addtransition.pt" />
+  <browser:page name="action.html" attribute="action" />
+ </browser:view>
+
+
+
+<!-- Transition -->
+<browser:editform
+  schema="zope.app.interfaces.workflow.stateful.ITransition"
+  name="edit.html"
   menu="zmi_views"
-  title="Transitions"
-  action="transitions.html"
+  label="Edit a Transition"
+  permission="zope.workflow.ManageProcessDefinitions"
   />
+
+
 
 
 </zopeConfigure>


=== Packages3/workflow/browser/stateful/definition.py 1.1 => 1.2 ===
--- Packages3/workflow/browser/stateful/definition.py:1.1	Thu Feb  6 17:03:06 2003
+++ Packages3/workflow/browser/stateful/definition.py	Fri Feb  7 10:29:27 2003
@@ -21,8 +21,29 @@
 from zope.publisher.browser import BrowserView
 from zope.app.form.utility import setUpWidgets, getWidgetsDataForContent
 from zope.app.interfaces.workflow.stateful import IStatefulProcessDefinition
+
+from zope.app.workflow.stateful.definition import State, Transition
  
 class StatefulProcessDefinitionView(BrowserView):
  
     def getName(self):
         return """I'm a stateful ProcessInstance"""
+
+
+
+class AddState(BrowserView):
+
+    def action(self, id):
+        state = State()
+        self.context.setObject(id, state)
+        return self.request.response.redirect(self.request.URL[-2])
+
+
+class AddTransition(BrowserView):
+
+    def action(self, id, source, destination, condition=None, permission=None):
+        condition = condition or None
+        permission = permission or None
+        transition = Transition(source, destination, condition, permission)
+        self.context.setObject(id, transition)
+        return self.request.response.redirect(self.request.URL[-2])


=== Packages3/workflow/browser/stateful/definition_states.pt 1.1 => 1.2 ===
--- Packages3/workflow/browser/stateful/definition_states.pt:1.1	Thu Feb  6 17:03:06 2003
+++ Packages3/workflow/browser/stateful/definition_states.pt	Fri Feb  7 10:29:27 2003
@@ -11,4 +11,4 @@
   </div>
  
 </body>
-</html>
\ No newline at end of file
+</html>