[Zope-CVS] CVS: Packages3/workflow/browser - configure.zcml:1.8 definition.py:1.5 instance_index.pt:1.2
Michael Howitz
mh+zope@gocept.com
Wed, 26 Mar 2003 10:24:57 -0500
Update of /cvs-repository/Packages3/workflow/browser
In directory cvs.zope.org:/tmp/cvs-serv26142/browser
Modified Files:
configure.zcml definition.py instance_index.pt
Log Message:
new view for stateful workflow (to do transitions)
=== Packages3/workflow/browser/configure.zcml 1.7 => 1.8 ===
--- Packages3/workflow/browser/configure.zcml:1.7 Sat Mar 22 13:17:35 2003
+++ Packages3/workflow/browser/configure.zcml Wed Mar 26 10:24:26 2003
@@ -35,6 +35,16 @@
menu="zmi_views" title="Configurations"
/>
+<!--
+<browser:page
+ for="zope.app.interfaces.workflow.IProcessDefinition"
+ name="importexport.html"
+ template="importexport_index.pt"
+ class=".definition.ImportExportView"
+ permission="zope.workflow.ManageProcessDefinitions"
+ menu="zmi_views" title="Import/Export"
+ />
+-->
<browser:addform
for="zope.app.interfaces.workflow.IProcessDefinition"
@@ -84,7 +94,7 @@
/>
-<!-- ProcessInstanceContainerAdaptable -->
+<!-- ProcessInstanceContainerAdaptable
<browser:pages
for="zope.app.interfaces.workflow.IProcessInstanceContainerAdaptable"
permission="zope.workflow.UseProcessInstances"
@@ -102,7 +112,7 @@
title="ProcessInstances"
action="processinstances.html"
/>
-
+-->
<include package=".stateful" />
=== Packages3/workflow/browser/definition.py 1.4 => 1.5 ===
--- Packages3/workflow/browser/definition.py:1.4 Sat Mar 22 13:17:35 2003
+++ Packages3/workflow/browser/definition.py Wed Mar 26 10:24:26 2003
@@ -17,10 +17,13 @@
"""
__metaclass__ = type
-from zope.component import getAdapter, getView
+from zope.component import getAdapter, getView, getUtility
from zope.publisher.browser import BrowserView
from zope.app.traversing import traverse
from zope.app.interfaces.services.configuration import IUseConfiguration
+from zope.app.interfaces.workflow import IProcessDefinitionImportExport
+
+
class UseConfiguration(BrowserView):
@@ -47,3 +50,14 @@
def getName(self):
return """I'm a dummy ProcessInstance"""
+
+class ImportExportView(BrowserView):
+
+ def doExport(self):
+ return self._getUtil().exportProcessDefinition(self.context)
+
+ def doImport(self, data):
+ return self._getUtil().importProcessDefinition(data)
+
+ def _getUtil(self):
+ return getUtility(self.context, IProcessDefinitionImportExport)
=== Packages3/workflow/browser/instance_index.pt 1.1 => 1.2 ===
--- Packages3/workflow/browser/instance_index.pt:1.1 Fri Feb 7 16:50:51 2003
+++ Packages3/workflow/browser/instance_index.pt Wed Mar 26 10:24:26 2003
@@ -1,55 +1,53 @@
-<html metal:use-macro="views/standard_macros/page">
-<head>
-<style metal:fill-slot="headers" type="text/css">
-<!--
-
-.ContentTitle {
- text-align: left;
-}
--->
-</style>
-</head>
-<body>
-<div metal:fill-slot="body">
-
- <tal:block tal:define="pi_name request/pi_name;
- info python:view.getProcessInstanceInfo(pi_name)">
-
- <p>Status: <tal:block tal:replace="info/status" /></p>
-
- Outgoing Transitions:<br />
- <tal:block tal:repeat="name info/outgoing_transitions"
- tal:condition="info/outgoing_transitions | nothing">
- <tal:block tal:replace="name" />
- <a tal:attributes="href string:?pi_name=${pi_name}&fire_transition=${name}">fire</a><br />
- </tal:block>
-
- <table id="sortable" class="listing" summary="ProcessInstance Data"
- cellpadding="2" cellspacing="0" >
-
- <thead>
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
- </thead>
-
- <tbody tal:define="data info/data | nothing"
- tal:condition="info/data">
+ <html metal:use-macro="views/standard_macros/page">
+ <head>
+ <style metal:fill-slot="headers" type="text/css">
+ <!--
+ .ContentTitle {
+ text-align: left;
+ }
+ -->
+ </style>
+ </head>
+ <body>
+ <div metal:fill-slot="body">
+ <tal:block tal:define="pi_name request/pi_name;
+ info python:view.getProcessInstanceInfo(pi_name)">
+
+ <p>Status: <tal:block tal:replace="info/status" /></p>
+
+ Outgoing Transitions:<br />
+ <tal:block tal:repeat="name info/outgoing_transitions"
+ tal:condition="info/outgoing_transitions | nothing">
+ <tal:block tal:replace="name" />
+ <a tal:attributes="href string:?pi_name=${pi_name}&fire_transition=${name}">fire</a><br />
+ </tal:block>
+
+ <table id="sortable" class="listing" summary="ProcessInstance Data"
+ cellpadding="2" cellspacing="0" >
+
+ <thead>
+ <tr>
+ <th>Key</th>
+ <th>Value</th>
+ </tr>
+ </thead>
+
+ <tbody tal:define="data info/data | nothing"
+ tal:condition="info/data">
- <tr tal:repeat="key python:data.keys()">
- <td class="ContentTitle" tal:content="key" />
+ <tr tal:repeat="key python:data.keys()">
+ <td class="ContentTitle" tal:content="key" />
<td tal:content="python:data.get(key) or default">No Value</td>
- </tr>
-
- </tbody>
-
- </table>
- <br />
- </tal:block>
-</div>
-</body>
-</html>
+ </tr>
+
+ </tbody>
+
+ </table>
+ <br />
+ </tal:block>
+ </div>
+ </body>
+ </html>