- Timestamp:
- Jun 4, 2010, 11:42:05 AM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r520 r526 82 82 success() 83 83 } 84 on("next").to "study" 84 on("next") { 85 // clean the flow scope 86 flow.remove('study') 87 flow.remove('subjects') 88 flow.remove('subjectTemplates') 89 flow.remove('event') 90 flow.remove('events') 91 flow.remove('eventGroups') 92 flow.remove('eventTemplates') 93 }.to "study" 85 94 on("modify").to "modify" 86 95 } … … 100 109 }.to "start" 101 110 on("next") { 102 // TODO: loading a study is not yet implemented 103 // create a error stating this feature is 104 // not yet implemented 105 flash.errors = [:] 106 this.appendErrorMap( 107 ['study': 'Loading a study and modifying it has not yet been implemented. Please press \'cancel\' to go back to the initial page...'], 108 flash.errors 109 ) 110 111 error() 112 }.to "modify" 111 // load study 112 try { 113 flow.study = Study.findByTitle(params.study) 114 115 // recreate subjects 116 flow.subjects = [:] 117 flow.subjectTemplates = [:] 118 flow.study.subjects.each() { subject -> 119 def subjectIncrement = flow.subjects.size() 120 flow.subjects[ subjectIncrement ] = subject 121 122 // add subject template? 123 if (!flow.subjectTemplates[ subject.template.name ]) { 124 flow.subjectTemplates[ subject.template.name ] = [ 125 name: subject.template.name, 126 template: subject.template, 127 subjects: [:] 128 ] 129 } 130 131 // reference subject in template 132 flow.subjectTemplates[ subject.template.name ].subjects[ flow.subjectTemplates[ subject.template.name ].subjects.size() ] = subjectIncrement 133 } 134 135 // recreate events 136 flow.events = [] 137 flow.eventGroups = [] 138 flow.eventTemplates = [:] 139 flow.study.events.each() { event -> 140 def eventIncrement = flow.events.size() 141 flow.events[ eventIncrement ] = event 142 143 // add event template? 144 if (!flow.eventTemplates[ event.template.name ]) { 145 flow.eventTemplates[ event.template.name ] = [ 146 name: event.template.name, 147 template: event.template, 148 events: new ArrayList() 149 ] 150 } 151 152 // reference event in template 153 flow.eventTemplates[ event.template.name ].events[ flow.eventTemplates[ event.template.name ].events.size() ] = eventIncrement 154 155 // set dummy event 156 flow.event = event 157 } 158 159 // recreate sample events 160 flow.study.samplingEvents.each() { event -> 161 def eventIncrement = flow.events.size() 162 flow.events[ eventIncrement ] = event 163 164 // add event template? 165 if (!flow.eventTemplates[ event.template.name ]) { 166 flow.eventTemplates[ event.template.name ] = [ 167 name: event.template.name, 168 template: event.template, 169 events: new ArrayList() 170 ] 171 } 172 173 // reference event in template 174 flow.eventTemplates[ event.template.name ].events[ flow.eventTemplates[ event.template.name ].events.size() ] = eventIncrement 175 176 // set dummy event 177 flow.event = event 178 } 179 180 // recreate eventGroups 181 flow.study.eventGroups.each() { eventGroup -> 182 flow.eventGroups[ flow.eventGroups.size() ] = eventGroup 183 } 184 185 success() 186 } catch (Exception e) { 187 error() 188 } 189 }.to "study" 113 190 } 114 191 … … 176 253 flow.subjectTemplates = [:] 177 254 } 255 178 256 success() 179 257 } … … 670 748 */ 671 749 def handleSubjects(flow, flash, params) { 672 def names = [:]; 673 def errors = false; 674 def id = 0; 675 750 def names = [:] 751 def errors = false 752 def id = 0 753 754 println flow.subjects 676 755 // iterate through subject templates 677 756 flow.subjectTemplates.each() { subjectTemplate -> 678 757 // iterate through subjects 679 subjectTemplate. getValue().subjects.each() { subjectIncrement, subjectId ->758 subjectTemplate.value.subjects.each() { subjectIncrement, subjectId -> 680 759 // iterate through fields (= template fields and domain properties) 681 760 flow.subjects[ subjectId ].giveFields().each() { subjectField -> -
trunk/grails-app/views/common/_topnav.gsp
r482 r526 9 9 <ul class="subnav"> 10 10 <li><g:link controller="study" action="list">View studies</g:link></li> 11 <li><g:link controller="wizard" action="index">Create study</g:link></li> 11 <li><g:link controller="wizard" action="index">Create study</g:link></li> 12 <li><g:link controller="wizard" action="index">Edit study</g:link></li> 12 13 </ul> 13 14 </li> -
trunk/grails-app/views/wizard/pages/_events.gsp
r510 r526 67 67 <g:each var="eventTemplate" in="${eventTemplates}"> 68 68 <g:set var="showHeader" value="${true}" /> 69 <h1>${eventTemplate. getValue().name}</h1>69 <h1>${eventTemplate.value.name}</h1> 70 70 <div class="table"> 71 <g:each var="eventId" in="${eventTemplate. getValue().events}">71 <g:each var="eventId" in="${eventTemplate.value.events}"> 72 72 <g:if test="${showHeader}"> 73 73 <g:set var="showHeader" value="${false}" /> -
trunk/grails-app/views/wizard/pages/_modify.gsp
r359 r526 17 17 <wizard:pageContent> 18 18 19 <span class="info"> 20 <span class="title">Edit a study</span> 21 Select the study you would like to modify. 22 <b><i>Note: this functionality is currently in beta and has not been verified properly... use with care!</i></b> 23 </span> 24 19 25 <wizard:studyElement name="study" description="Study" error="study" value=""> 20 The study you would like to load and modify26 The study you would like to load and edit 21 27 </wizard:studyElement> 22 28 23 <span class="info">24 <span class="todo">TODO</span>25 <ul>26 <li>this feature has not yet been implemented</li>27 </ul>28 </span>29 30 <!-- g:render template="pages/demo" //-->31 32 29 </wizard:pageContent> -
trunk/grails-app/views/wizard/pages/_start.gsp
r455 r526 21 21 <wizard:ajaxButton name="next" class="bigbutton" value="Create a new study" alt="Create a new study" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" /> 22 22 23 <wizard:ajaxButton name="modify" class="bigbutton" value=" Modify an existing study" alt="Modifyan existing study" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" />23 <wizard:ajaxButton name="modify" class="bigbutton" value="Edit an existing study" alt="Edit an existing study" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" /> 24 24 25 25 <span class="info"> … … 36 36 You can do this by choosing Studies > Import data in the menu. 37 37 This part of the applications will help you to upload large studies. This import function can be used for all study components (study, subject and event information) at once. 38 <span class="title"> Modifyan existing study</span>38 <span class="title">Edit an existing study</span> 39 39 Only study owners can modify a their own studies. This part of the application can be used to extend the study information, for instance with new measurements. 40 40 </span> -
trunk/grails-app/views/wizard/pages/_study.gsp
r518 r526 20 20 In this step of the step-by-step study capturing tool all the basic information of a study can be filled out. 21 21 Keep in mind that the more and the more specific the information that is filled out, the more valuable the system will be. 22 Only the fields with an asterisks are obligatory. 23 Pick the study template of choice (currently a fixed set) and define your study values. In this prototype the 24 templated fields (below the 'note' box) are not yet handled so you can leave them empty for now. 22 Only the fields with an asterisks are obligatory. Pick the study template of choice (currently a fixed set) and define your study values. 25 23 </span> 26 24 -
trunk/grails-app/views/wizard/pages/_subjects.gsp
r469 r526 71 71 </g:if> 72 72 73 <g:if env="development">74 <span class="info">75 <span class="known">Known issues</span>76 <ul>77 <li>autocomplete fields (like ontologies) deselect the selected rows and hence don't replicate</li>78 <li>ontology fields should replicate value <i>and</i> hidden fields</li>79 <li>ontology hidden fields should be processed by the back-end as well (not yet implemented)</li>80 <li>ontology fields now show suggestions for <i>all</i> available ontologies. This has to be narrowed down in the future.</li>81 <li>ontology hidden fields should be handled by the taglibrary / controller as well</li>82 </ul>83 </span>84 </g:if>85 86 73 </wizard:pageContent>
Note: See TracChangeset
for help on using the changeset viewer.