]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/slc/web/SlcApi.js
Refactor API
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / source / class / org / argeo / slc / web / SlcApi.js
diff --git a/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/slc/web/SlcApi.js b/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/slc/web/SlcApi.js
deleted file mode 100644 (file)
index 14be9b5..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-qx.Class.define("org.argeo.slc.web.SlcApi",\r
-{\r
-  extend : qx.core.Object,\r
-  \r
-  statics : {\r
-       DEFAULT_CONTEXT : "/org.argeo.slc.webapp",\r
-       \r
-       REMOVE_RESULT_FROM_COLL_SERVICE : "removeResultFromCollection.service",\r
-       ADD_RESULT_TO_COLL_SERVICE : "addResultToCollection.service",\r
-       LIST_COLLECTIONS_SERVICE : "listCollectionRefs.service",\r
-       LIST_RESULTS_SERVICE : "listResultAttributes.service",\r
-       GET_RESULT_SERVICE : "getResult.service",\r
-       \r
-       /**\r
-        * Standard Request getter\r
-        * @param serviceName {String} The name of the service to call (without base context)\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}\r
-        */\r
-       getServiceRequest:function(serviceName, fireReloadEventType, iLoadStatusables){\r
-               var serviceManager = org.argeo.ria.remote.RequestManager.getInstance();\r
-               return serviceManager.getRequest(\r
-                       org.argeo.slc.web.SlcApi.DEFAULT_CONTEXT+"/"+serviceName,\r
-                       "GET",\r
-                       "application/xml",\r
-                       fireReloadEventType,\r
-                       iLoadStatusables\r
-               );\r
-       },\r
-       \r
-       /**\r
-        * Remove a result from a collection\r
-        * @param collectionId {String} Id of the destination collection\r
-        * @param resultId {String} Id of the test result to remove\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}\r
-        */\r
-       getRemoveResultService : function(collectionId, resultId, fireReloadEventType, iLoadStatusables){\r
-               var request = org.argeo.slc.web.SlcApi.getServiceRequest(\r
-                       org.argeo.slc.web.SlcApi.REMOVE_RESULT_FROM_COLL_SERVICE, \r
-                       fireReloadEventType, \r
-                       iLoadStatusables\r
-               );\r
-               request.setParameter("collectionId", collectionId);\r
-               request.setParameter("resultUuid", resultId);\r
-               return request;\r
-       },\r
-       \r
-       /**\r
-        * Add a result to a given collection\r
-        * @param collectionId {String} Id of the destination collection\r
-        * @param resultId {String} Id of the test result to add\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}\r
-        */\r
-       getAddResultService : function(collectionId, resultId, fireReloadEventType, iLoadStatusables){\r
-               var request = org.argeo.slc.web.SlcApi.getServiceRequest(\r
-                       org.argeo.slc.web.SlcApi.ADD_RESULT_TO_COLL_SERVICE, \r
-                       fireReloadEventType, \r
-                       iLoadStatusables\r
-               );\r
-               request.setParameter("collectionId", collectionId);\r
-               request.setParameter("resultUuid", resultId);\r
-               return request;\r
-       },\r
-       \r
-       /**\r
-        * List current collections\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}\r
-        */\r
-       getListCollectionsService : function(fireReloadEventType, iLoadStatusables){\r
-               return org.argeo.slc.web.SlcApi.getServiceRequest(\r
-                       org.argeo.slc.web.SlcApi.LIST_COLLECTIONS_SERVICE, \r
-                       fireReloadEventType, \r
-                       iLoadStatusables\r
-               );\r
-       },\r
-       \r
-       /**\r
-        * List all results or results of a given collection \r
-        * @param collectionId {String} Id of the collection to load\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}\r
-        */\r
-       getListResultsService : function(collectionId, fireReloadEventType, iLoadStatusables){\r
-               var request = org.argeo.slc.web.SlcApi.getServiceRequest(\r
-                       org.argeo.slc.web.SlcApi.LIST_RESULTS_SERVICE, \r
-                       fireReloadEventType, \r
-                       iLoadStatusables\r
-               );\r
-               if(collectionId){\r
-                       request.setParameter("id", collectionId);\r
-               }\r
-               return request;\r
-       },\r
-       \r
-       /**\r
-        * Load a result test\r
-        * @param resultId {String} Id of the test result to load\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}\r
-        */\r
-       getLoadResultService : function(resultId, fireReloadEventType, iLoadStatusables){\r
-               var request = org.argeo.slc.web.SlcApi.getServiceRequest(\r
-                       org.argeo.slc.web.SlcApi.GET_RESULT_SERVICE, \r
-                       fireReloadEventType, \r
-                       iLoadStatusables\r
-               );\r
-               request.setParameter("uuid", resultId);\r
-               return request;\r
-       }\r
-       \r
-  }\r
-});
\ No newline at end of file