1 | package dbnp.rest |
---|
2 | |
---|
3 | import java.util.Map; |
---|
4 | import java.util.HashMap; |
---|
5 | import grails.converters.JSON |
---|
6 | import org.codehaus.groovy.grails.web.json.* |
---|
7 | import dbnp.studycapturing.TemplateFieldListItem |
---|
8 | import dbnp.studycapturing.Template |
---|
9 | import dbnp.data.CleanDataLayer |
---|
10 | |
---|
11 | |
---|
12 | |
---|
13 | class CCMCommunicationManager implements CleanDataLayer { |
---|
14 | |
---|
15 | def static ServerURL = "http://localhost:8080/gscf/rest"; |
---|
16 | |
---|
17 | |
---|
18 | /* Methods implemented for CleanDataLayer */ |
---|
19 | |
---|
20 | |
---|
21 | /** |
---|
22 | * Get the names of all quantitative features that are available for a certain assay |
---|
23 | * @param assayID the module internal ID for the assay |
---|
24 | * @return |
---|
25 | */ |
---|
26 | public String[] getFeaturesQuantitative(long assayID) { |
---|
27 | return new String [20]; |
---|
28 | } |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | /** |
---|
33 | * Get the data for a quantitative feature for a certain assay for a certain set of samples |
---|
34 | * @param feature |
---|
35 | * @param assayID |
---|
36 | * @param sampleIDs |
---|
37 | * @return Map |
---|
38 | */ |
---|
39 | public Map getDataQuantitative(String feature, long assayID, String[] sampleIDs) { |
---|
40 | return new HashMap(); |
---|
41 | } |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | |
---|
46 | |
---|
47 | /** |
---|
48 | * Testing REST. Remove when connection to nbx5 is established. |
---|
49 | * |
---|
50 | * @return list of ClinicalFloatData |
---|
51 | */ |
---|
52 | public Object getFeatures() { |
---|
53 | def url = new URL( ServerURL + "/features" ) |
---|
54 | return JSON.parse(url.newReader()) |
---|
55 | } |
---|
56 | |
---|
57 | |
---|
58 | /** |
---|
59 | * Testing REST. Remove when connection to nbx5 is established. |
---|
60 | * |
---|
61 | * @return list of ClinicalFloatData |
---|
62 | */ |
---|
63 | private String getSearchable( keyword ) { |
---|
64 | return "submit=Query&q=" + keyword |
---|
65 | } |
---|
66 | |
---|
67 | |
---|
68 | /** |
---|
69 | * Testing REST. Remove when connection to nbx5 is established. |
---|
70 | * |
---|
71 | * @return list of ClinicalFloatData |
---|
72 | */ |
---|
73 | public String getStudiesForKeyword( String keyword ) { |
---|
74 | } |
---|
75 | |
---|
76 | |
---|
77 | public void getMeasurementsResource() { |
---|
78 | } |
---|
79 | |
---|
80 | public void getMeasurementsForValueResource() { |
---|
81 | } |
---|
82 | |
---|
83 | public void getMeasurementsForRangeResource() { |
---|
84 | } |
---|
85 | |
---|
86 | |
---|
87 | public void getDataSimple() { |
---|
88 | } |
---|
89 | |
---|
90 | |
---|
91 | } |
---|