]> 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
Initialize array at startup, not inside the property, otherwise there is a static...
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-lib / slc / class / org / argeo / slc / ria / SlcApi.js
index 1bab2a46e30b40e0674df66d0bb02db45c2651cb..3380e4063f91fc8f2f4b3c42a532bed5c5e0b350 100644 (file)
@@ -17,11 +17,14 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
        REMOVE_RESULT_FROM_COLL_SERVICE : "removeResultFromCollection.service",\r
        ADD_RESULT_TO_COLL_SERVICE : "addResultToCollection.service",\r
        LIST_COLLECTIONS_SERVICE : "listCollectionRefs.service",\r
+       COPY_COLLECTION_TO_COLL_SERVICE : "copyCollectionToCollection.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
+       LIST_AGENTS_SERVICE : "listAgents.service",\r
+       LIST_MODULES_SERVICE : "listModulesDescriptors.service",\r
+       GET_EXECUTION_DESC_SERVICE : "getExecutionDescriptor.service",\r
        AMQ_SERVICE : "amq",\r
        \r
        /**\r
@@ -61,6 +64,29 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
                return request;\r
        },\r
        \r
+       /**\r
+        * Remove a set of results from a collection. Either filtered by a given pattern, or the whole collection.\r
+        * @param collectionId {String} The id of the collection\r
+        * @param patternAttribute {String} An optional attribute name on which to filter\r
+        * @param patternValue {String} The pattern to use for filtering a subset of result\r
+        * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent\r
+        * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update\r
+        * @return {qx.io.remote.Request} The Request object\r
+        */\r
+       getRemoveFromCollectionService : function(collectionId, patternAttribute, patternValue, fireReloadEventType, iLoadStatusables){\r
+               var request = org.argeo.slc.ria.SlcApi.getServiceRequest(\r
+                       org.argeo.slc.ria.SlcApi.REMOVE_RESULT_FROM_COLL_SERVICE, \r
+                       fireReloadEventType, \r
+                       iLoadStatusables\r
+               );\r
+               request.setParameter("collectionId", collectionId);\r
+               if(patternAttribute && patternValue){\r
+                       request.setParameter("attrName", patternAttribute);\r
+                       request.setParameter("attrPattern", patternValue);\r
+               }\r
+               return request;\r
+       },\r
+       \r
        /**\r
         * Add a result to a given collection\r
         * @param collectionId {String} Id of the destination collection\r
@@ -94,6 +120,31 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
                );\r
        },\r
        \r
+       /**\r
+        * Copy a whole collection or a subset of it to another collection. If a new id is provided for the target, it will be created.\r
+        * @param sourceCollectionId {String} The current collection from which to copy\r
+        * @param targetCollectionId {String} The target collection. If unknown, it will be created.\r
+        * @param patternAttribute {String} An optional attribute on which a filter can be applied to create a subset.\r
+        * @param patternValue {String} The associated pattern to filter on the atttribute's value.\r
+        * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent\r
+        * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update\r
+        * @return {qx.io.remote.Request} The request object\r
+        */\r
+       getCopyCollectionService : function(sourceCollectionId, targetCollectionId, patternAttribute, patternValue, fireReloadEventType, iLoadStatusables){\r
+               var request = org.argeo.slc.ria.SlcApi.getServiceRequest(\r
+                       org.argeo.slc.ria.SlcApi.COPY_COLLECTION_TO_COLL_SERVICE, \r
+                       fireReloadEventType, \r
+                       iLoadStatusables                        \r
+               );\r
+               request.setParameter("sourceCollectionId", sourceCollectionId);\r
+               request.setParameter("targetCollectionId", targetCollectionId);\r
+               if(patternAttribute && patternValue){\r
+                       request.setParameter("attrName", patternAttribute);\r
+                       request.setParameter("attrPattern", patternValue);\r
+               }\r
+               return request;\r
+       },\r
+       \r
        /**\r
         * List all results or results of a given collection \r
         * @param collectionId {String} Id of the collection to load\r
@@ -158,6 +209,39 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
                        iLoadStatusables\r
                );\r
        },\r
+\r
+       /**\r
+        * Load the module descriptors\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
+       getListModulesService : function(fireReloadEventType, iLoadStatusables){\r
+               return org.argeo.slc.ria.SlcApi.getServiceRequest(\r
+                       org.argeo.slc.ria.SlcApi.LIST_MODULES_SERVICE,\r
+                       fireReloadEventType,\r
+                       iLoadStatusables\r
+               );\r
+       },\r
+       \r
+       /**\r
+        * Get an execution module descriptor by its name and version\r
+        * @param moduleName {String} The name of the module to get\r
+        * @param moduleVersion {String} Its version, passed directly as a string\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
+       getLoadExecutionDescriptorService : function(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("moduleName", moduleName);\r
+               req.setParameter("version", moduleVersion);\r
+               return req;\r
+       },\r
        \r
        /**\r
         * Send a JMS message to the AMQ_CONTEXT\r