import grails.util.GrailsUtil

class BootStrap
{
    def createDataService

    def init = { servletContext ->

        log.info "Application starting."
        log.debug "GrailsUtil.environment = ${GrailsUtil.environment}"

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

    }

    def destroy = {
    }
}
