X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.webapp%2Fsrc%2Fmain%2Fwebapp%2Fargeo-ria-lib%2Fslc%2Fclass%2Forg%2Fargeo%2Fslc%2Fria%2FSlcApi.js;h=687ae6acd5a5ed56a1f9b1492c0b031512dfff87;hb=51d1c842e4e92cc65708b8bb88152d7344d43d04;hp=e9add89bdfcb9590cf1cb053d162fe7063f5cb87;hpb=ad362af53b227d1ed89e9b46f0fee5b23e400488;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcApi.js b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcApi.js index e9add89bd..687ae6acd 100644 --- a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcApi.js +++ b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcApi.js @@ -17,8 +17,10 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", REMOVE_RESULT_FROM_COLL_SERVICE : "removeResultFromCollection.service", ADD_RESULT_TO_COLL_SERVICE : "addResultToCollection.service", LIST_COLLECTIONS_SERVICE : "listCollectionRefs.service", + COPY_COLLECTION_TO_COLL_SERVICE : "copyCollectionToCollection.service", LIST_RESULTS_SERVICE : "listResultAttributes.service", GET_RESULT_SERVICE : "getResult.service", + LIST_SLCEXEC_SERVICE : "listSlcExecutions.service", LIST_AGENTS_SERVICE : "listAgents.service", AMQ_SERVICE : "amq", @@ -60,6 +62,29 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", return request; }, + /** + * Remove a set of results from a collection. Either filtered by a given pattern, or the whole collection. + * @param collectionId {String} The id of the collection + * @param patternAttribute {String} An optional attribute name on which to filter + * @param patternValue {String} The pattern to use for filtering a subset of result + * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent + * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update + * @return {qx.io.remote.Request} The Request object + */ + getRemoveFromCollectionService : function(collectionId, patternAttribute, patternValue, fireReloadEventType, iLoadStatusables){ + var request = org.argeo.slc.ria.SlcApi.getServiceRequest( + org.argeo.slc.ria.SlcApi.REMOVE_RESULT_FROM_COLL_SERVICE, + fireReloadEventType, + iLoadStatusables + ); + request.setParameter("collectionId", collectionId); + if(patternAttribute && patternValue){ + request.setParameter("attrName", patternAttribute); + request.setParameter("attrPattern", patternValue); + } + return request; + }, + /** * Add a result to a given collection * @param collectionId {String} Id of the destination collection @@ -93,6 +118,31 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", ); }, + /** + * 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. + * @param sourceCollectionId {String} The current collection from which to copy + * @param targetCollectionId {String} The target collection. If unknown, it will be created. + * @param patternAttribute {String} An optional attribute on which a filter can be applied to create a subset. + * @param patternValue {String} The associated pattern to filter on the atttribute's value. + * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent + * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update + * @return {qx.io.remote.Request} The request object + */ + getCopyCollectionService : function(sourceCollectionId, targetCollectionId, patternAttribute, patternValue, fireReloadEventType, iLoadStatusables){ + var request = org.argeo.slc.ria.SlcApi.getServiceRequest( + org.argeo.slc.ria.SlcApi.COPY_COLLECTION_TO_COLL_SERVICE, + fireReloadEventType, + iLoadStatusables + ); + request.setParameter("sourceCollectionId", sourceCollectionId); + request.setParameter("targetCollectionId", targetCollectionId); + if(patternAttribute && patternValue){ + request.setParameter("attrName", patternAttribute); + request.setParameter("attrPattern", patternValue); + } + return request; + }, + /** * List all results or results of a given collection * @param collectionId {String} Id of the collection to load @@ -128,6 +178,21 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", request.setParameter("uuid", resultId); return request; }, + + /** + * List currently registered SlcExecutions. + * @param fireReloadEventType {String} Event type to trigger (optionnal) + * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update + * @return {qx.io.remote.Request} + */ + getListSlcExecutionsService:function(fireReloadEventType, iLoadStatusables){ + return org.argeo.slc.ria.SlcApi.getServiceRequest( + org.argeo.slc.ria.SlcApi.LIST_SLCEXEC_SERVICE, + fireReloadEventType, + iLoadStatusables + ); + }, + /** * List currently available agents queues.