Changeset 488
- Timestamp:
- May 27, 2010, 4:10:12 PM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/DataSource.groovy
r486 r488 64 64 url = "jdbc:postgresql://localhost:5432/gscf" 65 65 dialect = org.hibernate.dialect.PostgreSQLDialect 66 logSql = true 66 logSql = true // enable logging while not yet final 67 68 /* Apparently Hibernate performs two queries on inserting, one before 69 * to generate the unique id, and then the insert itself. In PostgreSQL 70 * > 8.2 this behaviour has changed, however hibernate has not implemented 71 * this change. In case we might optimize in the future, more info is here: 72 * http://blog.wolfman.com/articles/2009/11/11/using-postgresql-with-grails 73 * - Jeroen 74 */ 67 75 68 76 // MySQL -
trunk/grails-app/controllers/dbnp/studycapturing/TermEditorController.groovy
r486 r488 48 48 flow.ontologiesList[ flow.ontologies.size() ] = ncboId 49 49 } 50 51 /*** EXAMPLE OF HOW TO FETCH ONTOLOGY INSTANCES52 * ontologies.each() {53 * println Ontology.findAllByNcboId( it )54 * }55 */56 50 } 57 51 } … … 61 55 render(view: "terms") 62 56 onRender { 63 println " Rendering term selection popup"57 println ".rendering term selection popup" 64 58 } 65 59 on("add") { 66 println params67 60 def ontology = Ontology.findByNcboVersionedId( params.get('term-ontology_id') as int ) 68 61 def strTerm = params.get('term') … … 72 65 // TODO: if ontology is missing, create it 73 66 // pending possible addition to OntoCAT BioportalOntologyService API of search by versioned Ontology Id 74 println "Ontology is empty"75 67 } 76 68 … … 84 76 // validate term 85 77 if (term.validate()) { 86 println "Term validated correctly"78 // save the term to the database 87 79 if (term.save(flush:true)) { 88 println ".term save ok" 80 flash.message = "Term addition succeeded" 81 success() 89 82 } else { 90 println ".term save failed?" 83 flash.message = "Oops, we encountered a problem while storing the selected term. Please try again." 84 error() 91 85 } 92 success()93 flash.message = "Term addition succeeded"94 86 } else { 95 println "Term validation failed" 96 println "errors:" 97 term.errors.getAllErrors().each() { 98 println it 99 } 87 // term did not validate properly 88 flash.message = "Oops, we encountered a problem while storing the selected term. Please try again." 100 89 error() 101 flash.message = "Term addition failed"102 90 } 103 91 }.to "terms"
Note: See TracChangeset
for help on using the changeset viewer.