]> 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
Fix #209 (do not complain if empty value when frozen or hidden), and add an option...
[gpl/argeo-slc.git] / server / org.argeo.slc.ria / src / argeo-ria-lib / slc / class / org / argeo / slc / ria / SlcApi.js
index f59edc9b6673eba84207ce2d09a18852db6003f8..d69830da20e692960bdd1b513f33be06aca711d5 100644 (file)
@@ -20,7 +20,9 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
        COPY_COLLECTION_TO_COLL_SERVICE : "copyCollectionToCollection.service",\r
        LIST_RESULTS_SERVICE : "listResultAttributes.service",\r
        GET_RESULT_SERVICE : "getResult.service",\r
+       GET_ATTACHEMENT_SERVICE : "getAttachment.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
@@ -182,6 +184,11 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
                return request;\r
        },\r
 \r
+       buildGetAttachmentUrl : function(attachmentId, contentType, name){\r
+               return org.argeo.slc.ria.SlcApi.DEFAULT_CONTEXT + "/" + org.argeo.slc.ria.SlcApi.GET_ATTACHEMENT_SERVICE\r
+                       + "?uuid=" + attachmentId + "&contentType=" + contentType + "&name=" + name;\r
+       },\r
+       \r
        /**\r
         * List currently registered SlcExecutions.\r
         * @param fireReloadEventType {String} Event type to trigger (optionnal)\r
@@ -196,6 +203,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 +245,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 +263,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