[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/workflow - __init__.py:1.9 stateful.py:1.9

Ulrich Eck ueck@net-labs.de
Wed, 26 Mar 2003 11:35:26 -0500


Update of /cvs-repository/Zope3/src/zope/app/interfaces/workflow
In directory cvs.zope.org:/tmp/cvs-serv3509

Modified Files:
	__init__.py stateful.py 
Log Message:
added ImportExport Utility
added triggerMode to Stateful Transitions


=== Zope3/src/zope/app/interfaces/workflow/__init__.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/interfaces/workflow/__init__.py:1.8	Sat Mar 22 11:02:46 2003
+++ Zope3/src/zope/app/interfaces/workflow/__init__.py	Wed Mar 26 11:35:26 2003
@@ -155,13 +155,51 @@
     """ProcessDefinition Import/Export.
     """
 
-    def importProcessDefinition(process_definition):
+    def importProcessDefinition(context, data):
         """Import a Process Definition
         """
 
-    def exportProcessDefinition(pd_id):
+    def exportProcessDefinition(context, process_definition):
         """Export a Process Definition
         """
 
 
 
+class IGlobalProcessDefinitionImportExport(IProcessDefinitionImportExport):
+    """ Global ImportExport with additional method
+        to register import/export handlers.
+    """
+
+    def addImportHandler(interface, factory):
+        """add a factory for an import handler for a certain interface.
+        """
+
+    def addExportHandler(interface, factory):
+        """add a factory for an export handler for a certain interface.
+        """
+
+
+class IProcessDefinitionImportHandler(Interface):
+    """Handler for Import of ProcessDefinitions.
+    """
+    
+    def canImport(data):
+        """check if handler can import a processdefinition
+           based on the data given.
+        """
+
+    def doImport(data):
+        """create a ProcessDefinition from the data given.
+
+        returns a ProcessDefinition Instance.
+        """
+
+class IProcessDefinitionExportHandler(Interface):
+    """Handler for Export of ProcessDefinitions.
+    """
+
+    def doExport(process_definition):
+        """export a ProcessDefinition into a specific format.
+
+        returns the serialized value of the given ProcessDefintion.
+        """


=== Zope3/src/zope/app/interfaces/workflow/stateful.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/interfaces/workflow/stateful.py:1.8	Sat Mar 22 11:02:46 2003
+++ Zope3/src/zope/app/interfaces/workflow/stateful.py	Wed Mar 26 11:35:26 2003
@@ -48,6 +48,16 @@
     allowed_values = ContextProperty(__allowed)
 
 
+class TriggerModeField(zope.schema.TextLine):
+    """Trigger Mode.
+    """
+
+    def __allowed(self):
+        return [u'Manual', u'Automatic']
+    
+    allowed_values = ContextProperty(__allowed)
+
+
 class ITransition(Interface):
     """Stateful workflow transition.
     """
@@ -72,6 +82,13 @@
         title=u"The permission needed to fire the Transition.")
 
 
+    triggerMode = TriggerModeField(
+        title=u"Trigger Mode",
+        description=u"How the Transition is triggered (Automatic/Manual)",
+        default=u"Manual")
+        
+    
+
     def getSourceState():
         """Get Source State."""
 
@@ -96,9 +113,18 @@
     def setPermission(permission):
         """Set Permission."""
 
+    def getTriggerMode():
+        """Return the TriggerMode.
+        """
+
+    def setTriggerMode():
+        """Set TriggerMode.
+        """
+        
     def getProcessDefinition():
         """Return the ProcessDefinition Object.
         """
+