]> 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
Fetch Spec & Flow values
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / argeo-ria-lib / slc / class / org / argeo / slc / ria / SlcApi.js
index e9add89bdfcb9590cf1cb053d162fe7063f5cb87..687ae6acd5a5ed56a1f9b1492c0b031512dfff87 100644 (file)
@@ -17,8 +17,10 @@ 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
        AMQ_SERVICE : "amq",\r
@@ -60,6 +62,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
@@ -93,6 +118,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
@@ -128,6 +178,21 @@ qx.Class.define("org.argeo.slc.ria.SlcApi",
                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