Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes
CMFPlacefulWorkflow.PlacefulWorkflowTool.PlacefulWorkflowTool Class Reference
Inheritance diagram for CMFPlacefulWorkflow.PlacefulWorkflowTool.PlacefulWorkflowTool:
Inheritance graph
[legend]
Collaboration diagram for CMFPlacefulWorkflow.PlacefulWorkflowTool.PlacefulWorkflowTool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def manage_addWorkflowPolicyForm
def manage_addWorkflowPolicy
def all_meta_types
def getWorkflowPolicyById
def getWorkflowPolicies
def getWorkflowPolicyIds
def getWorkflowPolicyConfig
def getMaxChainLength
def setMaxChainLength

Static Public Attributes

string id = 'portal_placeful_workflow'
string meta_type = 'Placeful Workflow Tool'
tuple security = ClassSecurityInfo()
 manage_options = Folder.manage_options
tuple manage_addWorkflowPolicy = postonly(manage_addWorkflowPolicy)

Private Member Functions

def _post_init

Static Private Attributes

tuple __implements__ = (z2IPlacefulWorkflowTool,)
list _actions = []
tuple _manage_addWorkflowPolicyForm = PageTemplateFile(path_join('www', 'add_workflow_policy'), globals())

Detailed Description

PlacefulWorkflow Tool

Definition at line 62 of file PlacefulWorkflowTool.py.


Constructor & Destructor Documentation

Definition at line 80 of file PlacefulWorkflowTool.py.

00080 
00081     def __init__(self):
00082         # Properties to be edited by site manager
00083         safeEditProperty(self, 'max_chain_length', 1, data_type='int')

Here is the call graph for this function:


Member Function Documentation

_post_init(self) => called from manage_add method, acquired within ZODB (__init__ is not)

Definition at line 193 of file PlacefulWorkflowTool.py.

00193 
00194     def _post_init(self):
00195         """
00196         _post_init(self) => called from manage_add method, acquired within ZODB (__init__ is not)
00197         """
00198         pass

Definition at line 140 of file PlacefulWorkflowTool.py.

00140 
00141     def all_meta_types(self):
00142         return (
00143             {'name': 'WorkflowPolicy',
00144              'action': 'manage_addWorkflowPolicyForm',
00145              'permission': ManagePortal },)

Return the max workflow chain length

Definition at line 203 of file PlacefulWorkflowTool.py.

00203 
00204     def getMaxChainLength(self):
00205         """Return the max workflow chain length"""
00206         max_chain_length = self.getProperty('max_chain_length')
00207         return max_chain_length

Here is the call graph for this function:

Return the list of workflow policies.

Definition at line 160 of file PlacefulWorkflowTool.py.

00160 
00161     def getWorkflowPolicies(self):
00162         """ Return the list of workflow policies.
00163         """
00164         wfps = []
00165         for obj_name, obj in self.objectItems():
00166             if getattr(obj, '_isAWorkflowPolicy', 0):
00167                 wfps.append(obj)
00168         return tuple(wfps)

Here is the call graph for this function:

Retrieve a given workflow policy.

Definition at line 147 of file PlacefulWorkflowTool.py.

00147 
00148     def getWorkflowPolicyById(self, wfp_id):
00149 
00150         """ Retrieve a given workflow policy.
00151         """
00152         policy=None
00153         if wfp_id != None:
00154             wfp = getattr(self, wfp_id, None)
00155             if wfp !=None:
00156                 if getattr(wfp, '_isAWorkflowPolicy', 0):
00157                     policy = wfp
00158         return policy

Here is the caller graph for this function:

Definition at line 184 of file PlacefulWorkflowTool.py.

00184 
00185     def getWorkflowPolicyConfig(self, ob):
00186         local_config = None
00187         some_config = getattr(ob, WorkflowPolicyConfig_id, None)
00188         if some_config is not None:
00189             # Was it here or did we acquire?
00190             if hasattr(aq_base(ob), WorkflowPolicyConfig_id):
00191                 local_config = some_config
00192         return local_config

Return the list of workflow policy ids.

Definition at line 170 of file PlacefulWorkflowTool.py.

00170 
00171     def getWorkflowPolicyIds(self):
00172 
00173         """ Return the list of workflow policy ids.
00174         """
00175         wfp_ids = []
00176 
00177         for obj_name, obj in self.objectItems():
00178             if getattr(obj, '_isAWorkflowPolicy', 0):
00179                 wfp_ids.append(obj_name)
00180 
00181         return tuple(wfp_ids)
00182 

Here is the call graph for this function:

def CMFPlacefulWorkflow.PlacefulWorkflowTool.PlacefulWorkflowTool.manage_addWorkflowPolicy (   self,
  id,
  workflow_policy_type = 'default_workflow_policy (Simple Policy)',
  duplicate_id = 'empty',
  RESPONSE = None,
  REQUEST = None 
)
Adds a workflow policies from the registered types.

Definition at line 102 of file PlacefulWorkflowTool.py.

00102 
00103                                  REQUEST=None):
00104         """ Adds a workflow policies from the registered types.
00105         """
00106         if id in ('empty', 'portal_workflow'):
00107             raise ValueError, "'%s' is reserved. Please choose another id." % id
00108 
00109         factory = _workflow_policy_factories[workflow_policy_type]
00110         ob = factory(id)
00111         self._setObject(id, ob)
00112 
00113         if duplicate_id and duplicate_id != 'empty':
00114             types_tool = getToolByName(self, 'portal_types')
00115             new_wp = self.getWorkflowPolicyById(id)
00116 
00117             if duplicate_id == 'portal_workflow':
00118                 wf_tool = getToolByName(self, 'portal_workflow')
00119 
00120                 new_wp.setDefaultChain(wf_tool._default_chain)
00121 
00122                 for ptype in types_tool.objectIds():
00123                     chain = wf_tool.getChainForPortalType(ptype, managescreen=True)
00124                     if chain:
00125                         new_wp.setChain(ptype, chain)
00126 
00127             else:
00128                 orig_wp = self.getWorkflowPolicyById(duplicate_id)
00129                 new_wp.setDefaultChain(orig_wp.getDefaultChain('Document'))
00130 
00131                 for ptype in types_tool.objectIds():
00132                     chain = orig_wp.getChainFor(ptype, managescreen=True)
00133                     if chain:
00134                         new_wp.setChain(ptype, chain)
00135 
00136         if RESPONSE is not None:
00137             RESPONSE.redirect(self.absolute_url() +
                              '/manage_main?management_view=Contents')

Here is the call graph for this function:

Form for adding workflow policies.

Definition at line 87 of file PlacefulWorkflowTool.py.

00087 
00088     def manage_addWorkflowPolicyForm(self, REQUEST):
00089 
00090         """ Form for adding workflow policies.
00091         """
00092         wfpt = []
00093         for key in _workflow_policy_factories.keys():
00094             wfpt.append(key)
00095         wfpt.sort()
00096         return self._manage_addWorkflowPolicyForm(REQUEST, workflow_policy_types=wfpt)

Set the max workflow chain length

Definition at line 208 of file PlacefulWorkflowTool.py.

00208 
00209     def setMaxChainLength(self, max_chain_length):
00210         """Set the max workflow chain length"""
00211         safeEditProperty(self, 'max_chain_length', max_chain_length, data_type='int')

Here is the call graph for this function:


Member Data Documentation

tuple CMFPlacefulWorkflow.PlacefulWorkflowTool.PlacefulWorkflowTool.__implements__ = (z2IPlacefulWorkflowTool,) [static, private]

Definition at line 70 of file PlacefulWorkflowTool.py.

Definition at line 73 of file PlacefulWorkflowTool.py.

tuple CMFPlacefulWorkflow.PlacefulWorkflowTool.PlacefulWorkflowTool._manage_addWorkflowPolicyForm = PageTemplateFile(path_join('www', 'add_workflow_policy'), globals()) [static, private]

Definition at line 84 of file PlacefulWorkflowTool.py.

string CMFPlacefulWorkflow.PlacefulWorkflowTool.PlacefulWorkflowTool.id = 'portal_placeful_workflow' [static]

Definition at line 67 of file PlacefulWorkflowTool.py.

Definition at line 138 of file PlacefulWorkflowTool.py.

Definition at line 78 of file PlacefulWorkflowTool.py.

Definition at line 68 of file PlacefulWorkflowTool.py.

Definition at line 75 of file PlacefulWorkflowTool.py.


The documentation for this class was generated from the following file: