Changeset 573
- Timestamp:
- Jun 16, 2010, 4:17:36 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/TermEditorController.groovy
r565 r573 67 67 68 68 // use the NCBO REST service to fetch ontology information 69 def url = "http://rest.bioontology.org/bioportal/ontologies/" + params.get('term-ontology_id') 70 def xml = new URL( url ).getText() 71 def data = new XmlParser().parseText( xml ) 72 def bean = data.data.ontologyBean 69 try { 70 def url = "http://rest.bioontology.org/bioportal/ontologies/" + params.get('term-ontology_id') 71 def xml = new URL( url ).getText() 72 def data = new XmlParser().parseText( xml ) 73 def bean = data.data.ontologyBean 73 74 74 // instantiate Ontology with the proper values75 ontology = Ontology.getBioPortalOntologyByVersionedId( params.get('term-ontology_id') ).save(flush:true)76 println ontology75 // instantiate Ontology with the proper values 76 ontology = Ontology.getBioPortalOntologyByVersionedId( params.get('term-ontology_id') ).save(flush:true) 77 println ontology 77 78 78 if (ontology.validate()) { 79 ontology.save(flush:true) 79 if (ontology.validate()) { 80 ontology.save(flush:true) 81 } 82 } catch (Exception e) { 83 // something went wrong, probably the 84 // ontology-id is invalid (hence, the term 85 // is invalid) 80 86 } 81 println ontology82 87 } 83 88
Note: See TracChangeset
for help on using the changeset viewer.