]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcApi.js
Do not set wrong content-type
[gpl/argeo-slc.git] / server / org.argeo.slc.ria / src / argeo-ria-lib / slc / class / org / argeo / slc / ria / SlcApi.js
index f59edc9b6673eba84207ce2d09a18852db6003f8..afb6f5e92b2635cc204ca1e0da23c582ff65d556 100644 (file)
@@ -21,6 +21,7 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
        LIST_RESULTS_SERVICE : "listResultAttributes.service",\r
        GET_RESULT_SERVICE : "getResult.service",\r
        LIST_SLCEXEC_SERVICE : "listSlcExecutions.service",\r
+       NEW_SLCEXEC_SERVICE : "newSlcExecution.service",\r
        \r
        LIST_AGENTS_SERVICE : "listAgents.service",\r
        LIST_MODULES_SERVICE : "listModulesDescriptors.service",\r
@@ -196,6 +197,27 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
                );\r
        },\r
        \r
+\r
+       /**\r
+        * New SlcExecution\r
+        * @param agentId {String} Agent id target\r
+        * @param xmlDescription {String} XML of the Slc Execution\r
+        * @param fireReloadEventType {String} Event type to trigger (optionnal)\r
+        * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update \r
+        * @return {qx.io.remote.Request}\r
+        */\r
+       getNewSlcExecutionService:function(agentId, xmlDescription, fireReloadEventType, iLoadStatusables){\r
+               var req = org.argeo.slc.ria.SlcApi.getServiceRequest(\r
+                       org.argeo.slc.ria.SlcApi.NEW_SLCEXEC_SERVICE + "?slc_agentId="+agentId,\r
+                       fireReloadEventType,\r
+                       iLoadStatusables\r
+               );\r
+               req.setMethod("POST");\r
+               //req.setRequestHeader("Content-Type", "text/xml");\r
+               req.setData("body=" + encodeURIComponent(xmlDescription));\r
+               return req;\r
+       },\r
+       \r
        \r
        /**\r
         * List currently available agents queues.\r
@@ -217,12 +239,14 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
         * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update \r
         * @return {qx.io.remote.Request}\r
         */\r
-       getListModulesService : function(fireReloadEventType, iLoadStatusables){\r
-               return org.argeo.slc.ria.SlcApi.getServiceRequest(\r
+       getListModulesService : function(agentId, fireReloadEventType, iLoadStatusables){\r
+               var req = org.argeo.slc.ria.SlcApi.getServiceRequest(\r
                        org.argeo.slc.ria.SlcApi.LIST_MODULES_SERVICE,\r
                        fireReloadEventType,\r
                        iLoadStatusables\r
                );\r
+               req.setParameter("agentId", agentId);\r
+               return req;\r
        },\r
        \r
        /**\r
@@ -233,12 +257,13 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
         * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update \r
         * @return {qx.io.remote.Request}\r
         */\r
-       getLoadExecutionDescriptorService : function(moduleName, moduleVersion, fireReloadEventType, iLoadStatusables){\r
+       getLoadExecutionDescriptorService : function(agentId,moduleName, moduleVersion, fireReloadEventType, iLoadStatusables){\r
                var req = org.argeo.slc.ria.SlcApi.getServiceRequest(\r
                        org.argeo.slc.ria.SlcApi.GET_EXECUTION_DESC_SERVICE,\r
                        fireReloadEventType,\r
                        iLoadStatusables\r
                ); \r
+               req.setParameter("agentId", agentId);\r
                req.setParameter("moduleName", moduleName);\r
                req.setParameter("version", moduleVersion);\r
                return req;\r