]>
git.argeo.org Git - gpl/argeo-slc.git/blob - server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Flow.js
2 * Wrapper for ExecutionFlow server object
4 qx
.Class
.define("org.argeo.slc.ria.execution.Flow", {
6 extend
: qx
.core
.Object
,
10 * Name of this Execution Flow
17 * An optional path describing this flow
24 * Name of the associated spec, to be found in the module
30 * Reference the actual ExecutionSpec object
33 check
: "org.argeo.slc.ria.execution.Spec"
36 * The values to init the ExecutionSpec
43 * Castor representation of the object
46 apply
: "_applyXmlNode"
56 * XPath to the ExecutionSpec name
58 XPATH_EXEC_SPEC_NAME
: "@executionSpec",
62 XPATH_VALUES
: "slc:values",
64 * An optional hierarchical path
69 construct : function(){
75 * Init the object from an XML representation
76 * @param xmlNode {Node} Castor representation of this object
78 _applyXmlNode : function(xmlNode
){
80 name
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_NAME
),
81 path
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_PATH
),
82 executionSpecName
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_EXEC_SPEC_NAME
)
84 var values
= org
.argeo
.ria
.util
.Element
.selectNodes(xmlNode
, this.self(arguments
).XPATH_VALUES
);
86 this.setValues(values
[0]);
90 * Get a given value inside the values map
91 * @param key {String} The key of the value
92 * @param specType {String} Expected type (currently "primitive" and "ref" are supported)
93 * @param specSubType {String} Expected subtype (depends on the type)
94 * @return {String} Value if it is set.
96 getValue: function(key
, specType
, specSubType
){
98 if(specType
== "primitive"){
99 xpath
= 'slc:value[@key="'+key
+'"]/slc:primitive-value[@type="'+specSubType
+'"]';
100 }else if(specType
== "ref"){
101 xpath
= 'slc:value[@key="'+key
+'"]/slc:ref-value/slc:label';
103 return org
.argeo
.ria
.util
.Element
.getSingleNodeText(this.getValues(), xpath
);