Ignore:
Timestamp:
Aug 3, 2010, 2:00:35 PM (10 years ago)
Author:
duh
Message:
  • upgraded nimble to 0.4-SNAPSHOT
File:
1 edited

Legend:

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

    r247 r770  
    11/*
    22 *  Nimble, an extensive application base for Grails
    3  *  Copyright (C) 2009 Intient Pty Ltd
     3 *  Copyright (C) 2010 Bradley Beddoes
    44 *
    55 *  Licensed under the Apache License, Version 2.0 (the "License");
     
    1717 
    1818
    19 import intient.nimble.InstanceGenerator
     19import grails.plugins.nimble.InstanceGenerator
    2020
    21 import intient.nimble.domain.LevelPermission
    22 import intient.nimble.domain.Role
    23 import intient.nimble.domain.Group
    24 import intient.nimble.service.AdminsService
    25 import intient.nimble.service.UserService
     21import grails.plugins.nimble.core.LevelPermission
     22import grails.plugins.nimble.core.Role
     23import grails.plugins.nimble.core.Group
     24import grails.plugins.nimble.core.AdminsService
     25import grails.plugins.nimble.core.UserService
    2626
    2727/*
     
    4646
    4747    // Execute any custom Nimble related BootStrap for your application below
    48     if (nimble.User.count() == 0) {
    49         println ".bootstrapping nimble"
    5048
    51         // Create example User account
    52         def user = InstanceGenerator.user()
    53         user.username = "user"
    54         user.pass = 'useR123!'
    55         user.passConfirm = 'useR123!'
    56         user.enabled = true
     49    // Create example User account
     50    def user = InstanceGenerator.user()
     51    user.username = "user"
     52    user.pass = 'useR123!'
     53    user.passConfirm = 'useR123!'
     54    user.enabled = true
    5755
    58         def userProfile = InstanceGenerator.profile()
    59         userProfile.fullName = "Test User"
    60         userProfile.owner = user
    61         user.profile = userProfile
     56    def userProfile = InstanceGenerator.profile()
     57    userProfile.fullName = "Test User"
     58    userProfile.owner = user
     59    user.profile = userProfile
    6260
    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         }
     61    def savedUser = userService.createUser(user)
     62    if (savedUser.hasErrors()) {
     63      savedUser.errors.each {
     64        log.error(it)
     65      }
     66      throw new RuntimeException("Error creating example user")
     67    }
    7068
    71         // Create example Administrative account
    72         def admins = Role.findByName(AdminsService.ADMIN_ROLE)
    73         def admin = InstanceGenerator.user()
    74         admin.username = "admin"
    75         admin.pass = "admiN123!"
    76         admin.passConfirm = "admiN123!"
    77         admin.enabled = true
     69    // Create example Administrative account
     70    def admins = Role.findByName(AdminsService.ADMIN_ROLE)
     71    def admin = InstanceGenerator.user()
     72    admin.username = "admin"
     73    admin.pass = "admiN123!"
     74    admin.passConfirm = "admiN123!"
     75    admin.enabled = true
    7876
    79         def adminProfile = InstanceGenerator.profile()
    80         adminProfile.fullName = "Administrator"
    81         adminProfile.owner = admin
    82         admin.profile = adminProfile
     77    def adminProfile = InstanceGenerator.profile()
     78    adminProfile.fullName = "Administrator"
     79    adminProfile.owner = admin
     80    admin.profile = adminProfile
    8381
    84         def savedAdmin = userService.createUser(admin)
    85         if (savedAdmin.hasErrors()) {
    86           savedAdmin.errors.each {
    87             log.error(it)
    88           }
    89           throw new RuntimeException("Error creating administrator")
    90         }
     82    def savedAdmin = userService.createUser(admin)
     83    if (savedAdmin.hasErrors()) {
     84      savedAdmin.errors.each {
     85        log.error(it)
     86      }
     87      throw new RuntimeException("Error creating administrator")
     88    }
    9189
    92         adminsService.add(admin)
    93 
    94     }
     90    adminsService.add(admin)
    9591  }
    9692
Note: See TracChangeset for help on using the changeset viewer.