]> 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/BatchEntrySpec.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 / BatchEntrySpec.js
index dcf22c82db5f16c61849649a7552b742ce3c18ca..6269b49c064d5ac1411ec8071e8b7ef9dd79288d 100644 (file)
@@ -5,11 +5,25 @@ qx.Class.define("org.argeo.slc.ria.execution.BatchEntrySpec", {
        extend : org.argeo.slc.ria.execution.Spec,\r
        \r
        properties : {\r
+               /**\r
+                * Reference module\r
+                */\r
                module :{},\r
+               /**\r
+                * Reference flow\r
+                */\r
                flow : {},\r
+               /**\r
+                * Original Spec (values shall stay untouched).\r
+                */\r
                originalSpec : {}               \r
        },\r
        \r
+       /**\r
+        * Instance of BatchEntrySpec\r
+        * @param module {org.argeo.slc.ria.execution.Module} Reference module\r
+        * @param flow {org.argeo.slc.ria.execution.Flow} Reference flow\r
+        */\r
        construct : function(module, flow){\r
                this.base(arguments);\r
                this.setModule(module);\r
@@ -20,19 +34,32 @@ qx.Class.define("org.argeo.slc.ria.execution.BatchEntrySpec", {
        },\r
        \r
        members :  {\r
-               \r
+               /**\r
+                * Create a label to display in the batch list.\r
+                * @return {String} The label\r
+                */\r
                getLabel : function(){\r
                        var label = this.getModule().getName();\r
                        label += "/" + this.getModule().getVersion();\r
                        label += "/" + this.getFlow().getName();\r
                        return label;\r
                },\r
-               \r
-               /*\r
-               toXml : function(){\r
-                       return this.getLabel() + "\n";\r
+                               \r
+               toXml : function(){                     \r
+                       var valuesXml = '';\r
+                       var values = this.getValues();\r
+                       for(var key in values){\r
+                               valuesXml += values[key].toValueXml();\r
+                       }\r
+                       var execFlowDescXML = '<slc:execution-flow-descriptor name="'+this.getFlow().getName()+'" executionSpec="'+this.getName()+'"><slc:values>'+valuesXml+'</slc:values></slc:execution-flow-descriptor>';\r
+                       \r
+                       var execSpecDescXML = this.getOriginalSpec().toXml();\r
+                       \r
+                       var moduleData = '<slc:module-name>'+this.getModule().getName()+'</slc:module-name><slc:module-version>'+this.getModule().getVersion()+'</slc:module-version>';\r
+                       \r
+                       return '<slc:realized-flow>'+moduleData + execFlowDescXML + execSpecDescXML +'</slc:realized-flow>';\r
+                       \r
                },\r
-               */\r
                \r
                /**\r
                 * Fetch the Spec Values with the Flow Values to make the current instance value\r
@@ -54,7 +81,7 @@ qx.Class.define("org.argeo.slc.ria.execution.BatchEntrySpec", {
                                instanceValues[key] = instValue;\r
                        }\r
                        this.setValues(instanceValues);\r
-                       this.debug(instanceValues);\r
+                       //this.debug(instanceValues);\r
                }\r
        }\r
 });
\ No newline at end of file