Changeset 399
- Timestamp:
- May 10, 2010, 4:32:45 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r396 r399 439 439 440 440 // got ontologies? 441 if (attrs.ontology) { 442 attrs.ontology.split(/\,/).each() { ncboId -> 443 // trim the id 444 ncboId.trim() 445 446 // fetch all terms for this ontology 447 def ontology = Ontology.findAllByNcboId(ncboId) 448 449 // does this ontology exist? 450 if (ontology) { 451 ontology.each() { 452 Term.findAllByOntology(it).each() { 453 // key = ncboId:concept-id 454 from[ from.size() ] = it.name 441 if (attrs.ontologies) { 442 // are the ontologies a string? 443 if (attrs.ontologies instanceof String) { 444 attrs.ontologies.split(/\,/).each() { ncboId -> 445 // trim the id 446 ncboId.trim() 447 448 // fetch all terms for this ontology 449 def ontology = Ontology.findAllByNcboId(ncboId) 450 451 // does this ontology exist? 452 if (ontology) { 453 ontology.each() { 454 Term.findAllByOntology(it).each() { 455 // key = ncboId:concept-id 456 from[ from.size() ] = it.name 457 } 455 458 } 456 459 } 460 } 461 } else if (attrs.ontologies instanceof Set) { 462 // are they a set instead? 463 def ontologyList = "" 464 465 // iterate through set 466 attrs.ontologies.each() { ontology -> 467 ontologyList += ontology.ncboId + "," 468 469 Term.findAllByOntology(ontology).each() { 470 from[ from.size() ] = it.name 471 } 472 473 // strip trailing comma 474 attrs.ontologies = ontologyList[0..-2] 457 475 } 458 476 } … … 469 487 out << select(attrs) 470 488 } else { 471 out << " you should specify: <i>ontology=\"id\"</i> or <i>ontology=\"id1,id2,...,idN\"</i>"489 out << "<b>ontologies missing!</b>" 472 490 } 473 491 } … … 733 751 // @see http://www.bioontology.org/wiki/index.php/NCBO_Widgets#Term-selection_field_on_a_form 734 752 // @see ontology-chooser.js 753 inputElement = (renderType == 'element') ? 'termElement' : 'termSelect' 754 755 if (it.ontologies) { 756 out << "$inputElement"( 757 description : it.name, 758 name : prependName + it.escapedName(), 759 value : fieldValue, 760 ontologies : it.ontologies 761 ) 762 } else { 763 out << "$inputElement"( 764 description : it.name, 765 name : prependName + it.escapedName(), 766 value : fieldValue 767 ) 768 } 769 break 770 case 'ONTOLOGYTERM-old': 771 // @see http://www.bioontology.org/wiki/index.php/NCBO_Widgets#Term-selection_field_on_a_form 772 // @see ontology-chooser.js 735 773 inputElement = (renderType == 'element') ? 'textFieldElement' : 'textField' 736 774 out << "$inputElement"( -
trunk/grails-app/views/wizard/pages/_subjects.gsp
r396 r399 26 26 The number of subjects to add to your study 27 27 </wizard:textFieldElement> 28 <wizard:termElement name="species" description="of species" value="" ontolog y="1132">28 <wizard:termElement name="species" description="of species" value="" ontologies="1132"> 29 29 The species of the subjects you would like to add to your study 30 30 </wizard:termElement> -
trunk/web-app/js/wizard.js
r372 r399 51 51 rel : 'term', 52 52 url : '/gscf/termEditor', 53 vars : 'ontolog y',53 vars : 'ontologies', 54 54 label : 'add more...', 55 55 class : 'addMore',
Note: See TracChangeset
for help on using the changeset viewer.