Changeset 454
- Timestamp:
- May 21, 2010, 10:04:49 AM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r453 r454 19 19 // define timezone 20 20 System.setProperty('user.timezone', 'CET') 21 22 // Ontologies must be connected to the templatefields in runtime 23 // because the Ontology.findByNcboId is not available otherwise 24 TemplateEntity.getField( Subject.domainFields, 'species' ).ontologies = [Ontology.findByNcboId(1132)] 25 TemplateEntity.getField( Sample.domainFields, 'material' ).ontologies = [Ontology.findByNcboId(1005)] 21 26 22 27 // we could also check if we are in development by GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT -
trunk/grails-app/controllers/dbnp/studycapturing/StudyController.groovy
r453 r454 1 1 package dbnp.studycapturing 2 2 /** 3 * 888 888 888 888 8888888888 8888888b. 8888888888 4 * 888 o 888 888 888 888 888 Y88b 888 5 * 888 d8b 888 888 888 888 888 888 888 6 * 888 d888b 888 8888888888 8888888 888 d88P 8888888 7 * 888d88888b888 888 888 888 8888888P" 888 8 * 88888P Y88888 888 888 888 888 T88b 888 9 * 8888P Y8888 888 888 888 888 T88b 888 10 * 888P Y888 888 888 8888888888 888 T88b 8888888888 11 * 12 * 8888888 .d8888b. 88888888888 888 888 8888888888 13 * 888 d88P Y88b 888 888 888 888 14 * 888 Y88b. 888 888 888 888 15 * 888 "Y888b. 888 8888888888 8888888 16 * 888 "Y88b. 888 888 888 888 17 * 888 "888 888 888 888 888 18 * 888 Y88b d88P 888 888 888 888 19 * 8888888 "Y8888P" 888 888 888 8888888888 20 * 21 * 888888 d8888 888 888 d8888 8888888b. .d88888b. .d8888b. 22 * "88b d88888 888 888 d88888 888 "Y88b d88P" "Y88b d88P Y88b 23 * 888 d88P888 888 888 d88P888 888 888 888 888 888 888 24 * 888 d88P 888 Y88b d88P d88P 888 888 888 888 888 888 25 * 888 d88P 888 Y88b d88P d88P 888 888 888 888 888 888 26 * 888 d88P 888 Y88o88P d88P 888 888 888 888 888 888 888 27 * 88P d8888888888 Y888P d8888888888 888 .d88P Y88b. .d88P Y88b d88P 28 * 888 d88P 888 Y8P d88P 888 8888888P" "Y88888P" "Y8888P" 29 * .d88P 30 * .d88P" 31 * 888P" 32 * 33 * .d8888b. 888 .d8888b. 888 .d8888b. 888 34 * d88P Y88b 888 d88P Y88b 888 d88P Y88b 888 35 * .d88P 888 .d88P 888 .d88P 888 36 * .d88P" 888 .d88P" 888 .d88P" 888 37 * 888" 888 888" 888 888" 888 38 * 888 Y8P 888 Y8P 888 Y8P 39 * " " " 40 * 888 888 888 888 888 888 41 * 42 * 43 * TODO: add PROPER class and method documentation, just like have 44 * agreed upon hundreds of times!!!! 3 * Controller class for studies 45 4 */ 46 5 class StudyController { … … 59 18 /** 60 19 * Shows a comparison of multiple studies using the show view 61 *62 20 * 63 21 */ 64 22 def list_extended = { 65 23 def startTime = System.currentTimeMillis() 66 24 params.max = Math.min(params.max ? params.int('max') : 10, 100) 67 25 68 render(view:'show',model:[studyList: Study.list(params), studyInstanceTotal: Study.count() ] ) 26 def studyList = Study.list(params) 27 render(view:'show',model:[studyList: studyList, studyInstanceTotal: Study.count(), multipleStudies: ( studyList.size() > 1 ) ] ) 69 28 } 70 29 … … 87 46 88 47 def show = { 48 def startTime = System.currentTimeMillis() 89 49 90 50 def studyInstance = Study.get(params.id) … … 97 57 // use the same view for showing the study and comparing multiple 98 58 // studies 99 [studyList: [ studyInstance ] ]59 [studyList: [ studyInstance ], multipleStudies: false ] 100 60 } 101 61 } -
trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy
r408 r454 19 19 * @return List 20 20 */ 21 List<TemplateField> giveDomainFields() { 21 List<TemplateField> giveDomainFields() { return Sample.domainFields } 22 static List<TemplateField> domainFields = 22 23 [ 23 24 new TemplateField( … … 27 28 new TemplateField( 28 29 name: 'material', 29 type: TemplateFieldType.ONTOLOGYTERM, 30 ontologies: [Ontology.findByNcboId(1005)]) 30 type: TemplateFieldType.ONTOLOGYTERM ) 31 31 ] 32 }33 32 34 33 static constraints = { -
trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy
r408 r454 21 21 * @return List 22 22 */ 23 List<TemplateField> giveDomainFields() { 23 List<TemplateField> giveDomainFields() { return Subject.domainFields } 24 static List<TemplateField> domainFields = 24 25 [ 25 26 new TemplateField( … … 29 30 new TemplateField( 30 31 name: 'species', 31 type: TemplateFieldType.ONTOLOGYTERM, 32 ontologies: [Ontology.findByNcboId(1132)]) 32 type: TemplateFieldType.ONTOLOGYTERM) 33 33 ] 34 }35 34 } -
trunk/grails-app/views/study/show.gsp
r453 r454 39 39 <table> 40 40 <!-- only show the head section if there are multiple studies --> 41 <g:if test="${ studyList.size()>1}">41 <g:if test="${multipleStudies}"> 42 42 <thead> 43 43 <tr> … … 144 144 <thead> 145 145 <tr> 146 <th></th> 146 <g:if test="${multipleStudies}"> 147 <th></th> 148 </g:if> 147 149 <g:each in="${new dbnp.studycapturing.Subject().giveDomainFields()}" var="field"> 148 150 <th>${field}</th> … … 187 189 } 188 190 } 189 190 191 %> 191 192 … … 208 209 <g:each in="${sortedSubjects}" var="subject" status="j"> 209 210 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 210 <g:if test="${ j==0}">211 <g:if test="${multipleStudies && j==0}"> 211 212 <td class="studytitle" rowspan="${sortedSubjects.size()}"> 212 213 ${studyInstance.title} … … 245 246 <thead> 246 247 <tr> 247 <th></th> 248 <g:if test="${multipleStudies}"> 249 <th></th> 250 </g:if> 248 251 <th>Start time</th> 249 252 <th>Duration</th> … … 269 272 <g:each in="${sortedEvents}" var="event" status="j"> 270 273 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 271 <g:if test="${ j==0}">274 <g:if test="${multipleStudies && j==0}"> 272 275 <td class="studytitle" rowspan="${sortedEvents.size()}"> 273 276 ${studyInstance.title} … … 321 324 <thead> 322 325 <tr> 323 <th></th> 326 <g:if test="${multipleStudies}"> 327 <th></th> 328 </g:if> 324 329 <th>Name</th> 325 330 <th colspan="${groupTemplates.size()}">Events</th> … … 327 332 </tr> 328 333 <tr> 329 <th></th> 334 <g:if test="${multipleStudies}"> 335 <th></th> 336 </g:if> 330 337 <th></th> 331 338 <g:each in="${groupTemplates}" var="eventTemplate"> … … 342 349 <g:each in="${studyInstance.eventGroups}" var="eventGroup" status="j"> 343 350 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 344 <g:if test="${ j==0}">351 <g:if test="${multipleStudies && j==0}"> 345 352 <td class="studytitle" rowspan="${studyInstance.eventGroups.size()}"> 346 353 ${studyInstance.title} … … 389 396 <thead> 390 397 <tr> 391 <th></th> 398 <g:if test="${multipleStudies}"> 399 <th></th> 400 </g:if> 392 401 <th width="100">Assay Name</th> 393 402 <th width="100">Module</th> … … 403 412 <g:each in="${studyInstance.assays}" var="assay" status="j"> 404 413 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 405 <g:if test="${ j==0}">414 <g:if test="${multipleStudies && j==0}"> 406 415 <td class="studytitle" rowspan="${studyInstance.assays.size()}"> 407 416 ${studyInstance.title} … … 442 451 <th>Phone</th> 443 452 <th>Email</th> 444 <g:each in="${studyList}" var="studyInstance"> 445 <th>${studyInstance.title}</th> 446 </g:each> 453 <g:if test="${multipleStudies}"> 454 <g:each in="${studyList}" var="studyInstance"> 455 <th>${studyInstance.title}</th> 456 </g:each> 457 </g:if> 458 <g:else> 459 <th>Role</th> 460 </g:else> 447 461 </thead> 448 462 </tr> … … 487 501 <th>Authors</th> 488 502 <th>Comments</th> 489 <g:each in="${studyList}" var="studyInstance"> 490 <th>${studyInstance.title}</th> 491 </g:each> 503 504 <g:if test="${multipleStudies}"> 505 <g:each in="${studyList}" var="studyInstance"> 506 <th>${studyInstance.title}</th> 507 </g:each> 508 </g:if> 492 509 </thead> 493 510 </tr> … … 499 516 </td> 500 517 <td>${publication.comments}</td> 501 <g:each in="${studyList}" var="studyInstance"> 502 <td> 503 <g:if test="${publication in studyInstance.publications}"> 504 x 505 </g:if> 506 </td> 507 </g:each> 518 <g:if test="${multipleStudies}"> 519 <g:each in="${studyList}" var="studyInstance"> 520 <td> 521 <g:if test="${publication in studyInstance.publications}"> 522 x 523 </g:if> 524 </td> 525 </g:each> 526 </g:if> 508 527 </tr> 509 528 </g:each>
Note: See TracChangeset
for help on using the changeset viewer.