Changeset 936 for trunk/grails-app/conf


Ignore:
Timestamp:
Oct 11, 2010, 10:23:13 PM (11 years ago)
Author:
t.w.abma@…
Message:
  • Nimble removed, AAAA-plugin installed (based on Spring Security), login panel needs fix still, please login using gscf/login
Location:
trunk/grails-app/conf
Files:
4 deleted
4 edited

Legend:

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

    r860 r936  
    66import org.codehaus.groovy.grails.commons.GrailsApplication
    77import grails.util.GrailsUtil
     8import org.nmcdsp.plugins.aaaa.SecUser
    89
    9 // Imports for Nimble
    10 import grails.plugins.nimble.InstanceGenerator
    11 import grails.plugins.nimble.core.LevelPermission
    12 import grails.plugins.nimble.core.Role
    13 import grails.plugins.nimble.core.Group
    14 import grails.plugins.nimble.core.AdminsService
    15 import grails.plugins.nimble.core.UserService
    1610
    1711/**
     
    2620 */
    2721class BootStrap {
    28 
    29         // Injections for Nimble
    30         def grailsApplication
    31         def nimbleService
    32         def userService
    33         def adminsService
     22        def springSecurityService
    3423
    3524        def init = {servletContext ->
     
    3726                System.setProperty('user.timezone', 'CET')
    3827
    39                 // If there are no users yet in the database
    40                 println "Executing Nimble bootstrap..."
    41 
    42             // The following must be executed
    43             nimbleService.init()
    44 
    45             // Add users
    46                 def user
    47 
    48                 if (dbnp.user.User.count() == 0) {
    49                         println "Adding example user..."
    50 
    51                         // Create example User account
    52                         user = InstanceGenerator.user()
    53                         user.username = "user"
    54                         user.pass = 'useR123!'
    55                         user.passConfirm = 'useR123!'
    56                         user.enabled = true
    57 
    58                         def userProfile = InstanceGenerator.profile()
    59                         userProfile.fullName = "Test User"
    60                         userProfile.owner = user
    61                         user.profile = userProfile
    62 
    63                         def savedUser = userService.createUser(user)
    64                         if (savedUser.hasErrors()) {
    65                           savedUser.errors.each {
    66                                 log.error(it)
    67                           }
    68                           throw new RuntimeException("Error creating example user")
    69                         }
    70 
    71                         println "Adding example admin user..."
    72 
    73                         // Create example Administrative account
    74                         def admins = Role.findByName(AdminsService.ADMIN_ROLE)
    75                         def admin = InstanceGenerator.user()
    76                         admin.username = "admin"
    77                         admin.pass = "admiN123!"
    78                         admin.passConfirm = "admiN123!"
    79                         admin.enabled = true
    80 
    81                         def adminProfile = InstanceGenerator.profile()
    82                         adminProfile.fullName = "Administrator"
    83                         adminProfile.owner = admin
    84                         admin.profile = adminProfile
    85 
    86                         def savedAdmin = userService.createUser(admin)
    87                         if (savedAdmin.hasErrors()) {
    88                           savedAdmin.errors.each {
    89                                 log.error(it)
    90                           }
    91                           throw new RuntimeException("Error creating administrator")
    92                         }
    93 
    94                         adminsService.add(admin)
    95                 }
    96                 else {
    97                         user = dbnp.user.User.findByUsername("user")
    98                 }
    99 
    100                 println "Done with Nimble bootstrap"
     28                def user = SecUser.findByUsername('user') ?: new SecUser(
     29                        username: 'user',
     30                        password: springSecurityService.encodePassword('useR123!'),
     31                        enabled: true).save(failOnError: true)
     32               
     33                println "Done with SpringSecurity bootstrap, created [user]."
    10134
    10235                // If there are no templates yet in the database
  • trunk/grails-app/conf/BootStrapStudies.groovy

    r882 r936  
    1919         */
    2020
    21         public static void addExampleStudies(dbnp.user.User owner) {
     21        public static void addExampleStudies(org.nmcdsp.plugins.aaaa.SecUser owner) {
    2222
    2323                // Look up the used ontologies which should be in the database by now
  • trunk/grails-app/conf/BuildConfig.groovy

    r776 r936  
    1818 */
    1919//grails.plugin.repos.discovery.intient = "http://intient.com/downloads/grails/"
    20 return true;
     20grails.project.dependency.resolution = {
     21    // inherit Grails' default dependencies
     22    inherits("global") {
     23        // uncomment to disable ehcache
     24        // excludes 'ehcache'
     25    }
     26    log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
     27    repositories {
     28        grailsPlugins()
     29        grailsHome()
     30//        mavenRepo "http://nmcdsp.org:8080/nexus-webapp-1.7.2/content/repositories/releases/"
     31        mavenRepo "http://nexus.nmcdsp.org/content/repositories/releases"
     32        grailsCentral()
     33
     34        // uncomment the below to enable remote dependency resolution
     35        // from public Maven repositories
     36        //mavenLocal()
     37        //mavenCentral()
     38        //mavenRepo "http://snapshots.repository.codehaus.org"
     39        //mavenRepo "http://repository.codehaus.org"
     40        //mavenRepo "http://download.java.net/maven/2/"
     41        //mavenRepo "http://repository.jboss.com/maven2/"
     42    }
     43    dependencies {
     44        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
     45
     46        // runtime 'mysql:mysql-connector-java:5.1.5'
     47    }
     48}
     49
     50//grails.plugin.location.'aaaa' = '/home/tjeerd/NetBeansProjects/nmcdsp/aaaa'
  • trunk/grails-app/conf/Config.groovy

    r931 r936  
    156156grails.views.javascript.library="jquery"
    157157
     158// Needed for the Spring Security Core plugin:
     159grails.plugins.springsecurity.userLookup.userDomainClassName = 'org.nmcdsp.plugins.aaaa.SecUser'
     160grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'org.nmcdsp.plugins.aaaa.SecUserSecRole'
     161grails.plugins.springsecurity.authority.className = 'org.nmcdsp.plugins.aaaa.SecRole'
     162
    158163// The OAuth consumer key and secret variables are currently replaced by Jeroen's Continuous Integration script.
    159164// These keys were requested by me (Tjeerd) from myExperiment.
Note: See TracChangeset for help on using the changeset viewer.