- Timestamp:
- Jun 3, 2010, 4:37:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/RestController.groovy
r515 r523 50 50 /** 51 51 * REST resource for the Simple Assay Module. 52 * Provide a list of all subjects belonging to a study. 53 * 54 * Examlpe call of the getAssays REST resource: http://localhost:8080/gscf/rest/getSubjects/json?externalStudyID=1 55 * 56 * @param externalStudyID 57 * @return as JSON object list of subject names 58 */ 59 def getSubjects = { 60 List subjects = [] 61 if( params.externalStudyID ) { 62 def id = Long.parseLong(params.externalStudyID) 63 def study = Study.find( "from Study as s where s.externalStudyID=?", [id]) 64 study.subjects.each { subjects.push it.name } 65 } 66 render subjects as JSON 67 } 68 69 70 /** 71 * REST resource for the Simple Assay Module. 52 72 * Provide a list of all assays for a given study 53 73 *
Note: See TracChangeset
for help on using the changeset viewer.