source: trunk/src/groovy/dbnp/rest/CCMCommunicationManager.groovy @ 480

Last change on this file since 480 was 480, checked in by jahn, 11 years ago

Providing some methods for showing that REST/JSON actually works for the gscf.

File size: 1.9 KB
Line 
1package dbnp.rest
2
3import java.util.Map; 
4import java.util.HashMap; 
5import grails.converters.JSON
6import org.codehaus.groovy.grails.web.json.*
7import dbnp.studycapturing.TemplateFieldListItem
8import dbnp.studycapturing.Template
9import dbnp.data.CleanDataLayer
10
11
12
13class 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}
Note: See TracBrowser for help on using the repository browser.