Changeset 1941
- Timestamp:
- Jun 27, 2011, 2:57:45 PM (11 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/RestController.groovy
r1884 r1941 136 136 */ 137 137 def getStudies = { 138 138 def user = authenticationService.getRemotelyLoggedInUser( params.consumer, params.token ) 139 139 140 List returnStudies = [] 140 141 List studies = [] … … 169 170 studies.each { study -> 170 171 if(study) { 171 def user = authenticationService.getRemotelyLoggedInUser( params.consumer, params.token )172 172 // Check whether the person is allowed to read the data of this study 173 173 if( study.canRead(authenticationService.getRemotelyLoggedInUser( params.consumer, params.token ))) { … … 243 243 } 244 244 245 /** 246 * REST resource for data modules. 247 * Consumer and token should be supplied via URL parameters. 248 * Provides the version number of all studies readable by this user 249 * 250 * @param consumer consumer name of the calling module 251 * @param token token for the authenticated user (e.g. session_id) 252 * @return JSON object list containing studies with 'studyToken', and 'version' 253 * 254 * A 404 error might occur if the study doesn't exist, and a 401 error if the user is not 255 * authorized to access this study. 256 * 257 * Example. REST call with one studyToken. 258 * 259 * Call: http://localhost:8080/gscf/rest/getStudyVersions 260 * 261 * Result: [{"studyToken":"PPSH","version":31},{"studyToken":"Other study", "version":3}] 262 */ 263 def getStudyVersions = { 264 // Check which user has been logged in 265 def user = authenticationService.getRemotelyLoggedInUser( params.consumer, params.token ) 266 267 def jsonList = [] 268 269 Study.giveReadableStudies( user ).each { study -> 270 if(study) { 271 jsonList << [studyToken:study.giveUUID(), version: study.version] 272 } 273 } 274 275 // set output header to json 276 response.contentType = 'application/json' 277 278 render jsonList as JSON 279 } 280 281 245 282 /** 246 283 * REST resource for data modules. -
trunk/grails-app/services/dbnp/modules/ModuleNotificationService.groovy
r1939 r1941 41 41 return 42 42 43 log.info( "Invalidate " + study .code)43 log.info( "Invalidate " + study ) 44 44 45 def modules = AssayModule.find ByNotify(true);45 def modules = AssayModule.findAllByNotify(true); 46 46 47 47 // If no modules are set to notify, return … … 85 85 Thread.start { 86 86 urls.each { url -> 87 log.info( "GSCF NOTIFY MODULE OF STUDY CHANGE: ${url}") 87 88 try { 88 89 def connection = url.toURL().openConnection()
Note: See TracChangeset
for help on using the changeset viewer.