[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/ Bring back workflow package, so that we can keep a 3.0.0 compatible

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Nov 6 11:36:48 EST 2004


Log message for revision 28353:
  Bring back workflow package, so that we can keep a 3.0.0 compatible 
  version around.
  

Changed:
  A   Zope3/branches/ZopeX3-3.0/package-includes/workflow-configure.zcml
  A   Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/
  A   Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/DEPENDENCIES.cfg
  A   Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/PACKAGE.cfg
  A   Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/PUBLICATION.cfg
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/browser/definition.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/configure.zcml
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/stateful/browser/ftests/test_contentworkflowsmanager.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/stateful/browser/ftests/test_processdefinition.py

-=-
Copied: Zope3/branches/ZopeX3-3.0/package-includes/workflow-configure.zcml (from rev 28349, Zope3/trunk/package-includes/workflow-configure.zcml)

Copied: Zope3/branches/ZopeX3-3.0/src/zope/app/workflow (from rev 27250, Zope3/trunk/src/zope/app/workflow)

Added: Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/DEPENDENCIES.cfg
===================================================================
--- Zope3/trunk/src/zope/app/workflow/DEPENDENCIES.cfg	2004-08-24 18:39:31 UTC (rev 27250)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/DEPENDENCIES.cfg	2004-11-06 16:36:48 UTC (rev 28353)
@@ -0,0 +1 @@
+zope.app
\ No newline at end of file

Added: Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/PACKAGE.cfg
===================================================================
--- Zope3/trunk/src/zope/app/workflow/PACKAGE.cfg	2004-08-24 18:39:31 UTC (rev 27250)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/PACKAGE.cfg	2004-11-06 16:36:48 UTC (rev 28353)
@@ -0,0 +1,27 @@
+# Load the license from an external source, so we don't have to keep a
+# copy of it sitting around:
+<load>
+  LICENSE.txt  http://svn.zope.org/*checkout*/Zope3/trunk/ZopePublicLicense.txt?rev=25177
+</load>
+
+# Add a few things to the distribution root.
+<distribution>
+  README.txt
+</distribution>
+
+# Specify what is included in the component.
+<collection>
+
+  # Documentation files of the package:
+  *.txt
+
+  # Python modules from the package:
+  *.py
+
+  # Configuration files of the package:
+  *.zcml
+
+  # Page Templates
+  *.pt
+
+</collection>

Added: Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/PUBLICATION.cfg
===================================================================
--- Zope3/trunk/src/zope/app/workflow/PUBLICATION.cfg	2004-08-24 18:39:31 UTC (rev 27250)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/PUBLICATION.cfg	2004-11-06 16:36:48 UTC (rev 28353)
@@ -0,0 +1,11 @@
+Metadata-Version: 1.0
+Name: workflow
+Summary: Workflow Package for Zope 3.0
+Author: Zope Corporation and Contributors
+Author-email: zope3-dev at zope.org
+License: ZPL 2.1
+Description:
+        This package was developed to provide workflow functionality for the
+        Zope 3 Application server. While it is maintained as part of Zope 3, it
+        was not included in the Zope X3 3.0 release and is thus distributed
+        separately.

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/browser/definition.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/browser/definition.py	2004-08-24 18:39:31 UTC (rev 27250)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/browser/definition.py	2004-11-06 16:36:48 UTC (rev 28353)
@@ -12,7 +12,7 @@
 #
 ##############################################################################
 """ProcessDefinition registration adding view
- 
+
 $Id$
 """
 
@@ -23,7 +23,7 @@
 
 
 class ProcessDefinitionView(object):
- 
+
     def getName(self):
         return """I'm a dummy ProcessInstance"""
 
@@ -31,7 +31,7 @@
 class ImportExportView(object):
 
     def importDefinition(self):
-        xml = self.request.get('definition')
+        xml = str(self.request.get('definition'))
         if xml:
             IProcessDefinitionImportHandler(self.context).doImport(xml)
         self.request.response.redirect('@@importexport.html?success=1')

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/workflow/configure.zcml	2004-08-24 18:39:31 UTC (rev 27250)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/configure.zcml	2004-11-06 16:36:48 UTC (rev 28353)
@@ -51,7 +51,6 @@
      />
 
   <content class=".definition.ProcessDefinitionVocabulary">
-      <allow interface="zope.schema.interfaces.IVocabulary"/>
       <allow interface="zope.schema.interfaces.IVocabularyTokenized"/>
   </content>
 

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/stateful/browser/ftests/test_contentworkflowsmanager.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/stateful/browser/ftests/test_contentworkflowsmanager.py	2004-08-24 18:39:31 UTC (rev 27250)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/stateful/browser/ftests/test_contentworkflowsmanager.py	2004-11-06 16:36:48 UTC (rev 28353)
@@ -18,6 +18,8 @@
 import unittest
 import re
 
+from transaction import commit
+
 from zope.interface import Interface
 from zope.app.component.interface import nameToInterface
 from zope.app import zapi
@@ -44,21 +46,14 @@
                    IStatefulProcessDefinition,
                    StatefulProcessDefinition()
                    ) 
+        commit()
 
         response = self.publish(
             self.basepath + '/contents.html',
-            basic='mgr:mgrpw')
-
-        self.assertEqual(response.getStatus(), 200)
-
-        expr = 'zope.app.browser.add.ContentWorkflowsManager.f([0-9]*)'
-        m = re.search(expr, response.getBody())
-        type_name = m.group(0)
-
-        response = self.publish(
-            self.basepath + '/contents.html',
             basic='mgr:mgrpw',
-            form={'type_name': type_name,
+            form={'type_name': 'zope.app.browser.add.'
+                               'zope.app.workflow.stateful.contentworkflow.'
+                               'ContentWorkflowsManager',
                   'new_value': 'mgr' })
 
         root = self.getRootFolder()

Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/stateful/browser/ftests/test_processdefinition.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/stateful/browser/ftests/test_processdefinition.py	2004-08-24 18:39:31 UTC (rev 27250)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/workflow/stateful/browser/ftests/test_processdefinition.py	2004-11-06 16:36:48 UTC (rev 28353)
@@ -22,6 +22,34 @@
 from zope.app.tests.functional import BrowserTestCase
 from zope.app.workflow.stateful.definition import StatefulProcessDefinition
 
+xml=u"""<?xml version="1.0"?>
+<workflow type="StatefulWorkflow"
+          title="Foo Test Workflow">
+
+  <schema name="">
+    <permissions>
+    </permissions>
+  </schema>
+
+  <states>
+    <state title="initial" name="INITIAL"/>
+    <state title="Foo" name="foo"/>
+  </states>
+
+  <transitions>
+
+      <transition sourceState="INITIAL"
+                  destinationState="foo"
+                  permission="zope.Public"
+                  triggerMode="Automatic"
+                  title="Make Foo"
+                  name="initial_foo"/>
+
+  </transitions>
+
+</workflow>"""
+
+
 class Test(BrowserTestCase):
 
     def setUp(self):
@@ -29,18 +57,10 @@
         self.basepath = '/++etc++site/default'
         response = self.publish(
             self.basepath + '/contents.html',
-            basic='mgr:mgrpw')
-
-        self.assertEqual(response.getStatus(), 200)
-
-        expr = 'zope.app.browser.add.StatefulProcessDefinition.f([0-9]*)'
-        m = re.search(expr, response.getBody())
-        type_name = m.group(0)
-
-        response = self.publish(
-            self.basepath + '/contents.html',
             basic='mgr:mgrpw',
-            form={'type_name': type_name,
+            form={'type_name': 'zope.app.browser.add.'
+                               'zope.app.workflow.stateful.definition.'
+                               'StatefulProcessDefinition',
                   'new_value': 'pd' })
 
     def test_processdefinition(self):
@@ -68,7 +88,24 @@
         body = ' '.join(response.getBody().split())
         self.assert_(body.find('This object is not currently active.') >=0)
 
+    def test_transitions(self):
         response = self.publish(
+            self.basepath + '/pd/transitions/contents.html',
+            basic='mgr:mgrpw')
+
+        self.assertEqual(response.getStatus(), 200)
+
+    def test_states(self):
+        response = self.publish(
+            self.basepath + '/pd/states/contents.html',
+            basic='mgr:mgrpw')
+
+        self.assertEqual(response.getStatus(), 200)
+        body = ' '.join(response.getBody().split())
+        self.assert_(body.find('INITIAL') >= 0)
+
+    def test_xmlimport(self):
+        response = self.publish(
             self.basepath + '/pd/importexport.html',
             basic='mgr:mgrpw')
 
@@ -80,23 +117,28 @@
         self.assert_(body.find(
             '<a href="transitions/contents.html">Manage Transitions</a>') >=0)
 
-    def test_transitions(self):
         response = self.publish(
-            self.basepath + '/pd/transitions/contents.html',
-            basic='mgr:mgrpw')
+            self.basepath + '/pd/import.html',
+            basic='mgr:mgrpw',
+            form={'definition': xml})
 
-        self.assertEqual(response.getStatus(), 200)
+        self.assertEqual(response.getStatus(), 302)
+        self.assertEqual(response.getHeader('Location'),
+                         '@@importexport.html?success=1')
 
-    def test_states(self):
         response = self.publish(
-            self.basepath + '/pd/states/contents.html',
-            basic='mgr:mgrpw')
+            self.basepath + '/pd/'+response.getHeader('Location'),
+            basic='mgr:mgrpw',
+            form={'definition': xml})
 
         self.assertEqual(response.getStatus(), 200)
         body = ' '.join(response.getBody().split())
-        self.assert_(body.find('INITIAL') >= 0)
 
+        self.assert_(body.find('initial_foo') >= 0)
 
+        self.assert_(body.find('Import was successfull!') >= 0)
+
+
 def test_suite():
     return unittest.makeSuite(Test)
 



More information about the Zope3-Checkins mailing list