]> 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/SlcApi.js
Splitted the LauncherApplet into two different applets. The first one is a generic...
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-lib / slc / class / org / argeo / slc / ria / SlcApi.js
index dd3632594d06764bdf2e59347af0026ec40c30cb..1bab2a46e30b40e0674df66d0bb02db45c2651cb 100644 (file)
@@ -1,3 +1,12 @@
+/**\r
+ * SLC API Client implementation :\r
+ * This class encapsulate the various SLC services available. It just creates the Request object\r
+ * and return them, it does not execute them. \r
+ * Available services are : \r
+ * + loadResult / removeResult / addResult\r
+ * + listCollection / listResults\r
+ * When using it, be sure the static constant DEFAULT_CONTEXT is pointing to the right URL.\r
+ */\r
 qx.Class.define("org.argeo.slc.ria.SlcApi",\r
 {\r
   extend : qx.core.Object,\r
@@ -10,6 +19,10 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
        LIST_COLLECTIONS_SERVICE : "listCollectionRefs.service",\r
        LIST_RESULTS_SERVICE : "listResultAttributes.service",\r
        GET_RESULT_SERVICE : "getResult.service",\r
+       LIST_SLCEXEC_SERVICE : "listSlcExecutions.service",\r
+       \r
+       LIST_AGENTS_SERVICE : "listAgents.service",     \r
+       AMQ_SERVICE : "amq",\r
        \r
        /**\r
         * Standard Request getter\r
@@ -115,6 +128,56 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
                );\r
                request.setParameter("uuid", resultId);\r
                return request;\r
+       },\r
+\r
+       /**\r
+        * List currently registered SlcExecutions.\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
+       getListSlcExecutionsService:function(fireReloadEventType, iLoadStatusables){\r
+               return org.argeo.slc.ria.SlcApi.getServiceRequest(\r
+                       org.argeo.slc.ria.SlcApi.LIST_SLCEXEC_SERVICE,\r
+                       fireReloadEventType,\r
+                       iLoadStatusables\r
+               );\r
+       },\r
+       \r
+       \r
+       /**\r
+        * List currently available agents queues.\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
+       getListAgentsService:function(fireReloadEventType, iLoadStatusables){\r
+               return org.argeo.slc.ria.SlcApi.getServiceRequest(\r
+                       org.argeo.slc.ria.SlcApi.LIST_AGENTS_SERVICE,\r
+                       fireReloadEventType,\r
+                       iLoadStatusables\r
+               );\r
+       },\r
+       \r
+       /**\r
+        * Send a JMS message to the AMQ_CONTEXT\r
+        * @param destination {String} The destination queue, in the form "topic://destination" \r
+        * @param message {org.argeo.slc.ria.SlcExecutionMessage} The message object\r
+        * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update\r
+        */\r
+       getSendAmqMessageRequest : function(destination, message, iLoadStatusables){\r
+               var serviceManager = org.argeo.ria.remote.RequestManager.getInstance();\r
+               var request = serviceManager.getRequest(\r
+                       org.argeo.slc.ria.SlcApi.DEFAULT_CONTEXT+"/"+org.argeo.slc.ria.SlcApi.AMQ_SERVICE,\r
+                       "POST",\r
+                       "text/plain",\r
+                       null,\r
+                       iLoadStatusables\r
+               );\r
+               request.setParameter("destination", destination);\r
+               request.setParameter("message", message.toXml());\r
+               request.setParameter("type", "send");\r
+               return request;\r
        }\r
        \r
   }\r