Changeset 389
- Timestamp:
- Apr 28, 2010, 4:28:39 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r386 r389 47 47 accession: '9606' 48 48 ).with { if (!validate()) { errors.each { println it} } else save()} 49 50 def bloodTerm = new Term(51 name: 'Portion of blood',52 ontology: speciesOntology,53 accession: '9670'54 ).with { if (!validate()) { errors.each { println it} } else save()}55 56 49 57 50 // Create a few persons, roles and Affiliations … … 142 135 ).with { if (!validate()) { errors.each { println it} } else save()} 143 136 137 def bloodTerm = new Term( 138 name: 'Portion of blood', 139 ontology: humanBodyOntology, 140 accession: '9670' 141 ).with { if (!validate()) { errors.each { println it} } else save()} 144 142 145 143 def c57bl6Term = new Term( … … 443 441 name: 'Compound', type: TemplateFieldType.STRING, 444 442 listEntries: [new TemplateFieldListItem(name:'Vehicle'),new TemplateFieldListItem(name: 'Leptin')])) 445 .with { if (!validate()) { errors.each { println it} } else save()}446 447 def bloodSamplingEventTemplate = new Template(448 name: 'Blood extraction', entity: dbnp.studycapturing.Event)449 .addToFields(sampleDescriptionField)450 .addToFields(new TemplateField(451 name: 'Sample volume', type: TemplateFieldType.FLOAT))452 .with { if (!validate()) { errors.each { println it} } else save()}453 454 def fastingTreatmentTemplate = new Template(455 name: 'Fasting treatment', entity: dbnp.studycapturing.Event)456 .addToFields(sampleDescriptionField)457 .addToFields(new TemplateField(458 name: 'Fasting period', type: TemplateFieldType.STRING))459 443 .with { if (!validate()) { errors.each { println it} } else save()} 460 444 … … 516 500 exampleStudy.save() 517 501 518 519 /* Test output of fields things */520 println "-----------------------------"521 print "Diet domain fields: "522 println exampleStudy.giveDomainFields().join( ", " )523 524 print "Diet template fields: "525 println exampleStudy.giveTemplateFields().join( ", " )526 527 print "Diet all fields: "528 println exampleStudy.giveFields().join( ", " )529 530 println "-----------------------------"531 532 502 println ".adding NuGO PPSH example study..." 533 503 def exampleHumanStudy = new Study( … … 545 515 546 516 def evLF = new Event( 547 template: dietTreatmentTemplate, 548 startTime: Date.parse('yyyy-MM-dd','2008-01-07'), 549 endTime: Date.parse('yyyy-MM-dd','2008-01-14') 517 template: dietTreatmentTemplate 550 518 ) 551 519 .with { if (!validate()) { errors.each { println it} } else save()} 552 520 521 evLF.setStartTime(Date.parse('yyyy-MM-dd','2008-01-07')) 522 evLF.setEndTime(Date.parse('yyyy-MM-dd','2008-01-14')) 523 553 524 evLF.setFieldValue( 'Diet','10% fat (palm oil)' ) 554 525 evLF.save(flush:true) … … 558 529 559 530 def evHF = new Event( 560 template: dietTreatmentTemplate, 561 startTime: Date.parse('yyyy-MM-dd','2008-01-07'), 562 endTime: Date.parse('yyyy-MM-dd','2008-01-14') 531 template: dietTreatmentTemplate 563 532 ) 533 .setStartTime( Date.parse('yyyy-MM-dd','2008-01-07')) 534 .setEndTime( Date.parse('yyyy-MM-dd','2008-01-14')) 564 535 .setFieldValue( 'Diet','45% fat (palm oil)' ) 565 536 .with { if (!validate()) { errors.each { println it} } else save()} 566 537 567 538 def evBV = new Event( 568 template: boostTreatmentTemplate, 569 startTime: Date.parse('yyyy-MM-dd','2008-01-07'), 570 endTime: Date.parse('yyyy-MM-dd','2008-01-14') 539 template: boostTreatmentTemplate 571 540 ) 541 .setStartTime( Date.parse('yyyy-MM-dd','2008-01-07')) 542 .setEndTime( Date.parse('yyyy-MM-dd','2008-01-14')) 572 543 .setFieldValue( 'Compound','Vehicle' ) 573 544 .with { if (!validate()) { errors.each { println it} } else save()} 574 545 575 546 def evBL = new Event( 576 template: boostTreatmentTemplate ,577 startTime: Date.parse('yyyy-MM-dd','2008-01-07'),578 endTime: Date.parse('yyyy-MM-dd','2008-01-14')579 547 template: boostTreatmentTemplate 548 ) 549 .setStartTime( Date.parse('yyyy-MM-dd','2008-01-07')) 550 .setEndTime( Date.parse('yyyy-MM-dd','2008-01-14')) 580 551 .setFieldValue( 'Compound','Leptin' ) 581 552 .with { if (!validate()) { errors.each { println it} } else save()} … … 686 657 687 658 def x=1 688 12.times {659 40.times { 689 660 def currentSubject = new Subject( 690 661 name: "A" + x++, … … 713 684 */ 714 685 715 if (x > 9) { HFBL1.addToSubjects(currentSubject).save() } 716 else if (x > 6) { HFBV1.addToSubjects(currentSubject).save() } 717 else if (x > 3) { LFBL1.addToSubjects(currentSubject).save() } 718 else { LFBV1.addToSubjects(currentSubject).save() } 719 720 } 721 722 // Also add some human subjects 723 2.times { 724 def currentSubject = new Subject( 725 name: "H" + x++, 726 species: humanTerm, 727 template: humanTemplate, 728 ) 729 .setFieldValue("Gender", "Male") 730 //.setFieldValue("Genotype", c57bl6Term) 731 .setFieldValue("Age (years)", 27) 732 .setFieldValue("Height", 1.5) 733 .with { if (!validate()) { errors.each { println it} } else save(flush:true)} 734 735 exampleStudy.addToSubjects(currentSubject) 736 .with { if (!validate()) { errors.each { println it} } else save()} 737 738 // Add subject to appropriate EventGroup 739 /* 740 if (x > 70) { HFBL4.addToSubjects(currentSubject).save() } 741 else if (x > 60) { HFBV4.addToSubjects(currentSubject).save() } 742 else if (x > 50) { LFBL4.addToSubjects(currentSubject).save() } 743 else if (x > 40) { LFBV4.addToSubjects(currentSubject).save() } 744 else if (x > 30) { HFBL1.addToSubjects(currentSubject).save() } 686 if (x > 30) { HFBL1.addToSubjects(currentSubject).save() } 745 687 else if (x > 20) { HFBV1.addToSubjects(currentSubject).save() } 746 688 else if (x > 10) { LFBL1.addToSubjects(currentSubject).save() } 747 689 else { LFBV1.addToSubjects(currentSubject).save() } 748 */749 750 if (x == 0) { HFBL1.addToSubjects(currentSubject).save() }751 else { LFBV1.addToSubjects(currentSubject).save() }752 690 753 691 } 754 755 692 756 693 // Add EventGroups to study … … 774 711 .save() 775 712 713 /* 776 714 println 'Adding PPSH study' 777 715 … … 781 719 code:"PPSH", 782 720 researchQuestion:"How much are fasting plasma and urine metabolite levels affected by prolonged fasting ?", 721 description:"Human study", 783 722 ecCode:"unknown", 784 723 startDate: Date.parse('yyyy-MM-dd','2009-01-01') … … 786 725 787 726 def fastingEvent = new Event( 788 template: fastingTreatmentTemplate, 789 startTime: Date.parse('yyyy-MM-dd','2008-01-14' ), 790 endTime: Date.parse('yyyy-MM-dd','2008-01-14' ) 791 ) 792 .setFieldValue( 'Fasting period','8h' ) 793 .with { if (!validate()) { errors.each { println it} } else save()} 727 startTime: Date.parse('yyyy-MM-dd','2008-01-14'), 728 endTime: Date.parse('yyyy-MM-dd','2008-01-14'), 729 eventDescription: fastingTreatment, 730 parameterStringValues: ['Fasting period':'8h']); 794 731 795 732 def bloodSamplingEvent = new SamplingEvent( 796 template: bloodSamplingEventTemplate, 797 startTime: Date.parse('yyyy-MM-dd','2008-01-14' ), 798 endTime: Date.parse('yyyy-MM-dd','2008-01-14' ) 799 ) 800 .setFieldValue( 'Sample volume',4.5F ) 801 .with { if (!validate()) { errors.each { println it} } else save()} 733 startTime: Date.parse('yyyy-MM-dd','2008-01-14'), 734 endTime: Date.parse('yyyy-MM-dd','2008-01-14'), 735 eventDescription: bloodSamplingEventDescription, 736 parameterFloatValues: ['Sample volume':4.5F]); 802 737 803 738 def rootGroup = new EventGroup(name: 'Root group'); … … 806 741 rootGroup.save() 807 742 808 def y = 1 809 11.times { 810 def currentSubject = new Subject( 811 name: "" + y++, 812 species: humanTerm, 813 template: humanTemplate).setFieldValue("Gender", (boolean) (x / 2) ? "Male" : "Female").setFieldValue("DOB", new java.text.SimpleDateFormat("dd-mm-yy").parse("01-02-19" + (10 + (int) (Math.random() * 80)))).setFieldValue("Age (years)", 30).setFieldValue("Height", Math.random() * 2F).setFieldValue("Weight (kg)", Math.random() * 150F).setFieldValue("BMI", 20 + Math.random() * 10F).with { if (!validate()) { errors.each { println it} } else save()} 814 815 rootGroup.addToSubjects currentSubject 816 rootGroup.save() 817 818 def currentSample = new Sample( 819 name: currentSubject.name + '_B', 820 material: bloodTerm, 821 parentSubject: currentSubject, 822 parentEvent: bloodSamplingEvent); 823 824 humanStudy.addToSubjects(currentSubject).addToSamples(currentSample).with { if (!validate()) { errors.each { println it} } else save()} 825 } 826 827 humanStudy.addToEvents(fastingEvent) 828 humanStudy.addToSamplingEvents(bloodSamplingEvent) 829 humanStudy.addToEventGroups rootGroup 830 humanStudy.save() 743 def y = 1 744 11.times { 745 def currentSubject = new Subject( 746 name: "" + y++, 747 species: humanTerm, 748 template: humanTemplate).setFieldValue("Gender", (boolean) (x / 2) ? "Male" : "Female").setFieldValue("DOB", new java.text.SimpleDateFormat("dd-mm-yy").parse("01-02-19" + (10 + (int) (Math.random() * 80)))).setFieldValue("Age (years)", 30).setFieldValue("Height", Math.random() * 2F).setFieldValue("Weight (kg)", Math.random() * 150F).setFieldValue("BMI", 20 + Math.random() * 10F).with { if (!validate()) { errors.each { println it} } else save()} 749 750 rootGroup.addToSubjects currentSubject 751 rootGroup.save() 752 753 def currentSample = new Sample( 754 name: currentSubject.name + '_B', 755 material: bloodTerm, 756 parentSubject: currentSubject, 757 parentEvent: bloodSamplingEvent); 758 759 760 humanStudy.addToSubjects(currentSubject).addToSamples(currentSample).with { if (!validate()) { errors.each { println it} } else save()} 761 } 762 763 humanStudy.addToEvents(fastingEvent) 764 humanStudy.addToSamplingEvents(bloodSamplingEvent) 765 humanStudy.addToEventGroups rootGroup 766 humanStudy.save() 767 831 768 // Add clinical data 832 769 … … 856 793 lipidAssay.addToMeasurements ldlMeasurement 857 794 lipidAssay.addToMeasurements hdlMeasurement 858 795 859 796 def lipidAssayInstance = new dbnp.clinicaldata.ClinicalAssayInstance( 860 797 assay: lipidAssay … … 878 815 879 816 // Add assay to study capture module 817 880 818 def clinicalModule = new AssayModule( 881 819 name: 'Clinical data', … … 896 834 lipidAssayRef.save() 897 835 898 humanStudy.addToAssays(lipidAssayRef); 899 900 // Add some sample assay 901 // Add assay to study capture module 902 def dummyModule = new AssayModule( 903 name: 'Dummy data', 904 type: AssayType.CLINICAL_DATA, 905 platform: 'other type of measurement platform', 906 url: 'http://localhost:8080/gscf' 907 ).with { if (!validate()) { errors.each { println it} } else save()} 908 909 def dummyAssayRef = new Assay( 910 name: 'Test assay', 911 module: dummyModule, 912 externalAssayId: lipidAssayInstance.id 913 ).with { if (!validate()) { errors.each { println it} } else save()} 914 915 humanStudy.addToAssays(dummyAssayRef); 916 836 humanStudy.addToAssays(lipidAssayRef); 917 837 humanStudy.save() 838 */ 918 839 } 919 840 } -
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r383 r389 242 242 flow.page = 4 243 243 244 if (!flow.events) { 245 flow.events = [] 246 } 247 244 if (!flow.event) flow.event = new Event() 245 if (!flow.events) flow.events = [] 248 246 if (!flow.eventGroups) { 249 247 flow.eventGroups = [] 250 248 flow.eventGroups[0] = new EventGroup(name: 'Group 1') // 1 group by default 251 249 } 252 println flow.events 253 } 250 } 251 on("switchTemplate") { 252 flash.values = params 253 254 // handle study data 255 this.handleEvents(flow, flash, params) 256 257 // remove errors as we don't want any warnings now 258 flash.errors = [:] 259 }.to "events" 254 260 on("add") { 261 /* 255 262 def startTime = (params.get('startTime')) ? params.startTime = new Date().parse("d/M/yyyy HH:mm", params.get('startTime').toString()) : null 256 263 def endTime = (params.get('endTime')) ? new Date().parse("d/M/yyyy HH:mm", params.get('endTime').toString()) : null … … 295 302 error() 296 303 } 304 */ 305 flash.values = params 306 307 // handle study data 308 this.handleEvents(flow, flash, params) 309 310 // validate event object 311 if (flow.event.validate()) { 312 //flow.events[ flow.events.size() ] = flow.event 313 success() 314 } else { 315 flash.errors = [:] 316 this.appendErrors(flow.event, flash.errors) 317 error() 318 } 297 319 }.to "events" 298 320 on("deleteEvent") { … … 502 524 } 503 525 526 527 /** 528 * re-usable code for handling event form data in a web flow 529 * @param Map LocalAttributeMap (the flow scope) 530 * @param Map localAttributeMap (the flash scope) 531 * @param Map GrailsParameterMap (the flow parameters = form data) 532 * @returns boolean 533 */ 534 def handleEvents(flow, flash, params) { 535 // got an event in the flash scope? 536 if (!flow.event) flow.event = new Event() 537 538 // if a template is selected, get template instance 539 def template = params.remove('template') 540 if (template instanceof String && template.size() > 0) { 541 params.template = Template.findByName(template) 542 } else if (template instanceof Template) { 543 params.template = template 544 } else { 545 params.template = null 546 } 547 548 // set template 549 if (params.template) flow.event.template = params.template 550 println flow.event.template 551 println params 552 553 // update event instance with parameters 554 params.each() { key, value -> 555 try { 556 flow.event.setFieldValue(key, value) 557 println "has "+key 558 } catch (Exception e) { 559 println "does NOT have "+key 560 } 561 /* 562 if (flow.event.hasProperty(key)) { 563 println "has property " + key 564 flow.event.setProperty(key, value); 565 } 566 */ 567 } 568 } 569 504 570 /** 505 571 * re-usable code for handling study form data in a web flow -
trunk/grails-app/domain/dbnp/studycapturing/Event.groovy
r388 r389 15 15 class Event extends TemplateEntity implements Serializable { 16 16 17 Date startTime18 Date endTime19 20 17 static constraints = { 21 18 startTime(nullable: true) … … 28 25 } 29 26 27 Date getStartTime() { 28 getFieldValue('Start time') 29 } 30 30 31 List<DomainTemplateField> giveDomainFields() { 32 [ new TemplateField( 33 name: 'startDate', 34 type: TemplateFieldType.DATE), 35 new TemplateField( 36 name: 'endDate', 37 type: TemplateFieldType.DATE) ]; 31 def setStartTime(Date value) { 32 if (value != null) { 33 setFieldValue('Start time',value) 34 } 35 return this 36 } 37 38 Date getEndTime() { 39 getFieldValue('End time') 40 } 41 42 def setEndTime(Date value) { 43 if (value != null) { 44 setFieldValue('End time',value) 45 } 46 return this 47 } 48 49 Map giveDomainFields() { 50 return ['startTime':TemplateFieldType.DATE,'endTime':TemplateFieldType.DATE] 38 51 } 39 52 -
trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy
r388 r389 16 16 // a member that describes the quantity of the sample? --> should be in the templates 17 17 18 List<DomainTemplateField> giveDomainFields() { 19 [ new TemplateField( 20 name: 'name', 21 type: TemplateFieldType.STRING), 22 new TemplateField( 23 name: 'material', 24 type: TemplateFieldType.ONTOLOGYTERM) ]; 18 Map giveDomainFields() { 19 return ['name':TemplateFieldType.STRING,'material':TemplateFieldType.ONTOLOGYTERM] 25 20 } 26 21 -
trunk/grails-app/domain/dbnp/studycapturing/Study.groovy
r386 r389 23 23 //String ecCode 24 24 25 List<DomainTemplateField> giveDomainFields() { 26 [ new TemplateField( 27 name: 'title - niet opslaan!', 28 type: TemplateFieldType.STRING), 29 new TemplateField( 30 name: 'startDate', 31 type: TemplateFieldType.DATE) ]; 25 Map giveDomainFields() { 26 return ['title':TemplateFieldType.STRING,'startDate':TemplateFieldType.DATE] 32 27 } 33 28 -
trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy
r388 r389 16 16 Term species 17 17 18 List<DomainTemplateField> giveDomainFields() { 19 [ new TemplateField( 20 name: 'name', 21 type: TemplateFieldType.STRING), 22 new TemplateField( 23 name: 'species', 24 type: TemplateFieldType.ONTOLOGYTERM) ]; 18 Map giveDomainFields() { 19 return ['name':TemplateFieldType.STRING,'species':TemplateFieldType.ONTOLOGYTERM] 25 20 } 26 21 } -
trunk/grails-app/domain/dbnp/studycapturing/TemplateEntity.groovy
r386 r389 349 349 350 350 /** 351 * Return all fields defined in the underlying template and the built-in 352 * domain fields of this entity 351 * Return all templated fields defined in the underlying template of this entity 353 352 */ 354 353 def List<TemplateField> giveFields() { 355 return this.giveDomainFields() + this.giveTemplateFields();356 }357 358 /**359 * Return all templated fields defined in the underlying template of this entity360 */361 def List<TemplateField> giveTemplateFields() {362 354 return this.template.fields; 363 355 } 364 356 357 def List<TemplateField> giveSystemFields() { 358 return systemFields; 359 } 360 361 365 362 /** 366 363 * Return all relevant 'built-in' domain fields of the super class 367 * @return List with DomainTemplateFields 368 * @see DomainTemplateField 364 * @return key-value pairs describing the built-in fields, with the names as keys and type (as TemplateFieldType) as values 369 365 */ 370 abstract List<DomainTemplateField> giveDomainFields() 371 366 abstract Map giveDomainFields() 372 367 /*def giveDomainFields() { 373 368 def fieldSet = [:]; -
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r383 r389 209 209 */ 210 210 def baseElement = {inputElement, attrs, help -> 211 println ".rendering " + inputElement + " with name " + attrs.get('name')211 println ".rendering [" + inputElement + "] with name [" + attrs.get('name') + "] and value [" + ((attrs.value) ? attrs.get('value').toString() : "-") + "]" 212 212 // work variables 213 213 def description = attrs.remove('description') … … 599 599 // got result? 600 600 if (attrs.from.size() > 0) { 601 // transform all values into strings 602 def from = [] 603 attrs.from.each { from[ from.size() ] = it.toString() } 604 attrs.from = from 605 attrs.value = (attrs.value) ? attrs.value.toString() : '' 606 607 // output select element 601 608 out << select(attrs) 602 609 } else { … … 682 689 def renderType = attrs.remove('renderType') 683 690 def entity = (attrs.get('entity')) 691 println entity 692 println entity.class 693 println entity instanceof TemplateEntity 684 694 def template = (entity && entity instanceof TemplateEntity) ? entity.template : null 685 695 def inputElement= null -
trunk/grails-app/views/sandbox/index.gsp
r386 r389 37 37 <td>Type</td> 38 38 </tr> 39 <g:each in="${subject.giveDomainFields()}" var="field"> 40 <tr> 41 <td>Domain field</td> 42 <td>${field.key}</td> 43 <td>${field.value}</td> 44 </tr> 45 </g:each> 39 46 <g:each in="${subject.giveFields()}" var="field"> 40 47 <tr> -
trunk/grails-app/views/study/list.gsp
r386 r389 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 6 <meta name="layout" content="main" /> 7 8 7 <g:set var="entityName" value="${message(code: 'study.label', default: 'Study')}" /> 8 <title><g:message code="default.list.label" args="[entityName]" /></title> 9 9 </head> 10 10 <body> … … 12 12 <g:form action="list_extended"> 13 13 14 <div class="nav"> 15 <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span> 16 <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span> 17 </div> 14 18 <div class="body"> 15 19 <h1><g:message code="default.list.label" args="[entityName]" /></h1> … … 18 22 </g:if> 19 23 20 <div class="list"> 21 <table> 22 <thead> 23 <tr> 24 <th></th> 25 <g:sortableColumn property="title" title="${message(code: 'study.title.label', default: 'Title')}" /> 26 <th>Subjects</th> 27 <th>Events</th> 28 <th>Assays</th> 29 </tr> 30 </thead> 31 <tbody> 32 <g:each in="${studyInstanceList}" var="studyInstance" status="i" > 33 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 24 <g:each in="${studyInstanceList}" var="studyInstance"> 25 <br> 26 <table> 27 <tr> 28 <td width="50"></td> 29 <td colspan="3"> 30 <center><b>${studyInstance.title}</b></center> 31 </td> 32 </tr> 33 <tr> 34 <td> 34 35 35 <td><input type="checkbox" name="${studyInstance.title}" id="${studyInstance.title}"></td>36 <input type="checkbox" name="${studyInstance.title}" id="${studyInstance.title}"></td> 36 37 37 <td><g:link action="show" id="${studyInstance.id}">${fieldValue(bean: studyInstance, field: "title")}</g:link></td> 38 <td width="150"> 39 <g:link action="show" id="${studyInstance.id}"> 40 ${message(code: 'study.id.label', default: 'Id')} : 41 ${fieldValue(bean: studyInstance, field: "id")}</g:link></td> 38 42 39 <td> 40 <g:if test="${studyInstance.subjects.species.size()==0}"> 41 - 42 </g:if> 43 <g:else> 44 <g:each in="${studyInstance.subjects.species.unique()}" var="currentSpecies" status="j"> 45 <g:if test="${j > 0}">, </g:if> 46 <%= studyInstance.subjects.findAll { return it.species == currentSpecies; }.size() %> 47 ${currentSpecies} 48 </g:each> 49 </g:else> 50 </td> 43 <td width="300"> 44 <b>${message(code: 'study.template.label', default: 'Template')} </b>: 45 ${fieldValue(bean: studyInstance, field: "template")}</td> 51 46 52 <td> 53 <g:if test="${studyInstance.giveEventTemplates().size()==0}"> 54 - 55 </g:if> 56 <g:else> 57 ${studyInstance.giveEventTemplates().name.join( ', ' )} 58 </g:else> 59 </td> 47 <td > 48 <b>${message(code: 'study.subjects.label', default: 'Subjects')} </b>: 49 ${studyInstance.subjects.size()} subjects</td> 60 50 61 <td> 62 <g:if test="${studyInstance.assays.size()==0}"> 63 - 64 </g:if> 65 <g:else> 66 ${studyInstance.assays.module.platform.unique().join( ', ' )} 67 </g:else> 68 </td> 51 </tr> 52 <tr> 53 <td></td> 54 <td > 55 <b>${message(code: 'study.owner.label', default: 'Owner')} </b>: 56 ${fieldValue(bean: studyInstance, field: "owner")}</td> 69 57 70 </tr> 58 <td > 59 <b>Assays </b>: 60 <g:each in="${studyInstance.assays}" var="assay"> 61 ${assay.name} 62 </g:each> 63 </td> 64 65 <td><b> Samples </b>: 66 <g:each in="${studyInstance.assays.samples}" var="samples"> 67 ${samples.name} 71 68 </g:each> 72 </tbody> 73 </table> 74 </div> 75 <div class="buttons"> 76 <span class="button"><g:link controller="wizard" class="create" action="index"><g:message code="default.new.label" args="[entityName]" /></g:link></span> 77 </div> 69 </td> 70 71 72 </tr> 73 <g:if test="${studyInstance.fieldExists( 'Description' )}"> 74 <tr> 75 <td></td> 76 <td colspan="3"> 77 <b>${message(code: 'study.description.label', default: 'Description')} </b>: 78 ${studyInstance.getFieldValue( 'Description' )} 79 80 </td> 81 </tr> 82 </g:if> 83 </table> 84 </g:each> 85 78 86 <div class="paginateButtons"> 79 <g:paginate total="${studyInstanceTotal}" prev="« Previous" next="» Next" />80 81 87 <g:paginate total="${studyInstanceTotal}" /> 88 <br> 89 <INPUT TYPE=submit name=submit Value="Compare selected studies"> 82 90 </div> 83 91 </div> -
trunk/grails-app/views/study/show.gsp
r386 r389 49 49 </g:if> 50 50 <g:else> 51 51 ${studyInstance.giveEventTemplates().name} 52 52 </g:else> 53 53 <br> -
trunk/grails-app/views/wizard/pages/_events.gsp
r383 r389 17 17 <wizard:pageContent> 18 18 <span class="info"> 19 <span class="title">Define all events and their duration that occur in your study</span> 20 In the previous screen you defined the unique event types, in this screen you need to define 21 all events of a specific event type that occur in time. Select the type of event, and the 22 start and stop time of an event. As it is frequently the case that <i>sets</i> of events act 23 upon (groups of) subjects, you can define event groups, and add events to a particular group.<br/> 24 <i>Note that you can edit multiple events at once by selecting multpiple rows by either 25 ctrl-clicking them or dragging a selection over them.</i> 19 <span class="title">Define all events that occur in your study</span> 20 Bla bla bla we need a good help text here ;) 26 21 </span> 27 22 28 <wizard:templateElement name="template" description="Template" value="${ values?.template}" entity="${dbnp.studycapturing.Event}" addDummy="true" >23 <wizard:templateElement name="template" description="Template" value="${event?.template}" entity="${dbnp.studycapturing.Event}" addDummy="true" ajaxOnChange="switchTemplate" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()" > 29 24 The template to use for this study 30 25 </wizard:templateElement> 31 <wizard:timeElement name="startTime" description="Start Time" error="startTime" value="${values?.startTime}"> 32 The start time of the study 33 </wizard:timeElement> 34 <wizard:timeElement name="endTime" description="End time" error="endTimee" value="${values?.endTime}"> 35 The end time of the study 36 </wizard:timeElement> 37 <wizard:buttonElement name="add" value="Add" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()"/> 26 <g:if test="${event?.template}"><wizard:templateElements entity="${event}" /></g:if> 27 <g:if test="${event?.template}"><wizard:buttonElement name="add" value="Add" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()"/></g:if> 28 <% /* 38 29 <g:if test="${events}"> 39 30 <g:each var="event" status="i" in="${events}"> … … 42 33 <div class="firstColumn">#</div> 43 34 <div class="firstColumn"></div> 44 <div class="column">start</div> 45 <div class="column">end</div> 46 <div class="column">duration</div> 35 <div class="column">Template</div> 47 36 <wizard:templateColumnHeaders template="${event.template}" class="column" /> 48 37 <g:if test="${eventGroups}"><g:each var="eventGroup" status="g" in="${eventGroups}"> … … 61 50 <wizard:ajaxButton name="delete" src="../images/icons/famfamfam/delete.png" alt="delete this event" class="famfamfam" value="-" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" before="\$(\'input[name=do]\').val(${i});" afterSuccess="onWizardPage()" /> 62 51 </div> 63 <div class="column"><g:formatDate format="dd/MM/yyyy hh:mm" date="${event.startTime}" /></div> 64 <div class="column"><g:formatDate format="dd/MM/yyyy hh:mm" date="${event.endTime}" /></div> 65 <div class="column">${event.getShortDuration()}</div> 52 <div class="column">${event.template}</div> 66 53 <wizard:templateColumns id="${i}" entity="${event}" template="${event.template}" name="event${i}" class="column" /> 67 54 <g:if test="${eventGroups}"><g:each var="eventGroup" status="j" in="${eventGroups}"> … … 78 65 </div> 79 66 </g:each> 67 */ %> 80 68 <% /* 81 69 <div class="table"> … … 123 111 <div class="slider"></div> 124 112 </div> 113 </g:if> 125 114 */ %> 126 </g:if>127 115 128 116 </wizard:pageContent> -
trunk/grails-app/views/wizard/pages/_study.gsp
r359 r389 31 31 The start date of the study 32 32 </wizard:dateElement> 33 <wizard:templateElements entity="${study}" /> 34 33 <g:if test="${study}"><wizard:templateElements entity="${study}" /></g:if> 35 34 </wizard:pageContent> -
trunk/web-app/css/wizard.css
r362 r389 7 7 display: block; 8 8 border: 1px solid #006DBA; 9 background-color: # EEE;9 background-color: #f8feff; 10 10 padding: 10px; 11 11 font-size: 10px; -
trunk/web-app/css/wizard.min.css
r356 r389 1 .wizard{display:block;padding-top:10px;}.wizard .info{display:block;border:1px solid #006DBA;background-color:# EEE;padding:10px;font-size:10px;margin:10px 0 10px 0;}.wizard .info .title{color:#006DBA;font-size:14px;font-weight:normal;display:block;margin-bottom:5px;padding-left:20px;background:url(../images/icons/famfamfam/information.png) no-repeat center left;}.wizard .info .todo{color:#006DBA;font-size:14px;font-weight:normal;display:block;margin-bottom:5px;padding-left:20px;background:url(../images/icons/famfamfam/wrench.png) no-repeat center left;}.wizard .info .known{color:#006DBA;font-size:14px;font-weight:normal;display:block;margin-bottom:5px;padding-left:20px;background:url(../images/icons/famfamfam/eye.png) no-repeat center left;}.wizard .famfamfam{width:16px;height:16px;}.wizard .spinner{background:url(../images/spinner.gif) no-repeat left top;width:16px;height:16px;display:none;}.wizard .sliderContainer{display:block;margin-top:10px;width:150px;}.wizard .tabs{display:block;padding-bottom:2px;border-bottom:2px solid #006DBA;width:100%;}.wizard .tabs ul{list-style-type:none;padding:0;font-size:10px;margin:0;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;height:20px;width:100%;}.wizard .tabs img{border:0;}.wizard .tabs li{float:left;margin:0;height:20px;float:left;display:block;text-align:center;text-decoration:none;color:#006DBA;background:#CCC;font-weight:bold;}.wizard .tabs .content{padding:0 10px 0 10px;display:inline;border:0;}.wizard .tabs .active{background-color:#006DBA!important;color:#fff!important;}.wizard .tabs .arrow{position:inherit;margin-top:0;margin-bottom:0;display:inline;}.wizard .content{display:block;padding-bottom:10px;border-bottom:2px solid #006DBA;}.wizard .navigation{display:block;color:#666;font-size:10px;}.wizard .prevnext{cursor:pointer;color:#006DBA;background-color:transparent;border:none;}.wizard .element .input .isExample{color:#006DBA;background-color:transparent;border:0;input:disabled;}.wizard .element{display:block;}.wizard .element .description{display:inline-block;font-size:11px;width:250px;word-wrap:break-word;}.wizard .element .input{display:inline;}.wizard .error{background:url(../images/icons/famfamfam/exclamation.png) no-repeat 230px 4px;}.wizard .element .input input{vertical-align:top;border:1px solid #CCC;margin:2px 0;padding:2px 4px;}.wizard .element .input input:focus,select:focus,textarea:focus{border:1px solid #B2D1FF;}.wizard .element .helpIcon{display:inline-block;margin-top:4px;background:url(../images/icons/famfamfam/help.png) no-repeat left top;width:16px;height:16px;}.wizard .element .helpContent{display:none;}.wizard .element .help{vertical-align:top;display:inline-block;}.wizard .element .help .icon{margin-top:4px;background:url(../images/icons/famfamfam/help.png) no-repeat left top;width:16px;height:16px;}.wizard .element .help .content{display:none;}.wizard .table{display:block;border:1px solid #575a5d;background-color:#ebf7fc;margin-top:10px;font-size:11px;overflow:hidden;white-space:nowrap;}.wizard .table .header{display:block;background-color:#006DBA;color:#fff;font-weight:bold;width:auto;height:32px;line-height:32px;}.wizard .column{display:inline-block;padding:2px 4px;width:120px;}.wizard .firstColumn{display:inline-block;padding:2px 4px;width:20px;}.wizard .table .row{display:block;height:32px;border-top:1px solid #8e908f;width:auto;}.wizard .table .row input,.wizard .table .row select{background-color:#fff;}.wizard .table .ui-selected{background-color:#ffab7b;}.wizard .table .ui-selecting{background-color:#f2e3bc;}.wizard .table .row .warning{color:red;font-size:8px;height:10px;}.wizard .table .row .error{background-color:#ffb0b7;}.wizard .table input[type=text],.wizard .table select{border:1px solid #8e908f;margin:2px 0;padding:2px 4px;background-color:transparent;width:100px;}.wizard .table .header input[type=text],.wizard .table .header select,.wizard .table .header button{border:1px solid #8e908f;margin:2px 0;padding:2px 4px;background-color:#fff;width:75px;}.wizard .table .highlight,.wizard .table .highlight input,.wizard .table .highlight select{background-color:#006DBA;color:#fff;}.wizard .table .highlight input,.wizard .table .highlight select{background-color:#6e99d4;color:#fff;}.wizard .bigbutton{background:url(../images/wizard/big-button.jpg) no-repeat left top;border:0;width:454px;height:53px;color:#fff;font-size:18pt;}.wizard .bigbutton:hover{color:#000;}.wizard .bigtext{color:#006dba;font-weight:normal;font-size:24px;margin:.8em 0 .3em 0;display:block;width:100%;text-align:center;}.wizard option.addTerm{background:url(../images/icons/famfamfam/add.png) no-repeat left top;background-color:#666;padding-left:18px;height:16px;color:#c9e39c;font-weight:bold;}1 .wizard{display:block;padding-top:10px;}.wizard .info{display:block;border:1px solid #006DBA;background-color:#f8feff;padding:10px;font-size:10px;margin:10px 0 10px 0;}.wizard .info .title{color:#006DBA;font-size:14px;font-weight:normal;display:block;margin-bottom:5px;padding-left:20px;background:url(../images/icons/famfamfam/information.png) no-repeat center left;}.wizard .info .todo{color:#006DBA;font-size:14px;font-weight:normal;display:block;margin-bottom:5px;padding-left:20px;background:url(../images/icons/famfamfam/wrench.png) no-repeat center left;}.wizard .info .known{color:#006DBA;font-size:14px;font-weight:normal;display:block;margin-bottom:5px;padding-left:20px;background:url(../images/icons/famfamfam/eye.png) no-repeat center left;}.wizard .famfamfam{width:16px;height:16px;}.wizard .spinner{background:url(../images/spinner.gif) no-repeat left top;width:16px;height:16px;display:none;}.wizard .sliderContainer{display:block;margin-top:10px;width:150px;}.wizard .tabs{display:block;padding-bottom:2px;border-bottom:2px solid #006DBA;width:100%;}.wizard .tabs ul{list-style-type:none;padding:0;font-size:10px;margin:0;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;height:20px;width:100%;}.wizard .tabs img{border:0;}.wizard .tabs li{float:left;margin:0;height:20px;float:left;display:block;text-align:center;text-decoration:none;color:#006DBA;background:#CCC;font-weight:bold;}.wizard .tabs .content{padding:0 10px 0 10px;display:inline;border:0;}.wizard .tabs .active{background-color:#006DBA!important;color:#fff!important;}.wizard .tabs .arrow{position:inherit;margin-top:0;margin-bottom:0;display:inline;}.wizard .content{display:block;padding-bottom:10px;border-bottom:2px solid #006DBA;}.wizard .navigation{display:block;color:#666;font-size:10px;}.wizard .prevnext{cursor:pointer;color:#006DBA;background-color:transparent;border:none;}.wizard .element .input .isExample{color:#006DBA;background-color:transparent;border:0;input:disabled;}.wizard .element{display:block;}.wizard .element .description{display:inline-block;font-size:11px;width:250px;word-wrap:break-word;}.wizard .element .input{display:inline;}.wizard .error{background:url(../images/icons/famfamfam/exclamation.png) no-repeat 230px 4px;}.wizard .element .input input{vertical-align:top;border:1px solid #CCC;margin:2px 0;padding:2px 4px;}.wizard .element .input input:focus,select:focus,textarea:focus{border:1px solid #B2D1FF;}.wizard .element .helpIcon{display:inline-block;margin-top:4px;background:url(../images/icons/famfamfam/help.png) no-repeat left top;width:16px;height:16px;}.wizard .element .helpContent{display:none;}.wizard .element .help{vertical-align:top;display:inline-block;}.wizard .element .help .icon{margin-top:4px;background:url(../images/icons/famfamfam/help.png) no-repeat left top;width:16px;height:16px;}.wizard .element .help .content{display:none;}.wizard .table{display:block;border:1px solid #575a5d;background-color:#ebf7fc;margin-top:10px;font-size:11px;overflow:hidden;white-space:nowrap;}.wizard .table .header{display:block;background-color:#006DBA;color:#fff;font-weight:bold;width:auto;height:32px;line-height:32px;}.wizard .column{display:inline-block;padding:2px 4px;width:120px;}.wizard .firstColumn{display:inline-block;padding:2px 4px;width:20px;}.wizard .table .row{display:block;height:32px;border-top:1px solid #8e908f;width:auto;}.wizard .table .row input,.wizard .table .row select{background-color:#fff;}.wizard .table .ui-selected{background-color:#ffab7b;}.wizard .table .ui-selecting{background-color:#f2e3bc;}.wizard .table .row .warning{color:red;font-size:8px;height:10px;}.wizard .table .row .error{background-color:#ffb0b7;}.wizard .table input[type=text],.wizard .table select{border:1px solid #8e908f;margin:2px 0;padding:2px 4px;background-color:transparent;width:100px;}.wizard .table .header input[type=text],.wizard .table .header select,.wizard .table .header button{border:1px solid #8e908f;margin:2px 0;padding:2px 4px;background-color:#fff;width:75px;}.wizard .table .highlight,.wizard .table .highlight input,.wizard .table .highlight select{background-color:#006DBA;color:#fff;}.wizard .table .highlight input,.wizard .table .highlight select{background-color:#6e99d4;color:#fff;}.wizard .bigbutton{background:url(../images/wizard/big-button.jpg) no-repeat left top;border:0;width:454px;height:53px;color:#fff;font-size:18pt;}.wizard .bigbutton:hover{color:#000;}.wizard .bigtext{color:#006dba;font-weight:normal;font-size:24px;margin:.8em 0 .3em 0;display:block;width:100%;text-align:center;}
Note: See TracChangeset
for help on using the changeset viewer.