Back to index

plone3  3.1.7
Private Member Functions
DCWorkflow.tests.test_exportimport._WorkflowSetup Class Reference
Inheritance diagram for DCWorkflow.tests.test_exportimport._WorkflowSetup:
Inheritance graph
[legend]

List of all members.

Private Member Functions

def _initDCWorkflow
def _initVariables
def _initStates
def _initTransitions
def _initWorklists
def _initScripts

Detailed Description

Definition at line 72 of file test_exportimport.py.


Member Function Documentation

def DCWorkflow.tests.test_exportimport._WorkflowSetup._initDCWorkflow (   self,
  workflow_id 
) [private]

Definition at line 74 of file test_exportimport.py.

00074 
00075     def _initDCWorkflow( self, workflow_id ):
00076 
00077         wf_tool = self.root.site.portal_workflow
00078         wf_tool._setObject( workflow_id, DCWorkflowDefinition( workflow_id ) )
00079 
00080         return wf_tool._getOb( workflow_id )

Here is the caller graph for this function:

def DCWorkflow.tests.test_exportimport._WorkflowSetup._initScripts (   self,
  dcworkflow 
) [private]

Definition at line 175 of file test_exportimport.py.

00175 
00176     def _initScripts( self, dcworkflow ):
00177 
00178         for k, v in _WF_SCRIPTS.items():
00179 
00180             if v[ 0 ] == PythonScript.meta_type:
00181                 script = PythonScript( k )
00182                 script.write( v[ 1 ] )
00183 
00184             elif v[ 0 ] == ExternalMethod.meta_type:
00185                 script = ExternalMethod(k,'', v[3], v[4])
00186 
00187             else:
00188                 raise ValueError, 'Unknown script type: %s' % v[ 0 ]
00189 
00190             dcworkflow.scripts._setObject( k, script )
00191 

Here is the caller graph for this function:

def DCWorkflow.tests.test_exportimport._WorkflowSetup._initStates (   self,
  dcworkflow 
) [private]

Definition at line 100 of file test_exportimport.py.

00100 
00101     def _initStates( self, dcworkflow ):
00102 
00103         dcworkflow.groups = _WF_GROUPS
00104 
00105         for k, v in _WF_STATES.items():
00106 
00107             dcworkflow.states.addState( k )
00108             state = dcworkflow.states._getOb( k )
00109 
00110             state.setProperties( title=v[ 0 ]
00111                                , description=v[ 1 ]
00112                                , transitions=v[ 2 ]
00113                                )
00114             if not v[ 3 ]:
00115                 state.permission_roles = None
00116 
00117             for permission, roles in v[ 3 ].items():
00118                 state.setPermission( permission
00119                                    , not isinstance( roles, tuple )
00120                                    , roles
00121                                    )
00122             faux_request = {}
00123 
00124             for group_id, roles in v[ 4 ]:
00125                 for role in roles:
00126                     faux_request[ '%s|%s' % ( group_id, role ) ] = True
00127 
00128             state.setGroups( REQUEST=faux_request )
00129 
00130             for k, v in v[ 5 ].items():
00131                 state.addVariable( k, v )

Here is the caller graph for this function:

def DCWorkflow.tests.test_exportimport._WorkflowSetup._initTransitions (   self,
  dcworkflow 
) [private]

Definition at line 132 of file test_exportimport.py.

00132 
00133     def _initTransitions( self, dcworkflow ):
00134 
00135         for k, v in _WF_TRANSITIONS.items():
00136 
00137             dcworkflow.transitions.addTransition( k )
00138             transition = dcworkflow.transitions._getOb( k )
00139 
00140             transition.setProperties( title=v[ 0 ]
00141                                     , description=v[ 1 ]
00142                                     , new_state_id=v[ 2 ]
00143                                     , trigger_type=v[ 3 ]
00144                                     , script_name=v[ 4 ]
00145                                     , after_script_name=v[ 5 ]
00146                                     , actbox_name=v[ 6 ]
00147                                     , actbox_url=v[ 7 ]
00148                                     , actbox_category=v[ 8 ]
00149                                     , props=self._genGuardProps( *v[ -4: ] )
00150                                     )
00151 
00152             for k, v in v[ 9 ].items():
00153                 transition.addVariable( k, v )

Here is the call graph for this function:

Here is the caller graph for this function:

def DCWorkflow.tests.test_exportimport._WorkflowSetup._initVariables (   self,
  dcworkflow 
) [private]

Definition at line 81 of file test_exportimport.py.

00081 
00082     def _initVariables( self, dcworkflow ):
00083 
00084         for id, args in _WF_VARIABLES.items():
00085 
00086             dcworkflow.variables.addVariable( id )
00087             variable = dcworkflow.variables._getOb( id )
00088 
00089             ( descr, def_val, def_exp, for_cat, for_stat, upd_alw
00090             ) = args[ :-4 ]
00091 
00092             variable.setProperties( description=args[0]
00093                                   , default_value=args[1]
00094                                   , default_expr=args[2]
00095                                   , for_catalog=args[3]
00096                                   , for_status=args[4]
00097                                   , update_always=args[5]
00098                                   , props=self._genGuardProps( *args[ -4: ] )
00099                                   )

Here is the call graph for this function:

Here is the caller graph for this function:

def DCWorkflow.tests.test_exportimport._WorkflowSetup._initWorklists (   self,
  dcworkflow 
) [private]

Definition at line 154 of file test_exportimport.py.

00154 
00155     def _initWorklists( self, dcworkflow ):
00156 
00157         for k, v in _WF_WORKLISTS.items():
00158 
00159             dcworkflow.worklists.addWorklist( k )
00160             worklist = dcworkflow.worklists._getOb( k )
00161 
00162             worklist.title = v[ 0 ]
00163 
00164             props=self._genGuardProps( *v[ -4: ] )
00165 
00166             for var_id, matches in v[ 2 ].items():
00167                 props[ 'var_match_%s' % var_id ] = ';'.join( matches )
00168 
00169             worklist.setProperties( description=v[ 1 ]
00170                                   , actbox_name=v[ 3 ]
00171                                   , actbox_url=v[ 4 ]
00172                                   , actbox_category=v[ 5 ]
00173                                   , props=props
00174                                   )

Here is the call graph for this function:

Here is the caller graph for this function:


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