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=b5944a019ab09ac17b5d7309ecaa5ebdf1c9358d;hb=ec2898121c88966ac4d49d549d55107f26ccbb4b;hp=29556d88604e3e284d87c8329bab45c6c1ff5abb;hpb=e3ae72208feba2b542520878574d49ac16917573;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 29556d886..b5944a019 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 @@ -80,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"); @@ -94,34 +94,35 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", { }); } }, - - /** - * Apply the value from the node - * @param xmlNode {Node} Castor representation of this object - */ - _applyXmlValue : function(xmlNode){ - var xpath; - if(this.getSpecType() == "primitive"){ - xpath = "slc:primitive-value/slc:value"; - }else if(this.getSpecType() == "ref"){ - xpath = "slc:ref-value/slc:label"; - } - this.setValue(org.argeo.ria.util.Element.getSingleNodeText(xmlNode, xpath)); - }, - + /** * Create an XML Representation of this value * @return {String} The XML String */ - toXml : function(){ - var valueTag = ''+this.getValue()+''; + toAttributeXml : function(){ + var valueTag = ''; var specAttribute = ''; if(this.getSpecType() == "primitive"){ + valueTag = (this.getValue()?this.getValue():''); specAttribute = ''+valueTag+''; }else if(this.getSpecType() == "ref"){ + valueTag = (this.getValue()?''+this.getValue()+'':''); specAttribute = ''+valueTag+''; } return ''+specAttribute+''; + }, + + toValueXml : function(){ + var valueTag = ''; + var specAttribute = ''; + if(this.getSpecType() == "primitive"){ + valueTag = this.getValue(); + specAttribute = ''+valueTag+''; + }else if(this.getSpecType() == "ref"){ + valueTag = ''+this.getValue()+''; + specAttribute = ''+valueTag+''; + } + return ''+specAttribute+''; } }