- Timestamp:
- Jan 17, 2011, 3:49:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/nl/tno/metagenomics/AssayController.groovy
r3 r4 433 433 } 434 434 435 /**436 * Updates existing run437 */438 def updateRun = {439 // load study with id specified by param.id440 def assay = Assay.get(params.id as Long)441 442 if (!assay) {443 flash.message = "No assay found with id: $params.id"444 redirect('action': 'errorPage')445 return446 }447 448 if( !params.run_id ) {449 flash.message = "No run id given"450 redirect(action: 'show', id: params.id)451 return452 }453 454 def run455 456 try {457 run = Run.findById( params.run_id as Long )458 } catch( Exception e ) {459 throw e460 flash.message = "Incorrect run id given: "461 redirect(action: 'show', id: params.id)462 return463 }464 465 // Set properties to the run466 params.parameterFile = params.editParameterFile467 run.setPropertiesFromForm( params );468 469 if( run.save() ) {470 flash.message = "Run succesfully saved";471 } else {472 flash.error = "Run could not be saved: " + run.getErrors();473 }474 475 redirect( action: 'show', id: params.id)476 }477 478 435 def errorPage = { 479 436 render "An error has occured. $flash.message"
Note: See TracChangeset
for help on using the changeset viewer.