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%2FValue.js;h=d31cf6b3af4c071b1952b1120a2893c9bf985c13;hb=43a20cbd46654d84ab1610ddb1ac6bbb058fe0c3;hp=6ce99a06cc65ab19dcb870bdd413eb6f26d61afc;hpb=fc482f660799a31c62a29b9333c6f3c458dde8d2;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/Value.js b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Value.js index 6ce99a06c..d31cf6b3a 100644 --- a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Value.js +++ b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Value.js @@ -13,22 +13,40 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", { check : "String", init : "" }, + /** + * The type of this value, for the moment "primitive" and "ref" are supported + */ specType : { check : "String", init : "" }, + /** + * Subtype, depending on the "type". + */ specSubType : { check : "String" }, + /** + * Whether it is a parameter or not + */ parameter : { check : "Boolean" }, + /** + * Whether it is frozen on the server, i.e. disabled in the form + */ frozen : { check : "Boolean" }, + /** + * Should not be editable nor seeable, thus hidden + */ hidden : { check : "Boolean" }, + /** + * The real value + */ value : { nullable : true }, @@ -62,8 +80,8 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", { if(child.nodeName == "slc:primitive-spec-attribute"){ this.setSpecType("primitive"); this.setSpecSubType(org.argeo.ria.util.Element.getSingleNodeText(child, "@type")); - if(org.argeo.ria.util.Element.getSingleNodeText(child, "slc:value")){ - this.setValue(org.argeo.ria.util.Element.getSingleNodeText(child, "slc:value")); + if(org.argeo.ria.util.Element.getSingleNodeText(child, ".")){ + this.setValue(org.argeo.ria.util.Element.getSingleNodeText(child, ".")); } }else if(child.nodeName == "slc:ref-spec-attribute"){ this.setSpecType("ref"); @@ -76,26 +94,35 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", { }); } }, - - _applyXmlValue : function(xmlNode){ - var xpath; + + /** + * Create an XML Representation of this value + * @return {String} The XML String + */ + toAttributeXml : function(){ + var valueTag = ''; + var specAttribute = ''; if(this.getSpecType() == "primitive"){ - xpath = "slc:primitive-value/slc:value"; + valueTag = this.getValue(); + specAttribute = ''+valueTag+''; }else if(this.getSpecType() == "ref"){ - xpath = "slc:ref-value/slc:label"; + valueTag = ''+this.getValue()+''; + specAttribute = ''+valueTag+''; } - this.setValue(org.argeo.ria.util.Element.getSingleNodeText(xmlNode, xpath)); + return ''+specAttribute+''; }, - toXml : function(){ - var valueTag = ''+this.getValue()+''; + toValueXml : function(){ + var valueTag = ''; var specAttribute = ''; if(this.getSpecType() == "primitive"){ - specAttribute = ''+valueTag+''; + valueTag = this.getValue(); + specAttribute = ''+valueTag+''; }else if(this.getSpecType() == "ref"){ - specAttribute = ''+valueTag+''; + valueTag = ''+this.getValue()+''; + specAttribute = ''+valueTag+''; } - return ''+specAttribute+''; + return ''+specAttribute+''; } }