class BootStrap
{
    def createDataService

    def init = { servletContext ->

        /** Environment specific settings.
        * Note that (circa grails-1.2.2) if running "test test-app integration:" from "grails interactive"
        * the correct environment is applied for DataSource and Config,
        * but for BootStrap (and others) the development environment is applied.
        */
        environments {
            development {
                log.info "Starting DEVELOPMENT bootstrap."
                createDataService.ensureSystemAndAdminAccess()
                createDataService.createBaseData()
                createDataService.createDemoData()
            }
            test {
                log.info "Starting TEST bootstrap."
                createDataService.ensureSystemAndAdminAccess()
                createDataService.createBaseData()
            }
            production {
                log.info "Starting PRODUCTION bootstrap."
                createDataService.ensureSystemAndAdminAccess()
                createDataService.createBaseData()
            }
        }

    } // init

    def destroy = {
    }

} // end class
