[Zope-CVS] CVS: Packages3/workflow/browser/stateful - add.pt:1.1 configure.zcml:1.5 definition.py:1.4

Ulrich Eck ueck@net-labs.de
Wed, 26 Mar 2003 12:44:08 -0500


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

Modified Files:
	configure.zcml definition.py 
Added Files:
	add.pt 
Log Message:
first round of checkin of our sprint work (some test are missing)


=== Added File Packages3/workflow/browser/stateful/add.pt ===
<html metal:use-macro="views/standard_macros/dialog">
<body>

<div metal:fill-slot="body">
<form action="action.html" method="POST">
<table class="TypeListing" cellpadding="3">

  <caption>Add Content</caption>

    <tbody tal:repeat="info view/addingInfo">

    <tr>

      <td class="Selector">
        <input type="radio" name="type_name"
               tal:attributes="value info/action; id info/action" />
      </td>

      <td class="TypeName">
        <label style="font-weight: bold;"
               tal:attributes="for info/action">
          <span tal:replace="info/title" >Folder</span>
        </label>
        <div class="TypeDescription" tal:content="info/description">
          Folders are generic containers for content, including other
          folders.
        </div>
      </td>
    </tr>

  </tbody>

  <tbody tal:condition="nothing">

    <tr>

      <td class="Selector">
        <input type="radio" name="type_name" value="" />
               
      </td>

      <td class="TypeName">
        <img alt="Folder" src="../../ZMI/www/document_icon.gif" />
        Document
      </td>

    </tr>

    <tr>
      <td class="Selector"><br /></td>
      <td class="TypeDescription">
          Documents are simple textual content.
      </td>
    </tr>

  </tbody>

  <tr>
    <td><br/></td>
    <td>
        <input type="text" name="id"
               tal:condition="view/namesAccepted"
	       tal:attributes="value request/id | nothing"
        />
        <input type="submit" value=" Add " />
    </td>
  </tr>

</table>
</form>
</div>
</body>
</html>


=== Packages3/workflow/browser/stateful/configure.zcml 1.4 => 1.5 ===
--- Packages3/workflow/browser/stateful/configure.zcml:1.4	Wed Mar 26 10:24:27 2003
+++ Packages3/workflow/browser/stateful/configure.zcml	Wed Mar 26 12:43:37 2003
@@ -40,16 +40,28 @@
 </browser:menuItems>
 
 
+<!-- States/Transitions Container Adding Menus -->
+<browser:menu id="add_stateful_states" title="State Items" />
+<browser:menu id="add_stateful_transitions" title="Transition Items" />
+
+
+
 <!-- 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>
+    for="zope.app.interfaces.workflow.stateful.IStatefulStatesContainer"
+    name="+"
+    menu="zmi_actions" title="Add"
+    class=".definition.StatesContainerAdding"
+    permission="zope.workflow.ManageProcessDefinitions"
+    allowed_attributes="addingInfo"
+    >
+
+    <browser:page name="index.html"  template="add.pt" />
+    <browser:page name="action.html" attribute="action" />
+
+</browser:view>
+
 
 
 <!-- State -->
@@ -61,16 +73,36 @@
   permission="zope.workflow.ManageProcessDefinitions"
   />
 
+<browser:addform
+  name="AddState"
+  menu="add_stateful_states" title="Stateful State"
+  schema="zope.app.interfaces.workflow.stateful.IState"
+  permission="zope.workflow.ManageProcessDefinitions"
+  content_factory="zope.app.workflow.stateful.definition.State"
+  arguments=""
+  fields=""
+  />
+
+
+
+
+
+
 <!-- 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>
+    for="zope.app.interfaces.workflow.stateful.IStatefulTransitionsContainer"
+    name="+"
+    menu="zmi_actions" title="Add"
+    class=".definition.TransitionsContainerAdding"
+    permission="zope.workflow.ManageProcessDefinitions"
+    allowed_attributes="addingInfo"
+    >
+
+    <browser:page name="index.html"  template="add.pt" />
+    <browser:page name="action.html" attribute="action" />
+
+</browser:view>
 
 
 
@@ -83,6 +115,16 @@
   permission="zope.workflow.ManageProcessDefinitions"
   />
 
+<browser:addform
+  name="AddTransition"
+  menu="add_stateful_transitions" title="Stateful Transition"
+  schema="zope.app.interfaces.workflow.stateful.ITransition"
+  permission="zope.workflow.ManageProcessDefinitions"
+  content_factory="zope.app.workflow.stateful.definition.Transition"
+  arguments="sourceState destinationState condition permission triggerMode"
+  fields="sourceState destinationState condition permission triggerMode"
+  />
+
 
 <!-- ContentWorkflowsUtility -->
 <browser:menuItem
@@ -110,40 +152,5 @@
 
 
 
-<!-- ProcessInstanceContainerAdaptable -->
-<browser:pages
-  for="zope.app.interfaces.workflow.IProcessInstanceContainerAdaptable"
-  permission="zope.workflow.UseProcessInstances"
-  class="zope.app.browser.workflow.stateful.instance.StatefulInstanceContainerView">
-
-  <browser:page name="workflows.html" attribute="contents" />
-  <browser:page name="fireTransition.html" attribute="fireTransition" />
-</browser:pages>
-
-<browser:menuItem
-  for="zope.app.interfaces.workflow.IProcessInstanceContainerAdaptable"
-  menu="zmi_views"
-  title="Workflows"
-  action="workflows.html"
-  />
-
-<browser:pages
-  for="zope.app.interfaces.container.IContainer"
-  permission="zope.View"
-  class="zope.app.browser.workflow.stateful.view.FilterList">
-
-  <browser:page name="filter.html" attribute="filter" />
-</browser:pages>
-
-
-<!--
-<browser:pages
-  for="zope.app.interfaces.workflow.IProcessInstanceContainerAdaptable"
-  permission="zope.View"
-  class="zope.app.browser.workflow.stateful.view.FilterList">
-
-  <browser:page name="filter.html" attribute="filter" />
-</browser:pages>
--->
 
 </zopeConfigure>


=== Packages3/workflow/browser/stateful/definition.py 1.3 => 1.4 ===
--- Packages3/workflow/browser/stateful/definition.py:1.3	Fri Feb  7 16:50:52 2003
+++ Packages3/workflow/browser/stateful/definition.py	Wed Mar 26 12:43:37 2003
@@ -17,14 +17,35 @@
 """
 __metaclass__ = type
 
+from zope.proxy.context import getWrapperContainer
 from zope.proxy.introspection import removeAllProxies
 from zope.component import getServiceManager
 from zope.publisher.browser import BrowserView
+from zope.app.browser.container.adding import Adding
 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 StatesContainerAdding(Adding):
+    """Custom adding view for StatesContainer objects.
+    """
+    menu_id = "add_stateful_states"
+
+
+class TransitionsContainerAdding(Adding):
+    """Custom adding view for TransitionsContainer objects.
+    """
+    menu_id = "add_stateful_transitions"
+
+    def getProcessDefinition(self):
+        return getWrapperContainer(self).getProcessDefinition()
+
+
+
 class StatefulProcessDefinitionView(BrowserView):
  
     def getName(self):