]>
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/Spec.js
2 * Wrapper for ExecutionSpec server object
4 qx
.Class
.define("org.argeo.slc.ria.execution.Spec", {
6 extend
: qx
.core
.Object
,
10 * Unique name of this spec
23 * Castor representation of this object
26 apply
: "_applyXmlNode"
32 XPATH_VALUES
: "slc:values/slc:value"
35 construct : function(){
42 * Init the object from an XML representation
43 * @param xmlNode {Node} Castor representation of this object
45 _applyXmlNode : function(xmlNode
){
47 this.setName(org
.argeo
.ria
.util
.Element
.getSingleNodeText(xmlNode
, this.self(arguments
).XPATH_NAME
));
48 var values
= org
.argeo
.ria
.util
.Element
.selectNodes(xmlNode
, this.self(arguments
).XPATH_VALUES
);
49 var parsedValues
= {};
50 for(var i
=0;i
<values
.length
;i
++){
51 //var valueNode = values[i];
52 var value
= new org
.argeo
.slc
.ria
.execution
.Value();
53 value
.setXmlSpecNode(values
[i
]);
54 parsedValues
[value
.getKey()] = value
;
56 this.setValues(parsedValues
);
59 * XML Representation of this object.
60 * @return {String} An XML String
64 var values
= this.getValues();
65 for(var key
in values
){
66 valuesXml
+= values
[key
].toAttributeXml();
68 return '<slc:default-execution-spec name="'+this.getName()+'"><slc:values>'+valuesXml
+'</slc:values></slc:default-execution-spec>';