[CMF-checkins] CVS: CMF/CMFSetup - workflow.py:1.11
Tres Seaver
tseaver at zope.com
Tue Jun 8 21:09:45 EDT 2004
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv31139
Modified Files:
workflow.py
Log Message:
- workflow.py:
o Add parsing for worklist nodes.
- xml/wtcWorkflowExport.xml:
o Ensure that we caputure worklist titles.
=== CMF/CMFSetup/workflow.py 1.10 => 1.11 ===
--- CMF/CMFSetup/workflow.py:1.10 Tue Jun 8 20:52:59 2004
+++ CMF/CMFSetup/workflow.py Tue Jun 8 21:09:14 2004
@@ -228,7 +228,7 @@
states = _extractStateNodes( root )
transitions = _extractTransitionNodes( root )
variables = _extractVariableNodes( root )
- worklists = []
+ worklists = _extractWorklistNodes( root )
permissions = []
scripts = []
@@ -789,6 +789,25 @@
return result
+def _extractWorklistNodes( root, encoding=None ):
+
+ result = []
+
+ for w_node in root.getElementsByTagName( 'worklist' ):
+
+ info = { 'worklist_id' : _getNodeAttribute( w_node, 'worklist_id'
+ , encoding )
+ , 'title' : _getNodeAttribute( w_node, 'title' , encoding )
+ , 'description' : _coalesceTextNodeChildren( w_node, encoding )
+ , 'match' : _extractMatchNode( w_node, encoding )
+ , 'action' : _extractActionNode( w_node, encoding )
+ , 'guard' : _extractGuardNode( w_node, encoding )
+ }
+
+ result.append( info )
+
+ return result
+
def _extractActionNode( parent, encoding=None ):
nodes = parent.getElementsByTagName( 'action' )
@@ -858,3 +877,17 @@
return { 'value' : value_text
, 'expression' : expr_text
}
+
+def _extractMatchNode( parent, encoding=None ):
+
+ nodes = parent.getElementsByTagName( 'match' )
+
+ result = {}
+
+ for node in nodes:
+
+ name = _getNodeAttribute( node, 'name', encoding )
+ values = _getNodeAttribute( node, 'values', encoding )
+ result[ name ] = values.split()
+
+ return result
More information about the CMF-checkins
mailing list