Back to index

plone3  3.1.7
Functions | Variables
plone.app.iterate.subscribers.workflow Namespace Reference

Functions

def handleCheckout
def handleCheckin

Variables

string USE_WORKFLOW = "checkout_workflow_policy"
string policy_storage = "previous_wf_policy"

Function Documentation

Definition at line 61 of file workflow.py.

00061 
00062 def handleCheckin( event ):
00063     policy = getattr( aq_base(event.object), WorkflowPolicyConfig_id, None )
00064     storage = get_storage( event.relation )
00065     previous_policy = storage.get( policy_storage )
00066     if previous_policy is None:
00067         if policy and not policy.coci_created:  # only reset workflows we know.. could use are own storage
00068             return
00069         elif policy is None:
00070             return
00071         else:
00072             delattr( event.object, WorkflowPolicyConfig_id )
00073     else:
00074         setattr( event.object, WorkflowPolicyConfig_id, previous_policy)
00075     
00076 
00077 
00078     

Here is the call graph for this function:

Definition at line 39 of file workflow.py.

00039 
00040 def handleCheckout( event ):
00041     # defer to setting
00042     properties = getToolByName(aq_base(event.object), 'portal_properties')
00043     enabled = properties.site_properties.getProperty('enable_checkout_workflow')
00044     if not enabled:
00045         return
00046 
00047     policy_id = properties.site_properties.getProperty('checkout_workflow_policy')
00048     
00049     existing_policy = getattr( aq_base( event.working_copy ), WorkflowPolicyConfig_id, None )
00050     storage = get_storage( event.relation )
00051     
00052     # set config for policy in and below 
00053     policy = WorkflowPolicyConfig( policy_id, policy_id)
00054     policy.coci_created = True
00055     
00056     if existing_policy is not None:
00057         storage[ policy_storage ] = policy
00058 
00059     # we setattr because we want the effect on non containerish objects
00060     setattr( event.working_copy, WorkflowPolicyConfig_id, policy )

Here is the call graph for this function:


Variable Documentation

Definition at line 37 of file workflow.py.

string plone.app.iterate.subscribers.workflow.USE_WORKFLOW = "checkout_workflow_policy"

Definition at line 35 of file workflow.py.