import grails.util.GrailsUtil

class BootStrap
{
    def createDataService

    def init = { servletContext ->

    println "**** BootStrap GrailsUtil.environment = ${GrailsUtil.environment}"

        switch (GrailsUtil.environment)
        {
            case "development":
                        createDataService.ensureAdminAccess()
                        createDataService.createBaseData()
                        createDataService.createDemoData()
                        break
            case "test":
                        createDataService.ensureAdminAccess()
                        break
            case "production":
                        createDataService.ensureAdminAccess()
                        break 
        }

    }

    def destroy = {
    }
}
