Changeset 353
- Timestamp:
- Apr 20, 2010, 10:49:54 AM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r349 r353 92 92 .with { if (!validate()) { errors.each { println it} } else save()} 93 93 94 // add NCBI species ontology 95 println ".adding NCBI species ontology" 96 def speciesOntology = new Ontology( 97 name: 'NCBI organismal classification', 98 description: 'A taxonomic classification of living organisms and associated artifacts for their controlled description within the context of databases.', 99 url: 'http://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/', 100 versionNumber: '1.2', 101 ncboId: '1132', 102 ncboVersionedId: '38802' 103 ).with { if (!validate()) { errors.each { println it} } else save()} 104 105 // add TERMS 106 println ".adding mouse term" 107 def mouseTerm = new Term( 108 name: 'Mus musculus', 109 ontology: speciesOntology, 110 accession: '10090' 111 ).with { if (!validate()) { errors.each { println it} } else save()} 112 println ".adding human term" 113 def humanTerm = new Term( 114 name: 'Homo sapiens', 115 ontology: speciesOntology, 116 accession: '9606' 117 ).with { if (!validate()) { errors.each { println it} } else save()} 94 118 95 119 -
trunk/grails-app/domain/dbnp/data/Term.groovy
r350 r353 19 19 String name // BioPortal: label (preferred name) 20 20 Ontology ontology // Parent ontology 21 String accession // BioPortal: fullId21 String accession // BioPortal: conceptId 22 22 23 23 static constraints = { -
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r349 r353 401 401 402 402 /** 403 * Button form element 404 * @param Map attributes 405 * @param Closure help content 406 */ 407 def buttonElement = {attrs, body -> 408 // render template element 409 baseElement.call( 410 'ajaxButton', 411 attrs, 412 body 413 ) 414 } 415 416 417 /** 418 * Term form element 419 * @param Map attributes 420 * @param Closure help content 421 */ 422 def termElement = { attrs, body -> 423 // render term element 424 baseElement.call( 425 'termSelect', 426 attrs, 427 body 428 ) 429 } 430 431 /** 432 * Term select element 433 * @param Map attributes 434 */ 435 def termSelect = { attrs -> 436 def from = [] 437 438 // got ontologies? 439 if (attrs.ontology) { 440 attrs.ontology.split(/\,/).each() { ncboId -> 441 // trim the id 442 ncboId.trim() 443 444 // fetch all terms for this ontology 445 def ontology = Ontology.findAllByNcboId(ncboId) 446 447 // does this ontology exist? 448 if (ontology) { 449 ontology.each() { 450 Term.findAllByOntology(it).each() { 451 // key = ncboId:concept-id 452 from[ from.size() ] = it.name 453 } 454 } 455 } 456 } 457 458 // sort alphabetically 459 from.sort() 460 461 // define 'from' 462 attrs.from = from 463 464 out << select(attrs) 465 } else { 466 out << "you should specify: <i>ontology=\"id\"</i> or <i>ontology=\"id1,id2,...,idN\"</i>" 467 } 468 } 469 470 /** 403 471 * Template form element 404 472 * @param Map attributes … … 409 477 baseElement.call( 410 478 'speciesSelect', 411 attrs,412 body413 )414 }415 416 /**417 * Button form element418 * @param Map attributes419 * @param Closure help content420 */421 def buttonElement = {attrs, body ->422 // render template element423 baseElement.call(424 'ajaxButton',425 479 attrs, 426 480 body … … 564 618 return false 565 619 } 566 }567 568 /**569 * Term form element570 * @param Map attributes571 * @param Closure help content572 */573 def termElement = {attrs, body ->574 // render term element575 baseElement.call(576 'termSelect',577 attrs,578 body579 )580 }581 582 /**583 * render a term select element584 * @param Map attrs585 */586 def termSelect = {attrs ->587 // fetch all terms588 attrs.from = Term.findAll() // for now, all terms as we cannot identify terms as being treatment terms...589 590 // got a name?591 if (!attrs.name) {592 attrs.name = 'term'593 }594 595 out << select(attrs)596 620 } 597 621 -
trunk/grails-app/views/wizard/pages/_subjects.gsp
r349 r353 29 29 The species of the subjects you would like to add to your study 30 30 </wizard:ontologyElement> 31 <wizard:termElement name="species" description="of species" value="" ontology="1132"> 32 The species of the subjects you would like to add to your study 33 </wizard:termElement> 31 34 <wizard:templateElement name="template" description="with template" value="" error="template" entity="${dbnp.studycapturing.Subject}" > 32 35 The template to use for this study
Note: See TracChangeset
for help on using the changeset viewer.