Changeset 459


Ignore:
Timestamp:
May 25, 2010, 12:05:59 PM (13 years ago)
Author:
vinlud
Message:

Check empty string ontology selector

Location:
trunk/grails-app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/studycapturing/TermEditorController.groovy

    r456 r459  
    6666                                println params
    6767                                def ontology = Ontology.findByNcboVersionedId( params.get('term-ontology_id') as int )
     68                def strTerm = params.get('term')
    6869
    6970                                // do we have an ontology?
     
    7172                                        // TODO: if ontology is missing, create it
    7273                    // pending possible addition to OntoCAT BioportalOntologyService API of search by versioned Ontology Id
     74                    println "Ontology is empty"
    7375                                }
    7476
    7577                                // instantiate term with parameters
    7678                                def term = new Term(
    77                                         name: params.get('term'),
     79                                        name: strTerm,
    7880                                        ontology: ontology,
    7981                                        accession: params.get('term-concept_id')
     
    9294                                                println it
    9395                                        }
    94                                         flash.errors = term.errors
    9596                                        error()
    9697                    flash.message = "Term addition failed"
  • trunk/grails-app/domain/dbnp/data/Term.groovy

    r398 r459  
    2424                accession(unique: 'ontology')   // Accession should be unique within an ontology
    2525                name(unique: 'ontology')        // Preferred name should be unique within an ontology
     26        name(size: 1..255)              // Name should be a non-empty string
    2627        }
    2728
Note: See TracChangeset for help on using the changeset viewer.