source: trunk/grails-app/conf/BootStrap.groovy @ 962

Last change on this file since 962 was 932, checked in by gav, 13 years ago

Configure demo mode.

File size: 1.5 KB
RevLine 
[932]1import org.codehaus.groovy.grails.commons.ConfigurationHolder as CH
2
[149]3class BootStrap
[58]4{
[149]5    def createDataService
[58]6
7    def init = { servletContext ->
8
[504]9        /** Environment specific settings.
10        * Note that (circa grails-1.2.2) if running "test test-app integration:" from "grails interactive"
11        * the correct environment is applied for DataSource and Config,
12        * but for BootStrap (and others) the development environment is applied.
13        */
14        environments {
15            development {
16                log.info "Starting DEVELOPMENT bootstrap."
17                createDataService.ensureSystemAndAdminAccess()
18                createDataService.createBaseData()
[932]19                CH.config.demoMode.enabled = true
[504]20                createDataService.createDemoData()
[622]21                createDataService.startSearchableIndex()
[504]22            }
23            test {
24                log.info "Starting TEST bootstrap."
25                createDataService.ensureSystemAndAdminAccess()
[508]26                createDataService.createBaseData()
[622]27                createDataService.startSearchableIndex(false)
[504]28            }
29            production {
30                log.info "Starting PRODUCTION bootstrap."
31                createDataService.ensureSystemAndAdminAccess()
[508]32                createDataService.createBaseData()
[932]33                if(CH.config.demoMode.enabled) createDataService.createDemoData()
[622]34                createDataService.startSearchableIndex()
[504]35            }
[58]36        }
[149]37
[504]38    } // init
[58]39
40    def destroy = {
41    }
[504]42
43} // end class
Note: See TracBrowser for help on using the repository browser.