Changeset 936 for trunk/grails-app/conf
- Timestamp:
- Oct 11, 2010, 10:23:13 PM (13 years ago)
- Location:
- trunk/grails-app/conf
- Files:
-
- 4 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BootStrap.groovy
r860 r936 6 6 import org.codehaus.groovy.grails.commons.GrailsApplication 7 7 import grails.util.GrailsUtil 8 import org.nmcdsp.plugins.aaaa.SecUser 8 9 9 // Imports for Nimble10 import grails.plugins.nimble.InstanceGenerator11 import grails.plugins.nimble.core.LevelPermission12 import grails.plugins.nimble.core.Role13 import grails.plugins.nimble.core.Group14 import grails.plugins.nimble.core.AdminsService15 import grails.plugins.nimble.core.UserService16 10 17 11 /** … … 26 20 */ 27 21 class BootStrap { 28 29 // Injections for Nimble 30 def grailsApplication 31 def nimbleService 32 def userService 33 def adminsService 22 def springSecurityService 34 23 35 24 def init = {servletContext -> … … 37 26 System.setProperty('user.timezone', 'CET') 38 27 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]." 101 34 102 35 // If there are no templates yet in the database -
trunk/grails-app/conf/BootStrapStudies.groovy
r882 r936 19 19 */ 20 20 21 public static void addExampleStudies( dbnp.user.User owner) {21 public static void addExampleStudies(org.nmcdsp.plugins.aaaa.SecUser owner) { 22 22 23 23 // Look up the used ontologies which should be in the database by now -
trunk/grails-app/conf/BuildConfig.groovy
r776 r936 18 18 */ 19 19 //grails.plugin.repos.discovery.intient = "http://intient.com/downloads/grails/" 20 return true; 20 grails.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 156 156 grails.views.javascript.library="jquery" 157 157 158 // Needed for the Spring Security Core plugin: 159 grails.plugins.springsecurity.userLookup.userDomainClassName = 'org.nmcdsp.plugins.aaaa.SecUser' 160 grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'org.nmcdsp.plugins.aaaa.SecUserSecRole' 161 grails.plugins.springsecurity.authority.className = 'org.nmcdsp.plugins.aaaa.SecRole' 162 158 163 // The OAuth consumer key and secret variables are currently replaced by Jeroen's Continuous Integration script. 159 164 // These keys were requested by me (Tjeerd) from myExperiment.
Note: See TracChangeset
for help on using the changeset viewer.