Back to index

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

List of all members.

Public Member Functions

def __init__
def manage_makeChanges
def getPolicyInId
def getPolicyBelowId
def getPolicyIn
def getPolicyBelow
def setPolicyIn
def setPolicyBelow
def getPlacefulChainFor

Public Attributes

 id
 title
 workflow_policy_in
 workflow_policy_below

Static Public Attributes

string meta_type = 'Workflow Policy Configuration'
 index_html = None
tuple security = ClassSecurityInfo()
tuple manage_main
tuple manage_options

Detailed Description

Workflow policy configuration

Definition at line 57 of file WorkflowPolicyConfig.py.


Constructor & Destructor Documentation

def CMFPlacefulWorkflow.WorkflowPolicyConfig.WorkflowPolicyConfig.__init__ (   self,
  workflow_policy_in = '',
  workflow_policy_below = '' 
)
Initialize a new MailHost instance 

Definition at line 72 of file WorkflowPolicyConfig.py.

00072 
00073     def __init__( self, workflow_policy_in='', workflow_policy_below='' ):
00074         """Initialize a new MailHost instance """
00075         self.id = WorkflowPolicyConfig_id
00076         self.title = "Workflow policy configuration"
00077         self.setPolicyIn(workflow_policy_in)
00078         self.setPolicyBelow(workflow_policy_below)


Member Function Documentation

def CMFPlacefulWorkflow.WorkflowPolicyConfig.WorkflowPolicyConfig.getPlacefulChainFor (   self,
  portal_type,
  start_here = False 
)
Get the chain for the given portal_type.

Returns None if no placeful chain is found.
Does _not_ acquire from parent configurations.

Usecases:
If the policy config is in the object that request the chain we cannot
take the 'below' policy.
In other case we test the 'below' policy first and, if there's no chain
found, the 'in' policy.

Definition at line 112 of file WorkflowPolicyConfig.py.

00112 
00113     def getPlacefulChainFor(self, portal_type, start_here=False):
00114         """Get the chain for the given portal_type.
00115 
00116         Returns None if no placeful chain is found.
00117         Does _not_ acquire from parent configurations.
00118 
00119         Usecases:
00120         If the policy config is in the object that request the chain we cannot
00121         take the 'below' policy.
00122         In other case we test the 'below' policy first and, if there's no chain
00123         found, the 'in' policy.
00124         """
00125         workflow_tool = getToolByName(self, 'portal_placeful_workflow')
00126         Log(LOG_DEBUG, 'below policy id', self.getPolicyBelowId())
00127         Log(LOG_DEBUG, 'in policy id', self.getPolicyInId())
00128 
00129         chain = None
00130         policy = None
00131         if not start_here:
00132             policy = workflow_tool.getWorkflowPolicyById(self.getPolicyBelowId())
00133             # print "start here:", start_here, "type", portal_type, "policy", policy
00134             if policy != None:
00135                 chain = policy.getChainFor(portal_type)
00136 
00137         policy = workflow_tool.getWorkflowPolicyById(self.getPolicyInId())
00138         # print "start here:", start_here, "type", portal_type, "policy", policy
00139 
00140         Log(LOG_DEBUG, "policy", repr(policy), policy != None)
00141         if chain == None and policy != None:
00142             chain = policy.getChainFor(portal_type)
00143             Log(LOG_DEBUG, "portal_type and chain", portal_type, chain)
00144 
00145         return chain
00146 
00147 InitializeClass( WorkflowPolicyConfig )

Here is the call graph for this function:

Definition at line 96 of file WorkflowPolicyConfig.py.

00096 
00097     def getPolicyBelow(self):
00098         pwt = getToolByName(self, 'portal_placeful_workflow')
00099         wfp_id = self.getPolicyBelowId()
00100         policy_below = pwt.getWorkflowPolicyById(wfp_id)
00101         return policy_below

Here is the call graph for this function:

Definition at line 87 of file WorkflowPolicyConfig.py.

00087 
00088     def getPolicyBelowId(self):
00089         return  self.workflow_policy_below

Here is the caller graph for this function:

Definition at line 90 of file WorkflowPolicyConfig.py.

00090 
00091     def getPolicyIn(self):
00092         pwt = getToolByName(self, 'portal_placeful_workflow')
00093         wfp_id = self.getPolicyInId()
00094         policy_in = pwt.getWorkflowPolicyById(wfp_id)
00095         return policy_in

Here is the call graph for this function:

Definition at line 84 of file WorkflowPolicyConfig.py.

00084 
00085     def getPolicyInId(self):
00086         return self.workflow_policy_in

Here is the caller graph for this function:

def CMFPlacefulWorkflow.WorkflowPolicyConfig.WorkflowPolicyConfig.manage_makeChanges (   self,
  workflow_policy_in,
  workflow_policy_below 
)
Store the policies 

Definition at line 79 of file WorkflowPolicyConfig.py.

00079 
00080     def manage_makeChanges(self, workflow_policy_in, workflow_policy_below):
00081         """ Store the policies """
00082         self.setPolicyIn(workflow_policy_in)
00083         self.setPolicyBelow(workflow_policy_below)

Here is the call graph for this function:

Definition at line 107 of file WorkflowPolicyConfig.py.

00107 
00108     def setPolicyBelow(self, policy):
00109         if not type(policy) == type(''):
00110             raise ValueError, "Policy must be a string"
00111         self.workflow_policy_below = policy

Here is the caller graph for this function:

Definition at line 102 of file WorkflowPolicyConfig.py.

00102 
00103     def setPolicyIn(self, policy):
00104         if not type(policy) == type(''):
00105             raise ValueError, "Policy must be a string"
00106         self.workflow_policy_in = policy

Here is the caller graph for this function:


Member Data Documentation

Definition at line 74 of file WorkflowPolicyConfig.py.

Definition at line 60 of file WorkflowPolicyConfig.py.

Initial value:
PageTemplateFile(path_join('www', 'manage_workflow_policy_config'),
                                   globals(),
                                   __name__='manage_main')

Definition at line 63 of file WorkflowPolicyConfig.py.

Initial value:
((
        {'icon':'', 'label':'Edit', 'action':'manage_main',},
        )+SimpleItem.manage_options
    )

Definition at line 67 of file WorkflowPolicyConfig.py.

string CMFPlacefulWorkflow.WorkflowPolicyConfig.WorkflowPolicyConfig.meta_type = 'Workflow Policy Configuration' [static]

Definition at line 59 of file WorkflowPolicyConfig.py.

Definition at line 61 of file WorkflowPolicyConfig.py.

Definition at line 75 of file WorkflowPolicyConfig.py.

Definition at line 110 of file WorkflowPolicyConfig.py.

Definition at line 105 of file WorkflowPolicyConfig.py.


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