Changeset 1655
- Timestamp:
- Mar 21, 2011, 3:04:22 PM (11 years ago)
- Location:
- trunk/grails-app/controllers
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/HomeController.groovy
r1625 r1655 164 164 } 165 165 166 // set output header to json 167 response.contentType = 'application/json' 168 166 169 // render result 167 170 if (params.callback) { -
trunk/grails-app/controllers/RestController.groovy
r1593 r1655 65 65 boolean isUser = authenticationService.isRemotelyLoggedIn( params.consumer, params.token ) 66 66 def reply = ['authenticated':isUser] 67 68 // set output header to json 69 response.contentType = 'application/json' 70 67 71 render reply as JSON 68 72 } … … 80 84 SecUser user = authenticationService.getRemotelyLoggedInUser( params.consumer, params.token ) 81 85 def reply = [username: user.username, id: user.id] 86 87 // set output header to json 88 response.contentType = 'application/json' 89 82 90 render reply as JSON 83 91 } 84 85 92 86 93 /** … … 181 188 } 182 189 183 render returnStudies as JSON 190 // set output header to json 191 response.contentType = 'application/json' 192 193 render returnStudies as JSON 184 194 } 185 195 … … 227 237 versionInfo[ 'version' ] = study.version; 228 238 239 // set output header to json 240 response.contentType = 'application/json' 241 229 242 render versionInfo as JSON 230 243 } … … 260 273 } 261 274 } 262 render subjects as JSON 275 276 // set output header to json 277 response.contentType = 'application/json' 278 279 render subjects as JSON 263 280 } 264 281 … … 305 322 */ 306 323 def getAssays = { 324 // set output header to json 325 response.contentType = 'application/json' 307 326 308 327 List returnList = [] // return list of hashes each containing fields and values belonging to an assay … … 311 330 def validCall = CommunicationManager.hasValidParams( params, "consumer", "studyToken" ) 312 331 if( !validCall ) { 313 render "Error. Wrong or insufficient parameters." as JSON 332 render "Error. Wrong or insufficient parameters." as JSON 314 333 return 315 334 } … … 365 384 366 385 } 367 render returnList as JSON 386 render returnList as JSON 368 387 } 369 388 … … 514 533 } 515 534 535 // set output header to json 536 response.contentType = 'application/json' 537 516 538 render items as JSON 517 539 } … … 540 562 def auth = ['isOwner': study.isOwner(user), 'canRead': study.canRead(user), 'canWrite': study.canWrite(user)]; 541 563 log.trace "Authorization for study " + study.title + " and user " + user.username + ": " + auth 564 565 // set output header to json 566 response.contentType = 'application/json' 567 542 568 render auth as JSON; 543 569 } else { … … 546 572 } 547 573 } 548 549 574 } -
trunk/grails-app/controllers/dbnp/authentication/LoginController.groovy
r1626 r1655 155 155 156 156 if (springSecurityService.isAjax(request)) { 157 // set output header to json 158 response.contentType = 'application/json' 159 157 160 render([error: msg] as JSON) 158 161 } … … 167 170 */ 168 171 def ajaxSuccess = { 169 println "ajaxsuccess" 172 // set output header to json 173 response.contentType = 'application/json' 174 170 175 render([success: true, username: springSecurityService.authentication.name] as JSON) 171 176 } … … 175 180 */ 176 181 def ajaxDenied = { 177 println "ajaxdenied" 182 // set output header to json 183 response.contentType = 'application/json' 184 178 185 render([error: 'access denied'] as JSON) 179 186 } -
trunk/grails-app/controllers/dbnp/authentication/UserController.groovy
r1430 r1655 184 184 } 185 185 186 render text: jsonData as JSON, contentType: ' text/plain'186 render text: jsonData as JSON, contentType: 'application/json' 187 187 } 188 188 -
trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy
r1603 r1655 324 324 def templates = Template.findAllByEntity(gdtService.getInstanceByEntity(params.entity.decodeURL())) 325 325 326 // set output header to json 327 response.contentType = 'application/json' 328 326 329 // render as JSON 327 330 render templates as JSON -
trunk/grails-app/controllers/dbnp/studycapturing/StudyController.groovy
r1621 r1655 349 349 } 350 350 } 351 352 // set output header to json 353 response.contentType = 'application/json' 354 351 355 render json as JSON 352 356 } … … 375 379 */ 376 380 def ajaxGetAssays = { 377 378 381 def study = Study.read(params.id) 382 383 // set output header to json 384 response.contentType = 'application/json' 385 379 386 render study?.assays?.collect{[name: it.name, id: it.id]} as JSON 380 387 }
Note: See TracChangeset
for help on using the changeset viewer.