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=e9add89bdfcb9590cf1cb053d162fe7063f5cb87;hb=ad362af53b227d1ed89e9b46f0fee5b23e400488;hp=dd3632594d06764bdf2e59347af0026ec40c30cb;hpb=c58a78133506154b20a357921ea48f710f06e1bc;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 dd3632594..e9add89bd 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 @@ -1,3 +1,12 @@ +/** + * SLC API Client implementation : + * This class encapsulate the various SLC services available. It just creates the Request object + * and return them, it does not execute them. + * Available services are : + * + loadResult / removeResult / addResult + * + listCollection / listResults + * When using it, be sure the static constant DEFAULT_CONTEXT is pointing to the right URL. + */ qx.Class.define("org.argeo.slc.ria.SlcApi", { extend : qx.core.Object, @@ -11,6 +20,9 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", LIST_RESULTS_SERVICE : "listResultAttributes.service", GET_RESULT_SERVICE : "getResult.service", + LIST_AGENTS_SERVICE : "listAgents.service", + AMQ_SERVICE : "amq", + /** * Standard Request getter * @param serviceName {String} The name of the service to call (without base context) @@ -115,6 +127,41 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", ); request.setParameter("uuid", resultId); return request; + }, + + /** + * List currently available agents queues. + * @param fireReloadEventType {String} Event type to trigger (optionnal) + * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update + * @return {qx.io.remote.Request} + */ + getListAgentsService:function(fireReloadEventType, iLoadStatusables){ + return org.argeo.slc.ria.SlcApi.getServiceRequest( + org.argeo.slc.ria.SlcApi.LIST_AGENTS_SERVICE, + fireReloadEventType, + iLoadStatusables + ); + }, + + /** + * Send a JMS message to the AMQ_CONTEXT + * @param destination {String} The destination queue, in the form "topic://destination" + * @param message {org.argeo.slc.ria.SlcExecutionMessage} The message object + * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update + */ + getSendAmqMessageRequest : function(destination, message, iLoadStatusables){ + var serviceManager = org.argeo.ria.remote.RequestManager.getInstance(); + var request = serviceManager.getRequest( + org.argeo.slc.ria.SlcApi.DEFAULT_CONTEXT+"/"+org.argeo.slc.ria.SlcApi.AMQ_SERVICE, + "POST", + "text/plain", + null, + iLoadStatusables + ); + request.setParameter("destination", destination); + request.setParameter("message", message.toXml()); + request.setParameter("type", "send"); + return request; } }