Changeset 1048 for trunk/grails-app/conf


Ignore:
Timestamp:
Nov 2, 2010, 1:24:45 PM (12 years ago)
Author:
j.a.m.wesbeek@…
Message:
  • upgraded the grom plugin to 0.1.11, should fix the issues on tomcat
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r1025 r1048  
    77import grails.util.GrailsUtil
    88import dbnp.authentication.*
    9 
    109
    1110/**
     
    2019 */
    2120class BootStrap {
    22     def springSecurityService
     21        def springSecurityService
    2322
    2423        def init = {servletContext ->
     
    2625                System.setProperty('user.timezone', 'CET')
    2726
    28                 def adminRole = SecRole.findByAuthority( 'ROLE_ADMIN' ) ?: new SecRole( authority: 'ROLE_ADMIN' ).save()
     27                "Bootstrapping application".grom()
    2928
    30                 def user = SecUser.findByUsername('user') ?: new SecUser(
    31                            username: 'user',
    32                            password: springSecurityService.encodePassword( 'useR123!', 'user' ),
    33                            email: 'user@dbnp.org',
    34                            userConfirmed: true, adminConfirmed: true).save(failOnError: true)
     29                def adminRole = SecRole.findByAuthority('ROLE_ADMIN') ?: new SecRole(authority: 'ROLE_ADMIN').save()
    3530
    36                 def userAdmin = SecUser.findByUsername('admin') ?: new SecUser(
    37                                 username: 'admin',
    38                                 password: springSecurityService.encodePassword( 'admiN123!', 'admin' ),
    39                                 email: 'admin@dbnp.org',
    40                                 userConfirmed: true, adminConfirmed: true).save(failOnError: true)
     31                def user = SecUser.findByUsername('user') ?: new SecUser(
     32                        username: 'user',
     33                        password: springSecurityService.encodePassword('useR123!', 'user'),
     34                        email: 'user@dbnp.org',
     35                        userConfirmed: true, adminConfirmed: true).save(failOnError: true)
    4136
    42                 // Make the admin user an administrator
    43                 SecUserSecRole.create userAdmin, adminRole, true
     37                def userAdmin = SecUser.findByUsername('admin') ?: new SecUser(
     38                        username: 'admin',
     39                        password: springSecurityService.encodePassword('admiN123!', 'admin'),
     40                        email: 'admin@dbnp.org',
     41                        userConfirmed: true, adminConfirmed: true).save(failOnError: true)
    4442
    45                 def userTest = SecUser.findByUsername('test') ?: new SecUser(
    46                                 username: 'test',
    47                                 password: springSecurityService.encodePassword( 'useR123!', 'test' ),
    48                                 email: 'test@dbnp.org',
    49                             userConfirmed: true, adminConfirmed: true).save(failOnError: true)
     43                // Make the admin user an administrator
     44                SecUserSecRole.create userAdmin, adminRole, true
    5045
    51                 println "Done with SpringSecurity bootstrap, created [user, admin, test]."
     46                def userTest = SecUser.findByUsername('test') ?: new SecUser(
     47                        username: 'test',
     48                        password: springSecurityService.encodePassword('useR123!', 'test'),
     49                        email: 'test@dbnp.org',
     50                        userConfirmed: true, adminConfirmed: true).save(failOnError: true)
     51
     52                println "Done with SpringSecurity bootstrap, created [user, admin, test]."
    5253
    5354                // If there are no templates yet in the database
     
    6869                        if (Study.count() == 0 && grails.util.GrailsUtil.environment != GrailsApplication.ENV_TEST) {
    6970                                // check if special file is present in project directory
    70                                 if ((new File(System.properties['user.dir']+"/.skip-studies").exists())) {
     71                                if ((new File(System.properties['user.dir'] + "/.skip-studies").exists())) {
     72                                        "Skipping study bootstrapping".grom()
     73
    7174                                        // get species ontology
    7275                                        def speciesOntology = Ontology.getOrCreateOntologyByNcboId(1132)
     
    7780                                                ontology: speciesOntology,
    7881                                                accession: '10090'
    79                                         ).with { if (!validate()) { errors.each { println it} } else save(flush:true)}
     82                                        ).with { if (!validate()) { errors.each { println it} } else save(flush: true)}
    8083
    8184                                        def humanTerm = new Term(
     
    8386                                                ontology: speciesOntology,
    8487                                                accession: '9606'
    85                                         ).with { if (!validate()) { errors.each { println it} } else save(flush:true)}
     88                                        ).with { if (!validate()) { errors.each { println it} } else save(flush: true)}
    8689                                } else {
     90                                        "Bootstrapping Studies".grom()
     91                                       
    8792                                        // general study boostrapping
    8893                                        BootStrapStudies.addExampleStudies(user, userAdmin)
Note: See TracChangeset for help on using the changeset viewer.