Changeset 196 for trunk/grails-app/controllers/SearchableController.groovy
- Timestamp:
- Feb 12, 2010, 7:56:06 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/SearchableController.groovy
r193 r196 21 21 * Basic web interface for Grails Searchable Plugin 22 22 * 23 * @author Maurice Nicholson23 * @author Adem and Jahn 24 24 */ 25 25 class SearchableController { … … 28 28 def selectsample = { 29 29 30 println "in selectsample: " 31 params.each{println it} 32 33 // prepare showing all studies selected in the previous view 34 def selectedStudies = [] 35 def selectedStudyIds = params['selectedStudyIds'] 36 37 if(selectedStudyIds!=null) 38 { 39 def list = selectedStudyIds.findAll(/(\d)+/) 40 selectedStudies = list.collect{ dbnp.studycapturing.Study.get(it) } 41 } 42 else 43 { 44 def tmpList = [] 45 def studyList = dbnp.studycapturing.Study.list() 46 selectedStudyIds = [] 47 params.each{ key,values-> 48 if (values=="on") tmpList.add(key) 49 } 50 51 for (i in studyList) 52 if (tmpList.contains(i.getId().toString())) 53 { 54 selectedStudyIds.add(i.id) 55 selectedStudies.add(i) 56 } 57 } 58 59 60 61 // subgroups 62 // provide list of subgroups depending on the type of subgrouping 63 // selected by the user 64 def subgroups = [] 65 def submitButton = params["submit"] // this button's value determines the kind of subgrouping 66 67 switch(submitButton) 68 { 69 case "Subject Groups": 70 render(params) 71 render("Subject Groups") 72 subgroups=["subject group 1","subject group 2"] 73 render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups]) 74 break 75 case "Event Groups": 76 render("Event Groups") 77 subgroups=["event group 1","event group 2"] 78 render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups]) 79 break 80 case "Starting Time Groups": 81 render("Starting Time Groups") 82 subgroups=["time group 1","time group 2"] 83 render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups]) 84 break 85 case ">> Execute and continue with biomarker selection": 86 render("Starting Time Groups") 87 break 88 case "<< Back to study selection": 89 break 90 } 91 render(view:"selectsample",model:[selectedStudies:selectedStudies,selectedStudyIds:selectedStudyIds,subgroups:subgroups]) 30 92 } 93 94 95 31 96 /** 32 97 * Index page with search form and results … … 60 125 render("unindexAll done") 61 126 } 127 128 129 def subjectGroups = { render ("hello") } 130 131 62 132 }
Note: See TracChangeset
for help on using the changeset viewer.