Changeset 1155
- Timestamp:
- Nov 17, 2010, 2:12:48 PM (10 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/Config.groovy
r1133 r1155 120 120 warn 'org.mortbay.log' 121 121 122 //info 'org.codehaus.groovy.grails.web.servlet', 123 // 'org.codehaus.groovy.grails.plugins' 124 122 125 //debug 'org.codehaus.groovy.grails.plugins' 123 126 } -
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r1150 r1155 80 80 // start the flow 81 81 onStart { 82 log.info ".entering onStart" 83 82 84 // define flow variables 83 85 flow.page = 0 … … 105 107 render(view: "/wizard/index") 106 108 onRender { 109 log.info ".entering mainPage" 110 107 111 flow.page = 1 108 112 success() … … 120 124 handleJump { 121 125 action { 126 log.info ".entering handleJump" 127 122 128 if (flow.jump && flow.jump.action == 'edit') { 123 129 if (flow.jump.id) { … … 146 152 render(view: "_start") 147 153 onRender { 154 log.info ".entering start" 155 148 156 flow.page = 1 149 157 success() … … 164 172 render(view: "_redirect") 165 173 onRender { 174 log.info ".entering redirectToImport" 166 175 flash.uri = "/importer/index" 167 176 } … … 173 182 render(view: "_modify") 174 183 onRender { 184 log.info ".entering modify" 185 175 186 flow.page = 1 176 187 flash.cancel = true … … 196 207 render(view: "_study") 197 208 onRender { 209 log.info ".entering study" 210 198 211 flow.page = 1 199 212 success() … … 240 253 render(view: "_subjects") 241 254 onRender { 255 log.info ".entering subjects" 256 242 257 flow.page = 2 243 258 … … 298 313 render(view: "_events") 299 314 onRender { 315 log.info ".entering events" 316 300 317 flow.page = 3 301 318 … … 470 487 eventsNext { 471 488 action { 489 log.info ".entering eventsNext" 490 472 491 def assigned = false 473 492 … … 496 515 render(view: "_unassigned_samplingEvent_warning") 497 516 onRender { 517 log.info ".entering unassignedSamplingEventsWarning" 518 498 519 flow.page = 3 499 520 success() … … 507 528 render(view: "_groups") 508 529 onRender { 530 log.info ".entering groups" 531 509 532 flow.page = 3 510 533 success() … … 528 551 render(view: "_samples_previous_warning") 529 552 onRender { 553 log.info ".entering samplePrevious" 554 530 555 flow.page = 4 531 532 // TEMPORARY FIX TO REMOVE ALL SAMPLES AND REGENERATE THEM533 // THEN USER BROWSED BACK534 println ".removing samples from study"535 536 // remove samples from study537 flow.samples.each() {538 flow.study.removeFromSamples(it.sample)539 }540 541 // remove samples from flow542 flow.remove('samples')543 // END FIX544 556 } 545 557 on("next").to "samples" … … 551 563 render(view: "_samples") 552 564 onRender { 565 log.info ".entering samples" 566 553 567 flow.page = 4 554 568 success() … … 614 628 render(view: "_assays") 615 629 onRender { 630 log.info ".entering assays" 631 616 632 flow.page = 5 617 633 } … … 710 726 assayNext { 711 727 action { 728 log.info ".entering assayNext" 729 712 730 // have we got samples and assays? 713 731 if (flow.study.assays && flow.study.samples) { … … 728 746 render(view: "_assay_groups") 729 747 onRender { 748 log.info ".entering assayGroups" 749 730 750 flow.page = 5 731 751 } … … 752 772 confirmPrevious { 753 773 action { 774 log.info ".entering confirmPrevious" 775 754 776 // have we got samples and assays? 755 777 if (flow.study.assays && flow.study.samples) { … … 770 792 render(view: "_confirmation") 771 793 onRender { 794 log.info ".entering confirm" 795 772 796 flow.page = 6 773 797 } … … 787 811 render(view: "_wait") 788 812 onRender { 813 log.info ".entering waitForSave" 814 789 815 flow.page = 7 790 816 } … … 795 821 save { 796 822 action { 797 println "saving..." 823 log.info ".entering save" 824 798 825 flash.wizardErrors = [:] 799 826 … … 801 828 try { 802 829 // save study 803 println".saving study"830 log.info ".saving study" 804 831 805 832 // Make sure the owner of the study is set right … … 810 837 throw new Exception('error saving study') 811 838 } 812 println".saved study "+flow.study+" (id: "+flow.study.id+")"839 log.info ".saved study "+flow.study+" (id: "+flow.study.id+")" 813 840 814 841 success() … … 832 859 render(view: "_error") 833 860 onRender { 861 log.info ".entering error" 862 834 863 flow.page = 6 835 864 } … … 842 871 render(view: "_done") 843 872 onRender { 873 log.info ".entering done" 874 844 875 flow.page = 7 845 876 } … … 984 1015 flow.study.addToPublications(publication) 985 1016 } else { 986 println('.publication with ID ' + id + ' not found in database.')1017 log.info('.publication with ID ' + id + ' not found in database.') 987 1018 } 988 1019 } … … 990 1021 991 1022 } else { 992 println('.no publications selected.')1023 log.info('.no publications selected.') 993 1024 flow.study.publications.clear() 994 1025 } … … 1045 1076 flow.study.addToPersons(studyPerson) 1046 1077 } else { 1047 println('.person ' + ids.person + ' or Role ' + ids.role + ' not found in database.')1078 log.info('.person ' + ids.person + ' or Role ' + ids.role + ' not found in database.') 1048 1079 } 1049 1080 } 1050 1081 } 1051 1082 } else { 1052 println('.no persons selected.')1083 log.info('.no persons selected.') 1053 1084 flow.study.persons.clear() 1054 1085 } … … 1094 1125 users.add(user) 1095 1126 } else { 1096 println('.user with ID ' + id + ' not found in database.')1127 log.info('.user with ID ' + id + ' not found in database.') 1097 1128 } 1098 1129 } … … 1100 1131 1101 1132 } else { 1102 println('.no users selected.')1133 log.info('.no users selected.') 1103 1134 users.clear() 1104 1135 } … … 1211 1242 // validate subject 1212 1243 if (subject.validate()) { 1213 println".added subject "+subject1244 log.info ".added subject "+subject 1214 1245 } else { 1215 1246 // whoops? … … 1293 1324 // instantiate a sample for this subject / event 1294 1325 def samplingEventName = this.ucwords(event.template.name) 1295 def sampleName = (this.ucwords(subject.name) + '_' + samplingEventName + '_' + new RelTime(event.startTime).toString()).replaceAll("([ ]{1,})", "") 1326 def eventGroupName = eventGroup.name.replaceAll(/\w+/, { it[0].toUpperCase() + ((it.size() > 1) ? it[1..-1] : '') }).replaceAll("([ ]{1,})", "") 1327 def sampleName = (this.ucwords(subject.name) + '_' + samplingEventName + '_' + eventGroupName + '_' + new RelTime(event.startTime).toString()).replaceAll("([ ]{1,})", "") 1296 1328 def tempSampleIterator = 0 1297 1329 def tempSampleName = sampleName … … 1389 1421 eventGroup.samplingEvents.each() { samplingEvent -> 1390 1422 def samplingEventName = this.ucwords(samplingEvent.template.name) 1391 def sampleName = (this.ucwords(subject.name) + '_' + samplingEventName + '_' + new RelTime(samplingEvent.startTime).toString()).replaceAll("([ ]{1,})", "") 1423 def eventGroupName = eventGroup.name.replaceAll(/\w+/, { it[0].toUpperCase() + ((it.size() > 1) ? it[1..-1] : '') }).replaceAll("([ ]{1,})", "") 1424 def sampleName = (this.ucwords(subject.name) + '_' + samplingEventName + '_' + eventGroupName + '_' + new RelTime(samplingEvent.startTime).toString()).replaceAll("([ ]{1,})", "") 1392 1425 def tempSampleIterator = 0 1393 1426 def tempSampleName = sampleName … … 1413 1446 ) 1414 1447 } 1448 } else { 1415 1449 } 1416 1450 } else { 1417 // remove from eventGroup 1418 eventGroup.removeFromSubjects(subject) 1419 1420 // iterate through samplingEvents 1421 eventGroup.samplingEvents.each() { samplingEvent -> 1422 flow.study.samples.findAll { ( it.parentEvent.equals(samplingEvent) && it.parentSubject.equals(subject) ) }.each() { 1423 // delete this sample 1424 flow.study.removeFromSamples( it ) 1425 it.delete() 1451 // check if this subject is a member of this eventGroup 1452 if (eventGroup.subjects.find { it.equals(subject) }) { 1453 // remove from eventGroup 1454 eventGroup.removeFromSubjects(subject) 1455 1456 // iterate through samplingEvents 1457 eventGroup.samplingEvents.each() { samplingEvent -> 1458 flow.study.samples.findAll { (it.parentEvent.equals(samplingEvent) && it.parentSubject.equals(subject) && it.parentEventGroup.equals(eventGroup)) }.each() { 1459 // delete this sample 1460 flow.study.removeFromSamples(it) 1461 it.delete() 1462 } 1426 1463 } 1427 1464 } -
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r1040 r1155 226 226 */ 227 227 def baseElement = { inputElement, attrs, help -> 228 println ".rendering [" + inputElement + "] with name [" + attrs.get('name') + "] and value [" + ((attrs.value) ? attrs.get('value').toString() : "-") + "]" 228 log.info ".rendering [" + inputElement + "] with name [" + attrs.get('name') + "] and value [" + ((attrs.value) ? attrs.get('value').toString() : "-") + "]" 229 229 230 // work variables 230 231 def description = attrs.remove('description') -
trunk/grails-app/views/wizard/pages/_samples.gsp
r1146 r1155 17 17 <wizard:pageContent> 18 18 19 < g:if env="development">19 <% /* g:if env="development"> 20 20 <wizard:ajaxButtonElement description="Development feature (regenerate samples)" name="regenerate" value="regenerate new samples" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()"> 21 21 This functionality is only available in development mode for debugging purposes and will not show in test and production environments 22 22 </wizard:ajaxButtonElement> 23 </g:if >23 </g:if */ %> 24 24 25 25 <span class="info"> … … 103 103 <div class="column">Subject</div> 104 104 <div class="column">Template</div> 105 <wizard:templateColumnHeaders entity="${sample}" class="column" columnWidths="[Name:2 00]"/>105 <wizard:templateColumnHeaders entity="${sample}" class="column" columnWidths="[Name:250]"/> 106 106 </div> 107 107 </g:if>
Note: See TracChangeset
for help on using the changeset viewer.