]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/execution/Value.js
git-svn-id: https://svn.argeo.org/slc/trunk@2380 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-lib / slc / class / org / argeo / slc / ria / execution / Value.js
index 8895df8b99eeee7bb07f267b4c9e145c7d683b09..b5944a019ab09ac17b5d7309ecaa5ebdf1c9358d 100644 (file)
@@ -80,8 +80,8 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", {
                                if(child.nodeName == "slc:primitive-spec-attribute"){\r
                                        this.setSpecType("primitive");\r
                                        this.setSpecSubType(org.argeo.ria.util.Element.getSingleNodeText(child, "@type"));\r
-                                       if(org.argeo.ria.util.Element.getSingleNodeText(child, "slc:value")){\r
-                                               this.setValue(org.argeo.ria.util.Element.getSingleNodeText(child, "slc:value"));\r
+                                       if(org.argeo.ria.util.Element.getSingleNodeText(child, ".")){\r
+                                               this.setValue(org.argeo.ria.util.Element.getSingleNodeText(child, "."));\r
                                        }\r
                                }else if(child.nodeName == "slc:ref-spec-attribute"){\r
                                        this.setSpecType("ref");\r
@@ -94,31 +94,19 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", {
                                });                             \r
                        }\r
                },\r
-               \r
-               /**\r
-                * Apply the value from the node\r
-                * @param xmlNode {Node} Castor representation of this object\r
-                */\r
-               _applyXmlValue : function(xmlNode){\r
-                       var xpath;\r
-                       if(this.getSpecType() == "primitive"){\r
-                               xpath = "slc:primitive-value/slc:value";\r
-                       }else if(this.getSpecType() == "ref"){\r
-                               xpath = "slc:ref-value/slc:label";\r
-                       }\r
-                       this.setValue(org.argeo.ria.util.Element.getSingleNodeText(xmlNode, xpath));\r
-               },\r
-               \r
+                               \r
                /**\r
                 * Create an XML Representation of this value\r
                 * @return {String} The XML String\r
                 */\r
                toAttributeXml : function(){\r
-                       var valueTag = '<slc:value>'+this.getValue()+'</slc:value>';\r
+                       var valueTag = '';\r
                        var specAttribute = '';\r
                        if(this.getSpecType() == "primitive"){\r
+                               valueTag =  (this.getValue()?this.getValue():'');\r
                                specAttribute = '<slc:primitive-spec-attribute isParameter="'+(this.getParameter()?"true":"false")+'" isFrozen="'+(this.getFrozen()?"true":"false")+'" isHidden="'+(this.getHidden()?"true":"false")+'" type="'+this.getSpecSubType()+'">'+valueTag+'</slc:primitive-spec-attribute>';\r
                        }else if(this.getSpecType() == "ref"){\r
+                               valueTag = (this.getValue()?'<slc:label>'+this.getValue()+'</slc:label>':'');\r
                                specAttribute = '<slc:ref-spec-attribute isParameter="'+(this.getParameter()?"true":"false")+'" isFrozen="'+(this.getFrozen()?"true":"false")+'" isHidden="'+(this.getHidden()?"true":"false")+'" targetClassName="'+this.getSpecSubType()+'">'+valueTag+'</slc:ref-spec-attribute>';\r
                        }\r
                        return '<slc:value key="'+this.getKey()+'">'+specAttribute+'</slc:value>';\r
@@ -128,7 +116,7 @@ qx.Class.define("org.argeo.slc.ria.execution.Value", {
                        var valueTag = '';\r
                        var specAttribute = '';\r
                        if(this.getSpecType() == "primitive"){\r
-                               valueTag = '<slc:value>'+this.getValue()+'</slc:value>';\r
+                               valueTag =  this.getValue();\r
                                specAttribute = '<slc:primitive-value type="'+this.getSpecSubType()+'">'+valueTag+'</slc:primitive-value>';\r
                        }else if(this.getSpecType() == "ref"){\r
                                valueTag = '<slc:label>'+this.getValue()+'</slc:label>';\r