Changeset 608


Ignore:
Timestamp:
Jun 25, 2010, 10:27:01 AM (7 years ago)
Author:
jahn
Message:

Added methods supplying SAM urls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/groovy/dbnp/rest/CommunicationManager.groovy

    r553 r608  
    1010import dbnp.data.CleanDataLayer
    1111import dbnp.studycapturing.Study
     12import dbnp.studycapturing.Assay
    1213
    1314
     
    3233     *  rest resources that this communication manager connects to.
    3334     */
    34     def static ServerURL = "http://nbx5.nugo.org:8182/ClinicalChemistry/rest";
    35     //def static ServerURL = "http://localhost:8080/gscf/rest";
     35
     36    def static ServerURL = "http://localhost:8182/ClinicalChemistry"
     37    //def static ServerURL = "http://nbx5.nugo.org:8182/ClinicalChemistry"
     38    def static RestServerURL = ServerURL + "/rest"
    3639
    3740
    3841    /* Methods implemented for CleanDataLayer */
     42
     43
    3944
    4045
     
    4550     */
    4651    public String[] getFeaturesQuantitative(long assayID) {
    47          return new String [20];
     52         return new String [20]
    4853    }
    4954   
     
    5863     */
    5964    public Map getDataQuantitative(String feature, long assayID, String[] sampleIDs) {
    60          return new HashMap();
     65         return new HashMap()
    6166    }
    6267
     
    104109     */
    105110    public Object getMeasurementsResource( String keyword ) {
    106         def url = new URL( ServerURL + "/" + getSearchable(keyword) )
     111        def url = new URL( RestServerURL + "/" + getSearchable(keyword) )
    107112        return  JSON.parse( url.newReader() )
    108113    }
     
    117122     */
    118123    private Object request( String resource ) {
    119         def url = new URL( ServerURL + "/" + resource );
    120         return  JSON.parse( url.newReader() );
     124        def url = new URL( RestServerURL + "/" + resource )
     125        return  JSON.parse( url.newReader() )
    121126    }
    122127
     
    138143
    139144
     145    /**
     146     * Get the URL for importing an assay within the GSCF.
     147     * This is not a REST method! It only creates a rest resource and returns it's url.
     148     *
     149     * @params assay
     150     * @return list of ClinicalFloatData
     151     */
     152    public Object getAssayImportURL( assay ) {
     153        return new URL( ServerURL + '/importer/test?externalAssayID=' + assay.externalAssayID )
     154    }
    140155
    141156
    142157
    143158
    144     /*  To Do for querying
    145     public void getMeasurementsForValueResource() {
     159    /* Methods for acessing URLs in SAM */
     160
     161
     162    /**
     163     * Get the URL for importing an assay within the GSCF.
     164     * This is not a REST method! It only creates a rest resource and returns it's url.
     165     *
     166     * @params assay
     167     * @return URL
     168     */
     169    public Object getAssayShowURL( assay ) {
     170        return new URL( ServerURL + '/simpleAssay/show/assay?externalAssayID=' + assay.externalAssayID )
    146171    }
    147172
    148173
    149     public void getMeasurementsForRangeResource() {
     174    /**
     175     * Get the URL for importing an assay within the GSCF.
     176     * This is not a REST method! It only creates a rest resource and returns it's url.
     177     *
     178     * @params assay
     179     * @return URL
     180     */
     181    public Object getAssayEditURL( assay ) {
     182        return new URL( ServerURL + '/simpleAssay/edit/assay?externalAssayID=' + assay.externalAssayID )
    150183    }
    151184
    152185
    153     public void getDataSimple() {
     186    /**
     187     * Get the URL for importing an assay within the GSCF.
     188     * This is not a REST method! It only creates a rest resource and returns it's url.
     189     *
     190     * @params URL
     191     * @return list of ClinicalFloatData
     192     */
     193    public Object getMeasurementTypesURL() {
     194        return new URL( ServerURL + '/simpleAssayMeasurementType/list/nil?externalAssayID=' + assay.externalAssayID )
    154195    }
    155     */
    156 
    157 
    158 
    159196
    160197
Note: See TracChangeset for help on using the changeset viewer.