Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions
DCWorkflow.browser.workflow.DCWorkflowDefinitionAddView Class Reference
Inheritance diagram for DCWorkflow.browser.workflow.DCWorkflowDefinitionAddView:
Inheritance graph
[legend]
Collaboration diagram for DCWorkflow.browser.workflow.DCWorkflowDefinitionAddView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getProfileInfos

Static Public Attributes

 klass = DCWorkflowDefinition
string description = u'Add a web-configurable workflow.'

Private Member Functions

def _initSettings

Detailed Description

Add view for DCWorkflowDefinition.

Definition at line 30 of file workflow.py.


Member Function Documentation

def DCWorkflow.browser.workflow.DCWorkflowDefinitionAddView._initSettings (   self,
  obj,
  profile_id,
  obj_path 
) [private]

Definition at line 63 of file workflow.py.

00063 
00064     def _initSettings(self, obj, profile_id, obj_path):
00065         stool = queryUtility(ISetupTool)
00066         if stool is None:
00067             return
00068 
00069         context = stool._getImportContext(profile_id)
00070         file_ids = context.listDirectory('workflows')
00071         for file_id in file_ids or ():
00072             filename = 'workflows/%s/definition.xml' % file_id
00073             body = context.readDataFile(filename)
00074             if body is None:
00075                 continue
00076 
00077             root = parseString(body).documentElement
00078             if not root.getAttribute('workflow_id') == obj_path[0]:
00079                 continue
00080 
00081             importer = queryMultiAdapter((obj, context), IBody)
00082             if importer is None:
00083                 continue
00084 
00085             importer.body = body
00086             return

Here is the caller graph for this function:

Definition at line 39 of file workflow.py.

00039 
00040     def getProfileInfos(self):
00041         profiles = []
00042         stool = queryUtility(ISetupTool)
00043         if stool:
00044             for info in stool.listContextInfos():
00045                 obj_ids = []
00046                 context = stool._getImportContext(info['id'])
00047                 file_ids = context.listDirectory('workflows')
00048                 for file_id in file_ids or ():
00049                     filename = 'workflows/%s/definition.xml' % file_id
00050                     body = context.readDataFile(filename)
00051                     if body is None:
00052                         continue
00053                     root = parseString(body).documentElement
00054                     obj_id = root.getAttribute('workflow_id')
00055                     obj_ids.append(obj_id)
00056                 if not obj_ids:
00057                     continue
00058                 obj_ids.sort()
00059                 profiles.append({'id': info['id'],
00060                                  'title': info['title'],
00061                                  'obj_ids': tuple(obj_ids)})
00062         return tuple(profiles)


Member Data Documentation

string DCWorkflow.browser.workflow.DCWorkflowDefinitionAddView.description = u'Add a web-configurable workflow.' [static]

Definition at line 37 of file workflow.py.

Definition at line 35 of file workflow.py.


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