Changeset 92 for trunk/grails-app/conf/BootStrap.groovy
- Timestamp:
- Jan 19, 2010, 2:25:45 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r34 r92 1 1 import org.codehaus.groovy.grails.commons.GrailsApplication 2 2 import grails.util.GrailsUtil 3 import dbnp.studycapturing.* 4 import intient.nimble.InstanceGenerator 3 5 4 6 /** 5 7 * Application Bootstrapper 6 * @Author 7 * @Since 8 * @Author Jeroen Wesbeek 9 * @Since 20091021 8 10 * 9 11 * Revision information: … … 13 15 */ 14 16 class BootStrap { 15 def init = { servletContext -> 16 // check if we're in development 17 if (GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) { 18 printf("development bootstrapping....\n\n"); 19 20 } 21 } 22 def destroy = { 23 } 17 def init = {servletContext -> 18 if (GrailsUtil.environment == GrailsApplication.ENV_DEVELOPMENT) { 19 printf("development bootstrapping....\n\n"); 20 21 // ontologies 22 def speciesOntology = new Ontology( 23 name: 'Species', 24 shortName: 'Species', 25 url: 'http://www.obofoundry.org/cgi-bin/detail.cgi?id=ncbi_taxonomy' 26 ).save() 27 28 // terms 29 def mouseTerm = new Term( 30 name: 'Mus musculus', 31 ontology: speciesOntology, 32 accession: '10090' 33 ).save() 34 def humanTerm = new Term( 35 name: 'Homo sapiens', 36 ontology: speciesOntology, 37 accession: '9606' 38 ).save() 39 40 // create system user 41 /* 42 def systemUser = userService.createUser(InstanceGenerator.user( 43 username: 'system', 44 pass: 'system', 45 passConfirm: 'system', 46 enabled: true 47 )) 48 */ 49 50 // define template fields 51 def genotypeTemplateField = new TemplateSubjectField( 52 name: 'Genotype', 53 type: TemplateFieldType.STRINGLIST 54 ).save() 55 56 // Mouse template 57 def mouseTemplate = new Template( 58 name: 'Mouse' 59 ).addToSubjectFields(genotypeTemplateField).save() 60 } 61 } 62 63 def destroy = { 64 } 24 65 }
Note: See TracChangeset
for help on using the changeset viewer.