Changeset 649 for trunk/src


Ignore:
Timestamp:
Jul 13, 2010, 5:49:15 PM (10 years ago)
Author:
jahn
Message:

Added five controller actions (RestController?) and corresponding Rest Wrapper (CommunicationManager?) methods for Rest communication with DSP.
The contents of three actions still need to be completed.
Authentication is still in a dummy method. When Michael has figured out how to do the authentication, it will be added.

File:
1 edited

Legend:

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

    r648 r649  
    2828    def public static SAMServerURL  = "http://localhost:8182/sam"
    2929    def public static GSCFServerURL = "http://localhost:8080/gscf"
     30    def public static DSPServerURL  = "http://localhost:8080/gscf"
    3031
    3132     
     
    194195                //               "class":"data.SimpleAssay", "externalAssayID":"1", "id":1, "measurements":null, "unit":"Insulin", "inSerum":false,
    195196        //                               "name":"test Simple Assay 1", "referenceValues":"test Reference Values 1"], dbnp.studycapturing.Assay : 1]]]
    196                 def closure = { map -> 
    197                     def studies = []   
    198                     def assays  = []   
     197                def closure = { map ->
     198                    def studies = []
     199                    def assays  = []
    199200                        def studiesHQ = "from dbnp.studycapturing.Study as s where s.code=?"
    200201                        map['studyIds'].each { studies.add( dbnp.studycapturing.Study.find(studiesHQ,[it]) ) }
     
    212213
    213214
     215    /**
     216     *  This method creates on run time new methods for accessing Grails views that SAM provides for GSCF.
     217     *  This method should be called in grails-app/conf/BootStrap.groovy in the GSCF module.
     218     */
     219    public static registerRestWrapperMethodsGSCFtoDSP() {
     220                def url = DSPServerURL
     221                addRestWrapper( url, 'isUser',  ['username','password'] )
     222                addRestWrapper( url, 'listStudies',  ['username','password'] )
     223                addRestWrapper( url, 'listStudySamples',  ['username','password','study_token'] )
     224                addRestWrapper( url, 'getStudy',  ['username','password','study_token'] )
     225                addRestWrapper( url, 'getStudySample',  ['username','password','study_token','sample_token'] )
     226                addRestWrapper( url, 'isUser',  ['username','password'] )
     227    }
     228
     229
     230
    214231}
Note: See TracChangeset for help on using the changeset viewer.