[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Workflow - IProcessInstanceContainer.py:1.1.2.1 IProcessInstanceContainerAdaptable.py:1.1.2.1 ProcessInstanceContainer.py:1.1.2.1 ProcessInstanceContainerAdapter.py:1.1.2.1 IWorkflowService.py:1.2.24.6 configure.zcml:1.1.2.4

Florent Guillaume fg@nuxeo.com
Fri, 6 Dec 2002 11:04:39 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Workflow
In directory cvs.zope.org:/tmp/cvs-serv6178

Modified Files:
      Tag: sprintathon-wf-branch
	IWorkflowService.py configure.zcml 
Added Files:
      Tag: sprintathon-wf-branch
	IProcessInstanceContainer.py 
	IProcessInstanceContainerAdaptable.py 
	ProcessInstanceContainer.py ProcessInstanceContainerAdapter.py 
Log Message:
Checkpoint.
Adding a beginning of entity-base workflow tool.
Tests pass, Zope starts.


=== Added File Zope3/lib/python/Zope/App/Workflow/IProcessInstanceContainer.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Interfaces for workflow process instance container.

$Id: IProcessInstanceContainer.py,v 1.1.2.1 2002/12/06 16:04:08 efge Exp $
"""

from Interface import Interface


class IProcessInstanceContainer(Interface):
    """Workflow process instance container."""

    def addProcessInstance(name, pi):
        """Add the process instance, associated to name."""

    def getProcessInstance(name):
        """Get the process instance associated to the given name."""

    def getProcessInstanceNames():
        """Get the names associated to all process instances."""

    def delProcessInstance(name):
        """Remove the process instance associated to name."""


=== Added File Zope3/lib/python/Zope/App/Workflow/IProcessInstanceContainerAdaptable.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Interfaces for workflow process instance container.

$Id: IProcessInstanceContainerAdaptable.py,v 1.1.2.1 2002/12/06 16:04:08 efge Exp $
"""

from Interface import Interface


class IProcessInstanceContainerAdaptable(Interface):
    """Marker interface for components that can be
    adapted to a process instance container."""


=== Added File Zope3/lib/python/Zope/App/Workflow/ProcessInstanceContainer.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Process instance container.

$Id: ProcessInstanceContainer.py,v 1.1.2.1 2002/12/06 16:04:08 efge Exp $
"""



=== Added File Zope3/lib/python/Zope/App/Workflow/ProcessInstanceContainerAdapter.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Interfaces for workflow process instance container.

$Id $
"""
__metaclass__ = type

from Zope.App.OFS.Annotation.IAnnotatable import IAnnotatable
from Zope.App.Workflow.IProcessInstanceContainer \
     import IProcessInstanceContainer


WFKey = "Zope.App.Worfklow.ProcessInstanceContainerAdapter"

class ProcessInstanceContainerAdapter:

    __implements__ = IProcessInstanceContainer
    __used_for__ = IAnnotatable

    def __init__(self, context):
        annotations = getAdapter(context, IAnnotations)
        wfdata = annotations.get(WFKey)
        if not wfdata:
            wfdata = PersistentDict()
            annotations[WFKey] = wfdata
        self.wfdata = wfdata

    def addProcessInstance(self, name, pi):
        if name in self.wfdata:
            raise KeyError, "Already in workflow %s" % name
        self.wfdata[name] = pi

    def getProcessInstance(self, name):
        return self.wfdata[name]

    def getProcessInstanceNames(self):
        return self.wfdata.keys()

    def delProcessInstance(self, name):
        del self.wfdata[name]


=== Zope3/lib/python/Zope/App/Workflow/IWorkflowService.py 1.2.24.5 => 1.2.24.6 ===
--- Zope3/lib/python/Zope/App/Workflow/IWorkflowService.py:1.2.24.5	Thu Dec  5 08:28:41 2002
+++ Zope3/lib/python/Zope/App/Workflow/IWorkflowService.py	Fri Dec  6 11:04:08 2002
@@ -33,7 +33,7 @@
         """
 
     def getProcessDefinition(name):
-        """Return the definition for name."""
+        """Return the IProcessDefinition for the name."""
 
     def createProcessInstance(definition_name):
         """Create a process instance from a process definition."""


=== Zope3/lib/python/Zope/App/Workflow/configure.zcml 1.1.2.3 => 1.1.2.4 ===
--- Zope3/lib/python/Zope/App/Workflow/configure.zcml:1.1.2.3	Thu Dec  5 11:44:38 2002
+++ Zope3/lib/python/Zope/App/Workflow/configure.zcml	Fri Dec  6 11:04:08 2002
@@ -68,6 +68,12 @@
 </content>
 
 
+<!-- Process Instance Container -->
+
+<adapter factory="Zope.App.Workflow.ProcessInstanceContainerAdapter."
+         provides="Zope.App.Workflow.IProcessInstanceContainer."
+         for="Zope.App.OFS.Annotation.IAnnotatable." />
+
 
 <include package=".Browser" />