]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/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 * Name of the associated spec, to be found in the module
23 * Reference the actual ExecutionSpec object
26 check
: "org.argeo.slc.ria.execution.Spec"
29 * The values to init the ExecutionSpec
35 * Castor representation of the object
38 apply
: "_applyXmlNode"
48 * XPath to the ExecutionSpec name
50 XPATH_EXEC_SPEC_NAME
: "@executionSpec",
54 XPATH_VALUES
: "slc:values"
57 construct : function(){
63 * Init the object from an XML representation
64 * @param xmlNode {Node} Castor representation of this object
66 _applyXmlNode : function(xmlNode
){
68 name
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_NAME
),
69 executionSpecName
: org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_EXEC_SPEC_NAME
)
71 var values
= org
.argeo
.ria
.util
.Element
.selectNodes(xmlNode
, this.self(arguments
).XPATH_VALUES
);
72 this.setValues(values
[0]);
75 * Get a given value inside the values map
76 * @param key {String} The key of the value
77 * @param specType {String} Expected type (currently "primitive" and "ref" are supported)
78 * @param specSubType {String} Expected subtype (depends on the type)
79 * @return {String} Value if it is set.
81 getValue: function(key
, specType
, specSubType
){
83 if(specType
== "primitive"){
84 xpath
= 'slc:value[@key="'+key
+'"]/slc:primitive-value[@type="'+specSubType
+'"]';
85 }else if(specType
== "ref"){
86 xpath
= 'slc:value[@key="'+key
+'"]/slc:ref-value/slc:label';
88 return org
.argeo
.ria
.util
.Element
.getSingleNodeText(this.getValues(), xpath
);