X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=server%2Forg.argeo.slc.ria%2Fsrc%2Fargeo-ria-lib%2Fslc%2Fclass%2Forg%2Fargeo%2Fslc%2Fria%2FSlcApi.js;h=d076386b8e370baeb5cc48b6864d0815ad17c80a;hb=ac1edd931feb89d91bc726d4df2157988074c3d6;hp=f59edc9b6673eba84207ce2d09a18852db6003f8;hpb=d8e9131cdd34b663a03008df8eb97616694259ce;p=gpl%2Fargeo-slc.git diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcApi.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcApi.js index f59edc9b6..d076386b8 100644 --- a/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcApi.js +++ b/server/org.argeo.slc.ria/src/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcApi.js @@ -20,14 +20,21 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", COPY_COLLECTION_TO_COLL_SERVICE : "copyCollectionToCollection.service", LIST_RESULTS_SERVICE : "listResultAttributes.service", GET_RESULT_SERVICE : "getResult.service", + GET_ATTACHEMENT_SERVICE : "getAttachment.service", LIST_SLCEXEC_SERVICE : "listSlcExecutions.service", + NEW_SLCEXEC_SERVICE : "newSlcExecution.service", LIST_AGENTS_SERVICE : "listAgents.service", LIST_MODULES_SERVICE : "listModulesDescriptors.service", GET_EXECUTION_DESC_SERVICE : "getExecutionDescriptor.service", + REALIZED_FLOWS_SERVICE : "getRealizedFlows.service", RELOAD_BUNDLE_SERVICE : "reloadBundle.service", AMQ_SERVICE : "amq", + LIST_MODULAR_DISTRIB_SERVICE : "listModularDistributions.service", + INSTALL_MODULE_SERVICE : "installModule.service", + UNINSTALL_MODULE_SERVICE : "uninstallModule.service", + /** * Standard Request getter * @param serviceName {String} The name of the service to call (without base context) @@ -182,6 +189,11 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", return request; }, + buildGetAttachmentUrl : function(attachmentId, contentType, name){ + return org.argeo.slc.ria.SlcApi.DEFAULT_CONTEXT + "/" + org.argeo.slc.ria.SlcApi.GET_ATTACHEMENT_SERVICE + + "?uuid=" + attachmentId + "&contentType=" + contentType + "&name=" + name; + }, + /** * List currently registered SlcExecutions. * @param fireReloadEventType {String} Event type to trigger (optionnal) @@ -196,6 +208,73 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", ); }, + /** + * 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} + */ + getListModularDistributionsService:function(fireReloadEventType, iLoadStatusables){ + return org.argeo.slc.ria.SlcApi.getServiceRequest( + org.argeo.slc.ria.SlcApi.LIST_MODULAR_DISTRIB_SERVICE, + fireReloadEventType, + iLoadStatusables + ); + }, + + getInstallModuleService : function(){ + return org.argeo.slc.ria.SlcApi.DEFAULT_CONTEXT +"/"+ org.argeo.slc.ria.SlcApi.INSTALL_MODULE_SERVICE; + }, + + /** + * Load a result test + * @param resultId {String} Id of the test result to load + * @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} + */ + getUninstallModuleService : function(moduleName, moduleVersion, fireReloadEventType, iLoadStatusables){ + var request = org.argeo.slc.ria.SlcApi.getServiceRequest( + org.argeo.slc.ria.SlcApi.UNINSTALL_MODULE_SERVICE, + fireReloadEventType, + iLoadStatusables + ); + request.setParameter("name", moduleName); + request.setParameter("version", moduleVersion); + return request; + }, + + + + /** + * New SlcExecution + * @param agentId {String} Agent id target + * @param xmlDescription {String} XML of the Slc Execution + * @param fireReloadEventType {String} Event type to trigger (optionnal) + * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update + * @return {qx.io.remote.Request} + */ + getNewSlcExecutionService:function(agentId, xmlDescription, fireReloadEventType, iLoadStatusables){ + var req = org.argeo.slc.ria.SlcApi.getServiceRequest( + org.argeo.slc.ria.SlcApi.NEW_SLCEXEC_SERVICE + "?slc_agentId="+agentId, + fireReloadEventType, + iLoadStatusables + ); + req.setMethod("POST"); + //req.setRequestHeader("Content-Type", "text/xml"); + req.setData("body=" + encodeURIComponent(xmlDescription)); + return req; + }, + + getRealizedFlowsService :function(executionMessageId, fireReloadEventType, iLoadStatusables){ + var request = org.argeo.slc.ria.SlcApi.getServiceRequest( + org.argeo.slc.ria.SlcApi.REALIZED_FLOWS_SERVICE, + fireReloadEventType, + iLoadStatusables + ); + request.setParameter("executionMessageId", executionMessageId); + return request; + }, /** * List currently available agents queues. @@ -217,12 +296,14 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update * @return {qx.io.remote.Request} */ - getListModulesService : function(fireReloadEventType, iLoadStatusables){ - return org.argeo.slc.ria.SlcApi.getServiceRequest( + getListModulesService : function(agentId, fireReloadEventType, iLoadStatusables){ + var req = org.argeo.slc.ria.SlcApi.getServiceRequest( org.argeo.slc.ria.SlcApi.LIST_MODULES_SERVICE, fireReloadEventType, iLoadStatusables ); + req.setParameter("agentId", agentId); + return req; }, /** @@ -233,12 +314,13 @@ qx.Class.define("org.argeo.slc.ria.SlcApi", * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update * @return {qx.io.remote.Request} */ - getLoadExecutionDescriptorService : function(moduleName, moduleVersion, fireReloadEventType, iLoadStatusables){ + getLoadExecutionDescriptorService : function(agentId,moduleName, moduleVersion, fireReloadEventType, iLoadStatusables){ var req = org.argeo.slc.ria.SlcApi.getServiceRequest( org.argeo.slc.ria.SlcApi.GET_EXECUTION_DESC_SERVICE, fireReloadEventType, iLoadStatusables ); + req.setParameter("agentId", agentId); req.setParameter("moduleName", moduleName); req.setParameter("version", moduleVersion); return req;