Back to index

plone3  3.1.7
Static Public Attributes | Private Member Functions | Static Private Attributes
CMFCore.exportimport.workflow.WorkflowToolXMLAdapter Class Reference
Inheritance diagram for CMFCore.exportimport.workflow.WorkflowToolXMLAdapter:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.exportimport.workflow.WorkflowToolXMLAdapter:
Collaboration graph
[legend]

List of all members.

Static Public Attributes

string name = 'workflows'

Private Member Functions

def _exportNode
def _importNode
def _extractChains
def _purgeChains
def _initChains
def _getChain

Static Private Attributes

string _LOGGER_ID = 'workflow'

Detailed Description

XML im- and exporter for WorkflowTool.

Definition at line 32 of file workflow.py.


Member Function Documentation

Export the object as a DOM node.

Definition at line 43 of file workflow.py.

00043 
00044     def _exportNode(self):
00045         """Export the object as a DOM node.
00046         """
00047         node = self._getObjectNode('object')
00048         node.appendChild(self._extractProperties())
00049         node.appendChild(self._extractObjects())
00050         node.appendChild(self._extractChains())
00051 
00052         self._logger.info('Workflow tool exported.')
00053         return node

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 68 of file workflow.py.

00068 
00069     def _extractChains(self):
00070         fragment = self._doc.createDocumentFragment()
00071         node = self._doc.createElement('bindings')
00072         child = self._doc.createElement('default')
00073         chain = self.context.getDefaultChain()
00074         for workflow_id in chain:
00075             sub = self._doc.createElement('bound-workflow')
00076             sub.setAttribute('workflow_id', workflow_id)
00077             child.appendChild(sub)
00078         node.appendChild(child)
00079         for type_id, chain in self.context.listChainOverrides():
00080             child = self._doc.createElement('type')
00081             child.setAttribute('type_id', type_id)
00082             for workflow_id in chain:
00083                 sub = self._doc.createElement('bound-workflow')
00084                 sub.setAttribute('workflow_id', workflow_id)
00085                 child.appendChild(sub)
00086             node.appendChild(child)
00087         fragment.appendChild(node)
00088         return fragment

Here is the caller graph for this function:

Definition at line 111 of file workflow.py.

00111 
00112     def _getChain(self, node):
00113         workflow_ids = []
00114         for child in node.childNodes:
00115             if child.nodeName != 'bound-workflow':
00116                 continue
00117             workflow_ids.append(str(child.getAttribute('workflow_id')))
00118         return ','.join(workflow_ids)
00119 

Here is the caller graph for this function:

Import the object from the DOM node.

Definition at line 54 of file workflow.py.

00054 
00055     def _importNode(self, node):
00056         """Import the object from the DOM node.
00057         """
00058         if self.environ.shouldPurge():
00059             self._purgeProperties()
00060             self._purgeObjects()
00061             self._purgeChains()
00062 
00063         self._initProperties(node)
00064         self._initObjects(node)
00065         self._initChains(node)
00066 
00067         self._logger.info('Workflow tool imported.')

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 95 of file workflow.py.

00095 
00096     def _initChains(self, node):
00097         for child in node.childNodes:
00098             if child.nodeName != 'bindings':
00099                 continue
00100             for sub in child.childNodes:
00101                 if sub.nodeName == 'default':
00102                     self.context.setDefaultChain(self._getChain(sub))
00103                 if sub.nodeName == 'type':
00104                     type_id = str(sub.getAttribute('type_id'))
00105                     if sub.hasAttribute('remove'):
00106                         chain = None
00107                     else:
00108                         chain = self._getChain(sub)
00109                     self.context.setChainForPortalTypes((type_id,), chain,
00110                                                         verify=False)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 89 of file workflow.py.

00089 
00090     def _purgeChains(self):
00091         self.context.setDefaultChain('')
00092         for type_id, chain in self.context.listChainOverrides():
00093             self.context.setChainForPortalTypes((type_id,), None,
00094                                                 verify=False)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 39 of file workflow.py.

Definition at line 41 of file workflow.py.


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