]>
git.argeo.org Git - gpl/argeo-slc.git/blob - server/org.argeo.slc.ria/src/main/webapp/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
42 * Castor representation of the object
45 apply
: "_applyXmlNode"
55 * XPath to the ExecutionSpec name
57 XPATH_EXEC_SPEC_NAME
: "@executionSpec",
61 XPATH_VALUES
: "slc:values",
63 * An optional hierarchical path
68 construct : function(){
74 * Init the object from an XML representation
75 * @param xmlNode {Node} Castor representation of this object
77 _applyXmlNode : function(xmlNode
){
79 name
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_NAME
),
80 path
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_PATH
),
81 executionSpecName
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_EXEC_SPEC_NAME
)
83 var values
= org
.argeo
.ria
.util
.Element
.selectNodes(xmlNode
, this.self(arguments
).XPATH_VALUES
);
84 this.setValues(values
[0]);
87 * Get a given value inside the values map
88 * @param key {String} The key of the value
89 * @param specType {String} Expected type (currently "primitive" and "ref" are supported)
90 * @param specSubType {String} Expected subtype (depends on the type)
91 * @return {String} Value if it is set.
93 getValue: function(key
, specType
, specSubType
){
95 if(specType
== "primitive"){
96 xpath
= 'slc:value[@key="'+key
+'"]/slc:primitive-value[@type="'+specSubType
+'"]';
97 }else if(specType
== "ref"){
98 xpath
= 'slc:value[@key="'+key
+'"]/slc:ref-value/slc:label';
100 return org
.argeo
.ria
.util
.Element
.getSingleNodeText(this.getValues(), xpath
);