X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.webapp%2Fsrc%2Fmain%2Fwebapp%2Fargeo-ria-lib%2Fslc%2Fclass%2Forg%2Fargeo%2Fslc%2Fria%2Fexecution%2FFlow.js;h=fae03fe39e6fb74587a972d8df3ce1b089772a32;hb=ec2898121c88966ac4d49d549d55107f26ccbb4b;hp=4728fe9552d80bc492ccbc4196fc2ae4fe3dd83a;hpb=b07b5d7a34c6954b702a5d9ce8b8926b2a6a1191;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Flow.js b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Flow.js index 4728fe955..fae03fe39 100644 --- a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Flow.js +++ b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Flow.js @@ -1,7 +1,7 @@ /** * Wrapper for ExecutionFlow server object */ -qx.Class.define("org.argeo.slc.ria.module.ExecutionFlow", { +qx.Class.define("org.argeo.slc.ria.execution.Flow", { extend : qx.core.Object, @@ -23,7 +23,13 @@ qx.Class.define("org.argeo.slc.ria.module.ExecutionFlow", { * Reference the actual ExecutionSpec object */ executionSpec : { - check : "org.argeo.slc.ria.module.ExecutionSpec" + check : "org.argeo.slc.ria.execution.Spec" + }, + /** + * The values to init the ExecutionSpec + */ + values : { + check : "Node" }, /** * Castor representation of the object @@ -34,12 +40,23 @@ qx.Class.define("org.argeo.slc.ria.module.ExecutionFlow", { }, statics : { + /** + * Xpath to the name + */ XPATH_NAME : "@name", + /** + * XPath to the ExecutionSpec name + */ XPATH_EXEC_SPEC_NAME : "@executionSpec", + /** + * XPath to the values + */ XPATH_VALUES : "slc:values" }, - construct : function(){}, + construct : function(){ + this.base(arguments); + }, members : { /** @@ -51,7 +68,25 @@ qx.Class.define("org.argeo.slc.ria.module.ExecutionFlow", { name : org.argeo.ria.util.Element.getSingleNodeText(xmlNode, this.self(arguments).XPATH_NAME), executionSpecName : org.argeo.ria.util.Element.getSingleNodeText(xmlNode, this.self(arguments).XPATH_EXEC_SPEC_NAME) }); - } + var values = org.argeo.ria.util.Element.selectNodes(xmlNode, this.self(arguments).XPATH_VALUES); + this.setValues(values[0]); + }, + /** + * Get a given value inside the values map + * @param key {String} The key of the value + * @param specType {String} Expected type (currently "primitive" and "ref" are supported) + * @param specSubType {String} Expected subtype (depends on the type) + * @return {String} Value if it is set. + */ + getValue: function(key, specType, specSubType){ + var xpath; + if(specType == "primitive"){ + xpath = 'slc:value[@key="'+key+'"]/slc:primitive-value[@type="'+specSubType+'"]'; + }else if(specType == "ref"){ + xpath = 'slc:value[@key="'+key+'"]/slc:ref-value/slc:label'; + } + return org.argeo.ria.util.Element.getSingleNodeText(this.getValues(), xpath); + } } }); \ No newline at end of file