]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/slc/web/SlcApi.js
Removed comments
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / source / class / org / argeo / slc / web / SlcApi.js
1 qx.Class.define("org.argeo.slc.web.SlcApi",
2 {
3 extend : qx.core.Object,
4
5 statics : {
6 DEFAULT_CONTEXT : "/org.argeo.slc.webapp",
7
8 REMOVE_RESULT_FROM_COLL_SERVICE : "removeResultFromCollection.service",
9 ADD_RESULT_TO_COLL_SERVICE : "addResultToCollection.service",
10 LIST_COLLECTIONS_SERVICE : "listCollectionRefs.service",
11 LIST_RESULTS_SERVICE : "listResultAttributes.service",
12 GET_RESULT_SERVICE : "getResult.service",
13
14 /**
15 * Standard Request getter
16 * @param serviceName {String} The name of the service to call (without base context)
17 * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent
18 * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update
19 * @return {qx.io.remote.Request}
20 */
21 getServiceRequest:function(serviceName, fireReloadEventType, iLoadStatusables){
22 var serviceManager = org.argeo.ria.remote.RequestManager.getInstance();
23 return serviceManager.getRequest(
24 org.argeo.slc.web.SlcApi.DEFAULT_CONTEXT+"/"+serviceName,
25 "GET",
26 "application/xml",
27 fireReloadEventType,
28 iLoadStatusables
29 );
30 },
31
32 /**
33 * Remove a result from a collection
34 * @param collectionId {String} Id of the destination collection
35 * @param resultId {String} Id of the test result to remove
36 * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent
37 * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update
38 * @return {qx.io.remote.Request}
39 */
40 getRemoveResultService : function(collectionId, resultId, fireReloadEventType, iLoadStatusables){
41 var request = org.argeo.slc.web.SlcApi.getServiceRequest(
42 org.argeo.slc.web.SlcApi.REMOVE_RESULT_FROM_COLL_SERVICE,
43 fireReloadEventType,
44 iLoadStatusables
45 );
46 request.setParameter("collectionId", collectionId);
47 request.setParameter("resultUuid", resultId);
48 return request;
49 },
50
51 /**
52 * Add a result to a given collection
53 * @param collectionId {String} Id of the destination collection
54 * @param resultId {String} Id of the test result to add
55 * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent
56 * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update
57 * @return {qx.io.remote.Request}
58 */
59 getAddResultService : function(collectionId, resultId, fireReloadEventType, iLoadStatusables){
60 var request = org.argeo.slc.web.SlcApi.getServiceRequest(
61 org.argeo.slc.web.SlcApi.ADD_RESULT_TO_COLL_SERVICE,
62 fireReloadEventType,
63 iLoadStatusables
64 );
65 request.setParameter("collectionId", collectionId);
66 request.setParameter("resultUuid", resultId);
67 return request;
68 },
69
70 /**
71 * List current collections
72 * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent
73 * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update
74 * @return {qx.io.remote.Request}
75 */
76 getListCollectionsService : function(fireReloadEventType, iLoadStatusables){
77 return org.argeo.slc.web.SlcApi.getServiceRequest(
78 org.argeo.slc.web.SlcApi.LIST_COLLECTIONS_SERVICE,
79 fireReloadEventType,
80 iLoadStatusables
81 );
82 },
83
84 /**
85 * List all results or results of a given collection
86 * @param collectionId {String} Id of the collection to load
87 * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent
88 * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update
89 * @return {qx.io.remote.Request}
90 */
91 getListResultsService : function(collectionId, fireReloadEventType, iLoadStatusables){
92 var request = org.argeo.slc.web.SlcApi.getServiceRequest(
93 org.argeo.slc.web.SlcApi.LIST_RESULTS_SERVICE,
94 fireReloadEventType,
95 iLoadStatusables
96 );
97 if(collectionId){
98 request.setParameter("id", collectionId);
99 }
100 return request;
101 },
102
103 /**
104 * Load a result test
105 * @param resultId {String} Id of the test result to load
106 * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent
107 * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update
108 * @return {qx.io.remote.Request}
109 */
110 getLoadResultService : function(resultId, fireReloadEventType, iLoadStatusables){
111 var request = org.argeo.slc.web.SlcApi.getServiceRequest(
112 org.argeo.slc.web.SlcApi.GET_RESULT_SERVICE,
113 fireReloadEventType,
114 iLoadStatusables
115 );
116 request.setParameter("uuid", resultId);
117 return request;
118 }
119
120 }
121 });