- Timestamp:
- Nov 4, 2010, 12:23:20 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/TemplateEditorController.groovy
r1062 r1077 747 747 } catch( Exception e ) { 748 748 response.status = 500; 749 render e.getMessage();749 render 'Ontology with ID ' + id + ' not found'; 750 750 return; 751 751 } … … 770 770 771 771 /** 772 * Adds a ontolgy based on the ID given772 * Adds a ontolgy based on the term ID given 773 773 * 774 774 * @param ncboID 775 775 * @return JSON Ontology object 776 * @deprecated User addOntologyById instead, using the ncboId given by the JSON call 776 777 */ 777 778 def addOntologyByTerm = { … … 790 791 } catch( Exception e ) { 791 792 response.status = 500; 792 render e.getMessage(); 793 794 if( e.getMessage() ) 795 render e.getMessage() 796 else 797 render "Unknown error: " + e.getClass() 793 798 return; 794 799 } … … 811 816 render ontology as JSON 812 817 } 813 814 818 815 819 /** -
trunk/grails-app/views/templateEditor/template.gsp
r1029 r1077 22 22 <link rel="stylesheet" href="${createLinkTo(dir: 'css', file: 'templateEditor.css')}" /> 23 23 <g:if env="production"> 24 <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.min.js')}"></script> 24 <script type="text/javascript" src="${resource(dir: 'js', file: 'jquery.ui.autocomplete.html.min.js')}"></script> 25 <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.min.js')}"></script> 25 26 </g:if><g:else> 27 <script type="text/javascript" src="${resource(dir: 'js', file: 'jquery.ui.autocomplete.html.js')}"></script> 26 28 <script type="text/javascript" src="${resource(dir: 'js', file: 'ontology-chooser.js')}"></script> 27 29 </g:else> -
trunk/web-app/js/ontology-chooser.js
r1005 r1077 19 19 * we use 'ontology' instead of 'bp_form_complete' to 20 20 * identify ontology fields. 21 * 22 * N.B. In order to show the labels of the terms correctly (i.e. 23 * no ugly HTML tags, you also have to include jquery.ui.autocomplete.html.js 24 * in your page! 21 25 * 22 26 * @author Jeroen Wesbeek … … 145 149 that.setInputValue(element, 'concept_id', ui.item.concept_id); 146 150 that.setInputValue(element, 'ontology_id', ui.item.ontology_id); 151 that.setInputValue(element, 'ncbo_id', ui.item.ncbo_id); 147 152 that.setInputValue(element, 'full_id', ui.item.full_id); 148 153 … … 165 170 that.setInputValue(element, 'concept_id', ''); 166 171 that.setInputValue(element, 'ontology_id', ''); 172 that.setInputValue(element, 'ncbo_id', ''); 167 173 that.setInputValue(element, 'full_id', ''); 168 174 … … 218 224 parsed[ parsed.length ] = { 219 225 value : cols[0], 220 label : cols[0] + ' <span class="about">(' + cols[2] + ')</span> <span class="from">from: ' + cols[ (cols.length- 1) ] + '</span>',226 label : cols[0] + ' <span class="about">(' + cols[2] + ')</span> <span class="from">from: ' + cols[ (cols.length-2) ] + '</span>', 221 227 preferred_name : cols[0], // e.g. Mus musculus musculus 222 228 concept_id : cols[1], // e.g. birnlex_161 223 229 ontology_id : cols[3], // e.g. 29684 224 full_id : cols[4] // e.g. http://bioontology.org/projects/ontologies/birnlex#birnlex_161 230 full_id : cols[4], // e.g. http://bioontology.org/projects/ontologies/birnlex#birnlex_161 231 ncbo_id : cols[8] // e.g. 1494 225 232 } 226 233 } -
trunk/web-app/js/templateEditor.js
r1056 r1077 626 626 627 627 // Create a URL to call and call it 628 if( $( '#ncboID ' ).val() ) {628 if( $( '#ncboIDText' ).val() ) { 629 629 url = baseUrl + '/templateEditor/addOntologyById'; 630 data = 'ncboID=' + $( '#ncboID ' ).val();630 data = 'ncboID=' + $( '#ncboIDText' ).val(); 631 631 $( '#ncbo_spinner' ).show(); 632 632 } else { 633 url = baseUrl + '/templateEditor/addOntologyByTerm'; 634 data = 'termID=' + $( '#termID' ).val(); 633 // url = baseUrl + '/templateEditor/addOntologyByTerm'; 634 // data = 'termID=' + $( '#addOntology input[name=termID-ontology_id]' ).val(); 635 url = baseUrl + '/templateEditor/addOntologyById'; 636 data = 'ncboID=' + $( '#addOntology input[name=termID-ncbo_id]' ).val(); 637 635 638 $( '#term_spinner' ).show(); 636 639 }
Note: See TracChangeset
for help on using the changeset viewer.