[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Workflow - IWorkflowActivityInfo.py:1.1.2.1 WorkflowActivityInfo.py:1.1.2.1

Florent Guillaume fg@nuxeo.com
Wed, 6 Mar 2002 04:28:20 -0500


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

Added Files:
      Tag: Zope-3x-branch
	IWorkflowActivityInfo.py WorkflowActivityInfo.py 
Log Message:
First empty Workflow Activity Info with tests (florent+luca).

=== Added File Zope3/lib/python/Zope/App/Workflow/IWorkflowActivityInfo.py ===
"""
Interface for Workflow Activity Info
WAI encapsulates what can be done at a given point.
"""

from Interface import Interface

class IWorkflowActivityInfo(Interface):
    """
    Base interface for Workflow Activity Info.
    """

    def getId():
        """
        Get the Activity Info id.
        """

    def getTitle():
        """
        Get the Activity Info title.
        """

    def getCategory():
        """
        Get the Activity Info category.
        Returns a string (usually 'workflow').
        """

    def getActionURL():
        """
        Get the Activity Info URL that should be called
        to trigger the action.
        Returns an unencoded URL.
        """

    def getPermissions():
        """
        Get the permissions this Activity Info is protected by.
        Returns a list of IPermission.
        The Activity Info is valid if any permission matches.
        """

    def getRoles():
        """
        Get the roles this Activity Info is protected by.
        Returns a list of IRole.
        The Activity Info is valid if any role matches.
        """

    def getCondition():
        """
        Get the guard this Activity Info is protected by.
        Returns a TALES expression (Interface ? XXX).
        """

    def getSource():
        """
        Get the actual action object this Activity Info is about,
        for instance a workitem (task-based workflow) or a transition
        (content-based workflow).
        """


=== Added File Zope3/lib/python/Zope/App/Workflow/WorkflowActivityInfo.py ===
from Zope.App.Workflow.IWorkflowActivityInfo import IWorkflowActivityInfo

class WorkflowActivityInfo:

    __implements__ = IWorkflowActivityInfo

    ############################################################
    # Implementation methods for interface
    # Zope.App.Workflow.IWorkflowActivityInfo

    def getId(self):
        '''See interface IWorkflowActivityInfo'''

    def getTitle(self):
        '''See interface IWorkflowActivityInfo'''

    def getCategory(self):
        '''See interface IWorkflowActivityInfo'''

    def getActionURL(self):
        '''See interface IWorkflowActivityInfo'''

    def getPermissions(self):
        '''See interface IWorkflowActivityInfo'''

    def getRoles(self):
        '''See interface IWorkflowActivityInfo'''

    def getCondition(self):
        '''See interface IWorkflowActivityInfo'''

    def getSource(self):
        '''See interface IWorkflowActivityInfo'''
    #
    ############################################################