Changeset 829
- Timestamp:
- Aug 23, 2010, 9:29:03 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/NimbleBootStrap.groovy
r826 r829 49 49 // Execute any custom Nimble related BootStrap for your application below 50 50 51 if (dbnp.user.User.count() == 0) { 51 println "Adding example user..." 52 53 if (0 && dbnp.user.User.count() == 0) { 52 54 53 55 // Create example User account … … 70 72 throw new RuntimeException("Error creating example user") 71 73 } 74 75 println "Adding example admin user..." 72 76 73 77 // Create example Administrative account -
trunk/grails-app/controllers/RestController.groovy
r773 r829 31 31 /** Rest resources for Simple Assay Module (SAM) **/ 32 32 /**************************************************/ 33 33 34 def beforeInterceptor = [action:this.&auth] 35 def credentials 36 // defined as a regular method so its private 37 38 def auth() { 39 credentials = nl.metabolomicscentre.dsp.http.BasicAuthentication.credentialsFromRequest(request) 40 if(false) { 41 response.sendError(403) 42 return false 43 } 44 } 45 34 46 35 47 … … 38 50 * Provide a list of all studies. 39 51 * 40 *41 * Examlpe call of the getAssays REST resource: http://localhost:8080/gscf/rest/getAssays/json?externalStudyID=142 52 * 43 53 * @return as JSON object list of members externalStudyID, and title for all studies … … 74 84 * Provide a list of all assays for a given study 75 85 * 76 * @param externalStudyID 77 * @return list of assays as JSON object 86 * Example call of the getAssays REST resource: http://localhost:8080/gscf/rest/getAssays?externalStudyID=PPSH&moduleURL=http://localhost:8182/sam 87 * 88 * @param externalStudyID The external study id (code) of the target GSCF Study object 89 * @param moduleURL The base URL of the calling dbNP module 90 * @return list of assays in the study as JSON object, filtered to only contain assays for the specified module 78 91 */ 79 92 def getAssays = { 80 93 List assays = [] 81 94 if( params.externalStudyID ) { 95 println params.moduleURL 82 96 def study = Study.find( "from Study as s where s.code=?", [params.externalStudyID]) 83 if(study) study.assays.each{ assay -> 84 def map = ['name':assay.name, 'externalAssayID':assay.externalAssayID] 85 assays.push( map ) 97 if(study) study.assays.each{ assay -> 98 println assay.module.url 99 if (assay.module.url.equals(params.moduleURL)) { 100 def map = ['name':assay.name, 'externalAssayID':assay.externalAssayID] 101 assays.push( map ) 102 } 86 103 } 87 104 }
Note: See TracChangeset
for help on using the changeset viewer.