source: trunk/gnuMims-config.groovy @ 931

Last change on this file since 931 was 923, checked in by gav, 14 years ago

Externalise the config.

File size: 3.3 KB
Line 
1/**
2 * External Grails application config file.
3 * This is a full Groovy ConfigSlurper file but don't let that scare you :-)
4 * Normally just set your database settings in the Required Settings section.
5 * Usage:
6 *  This file must be placed on the classpath, for example in ONE of the following:
7 *   $CATALINA_BASE/lib/
8 *   $CATALINA_HOME/lib/
9 *   /var/lib/tomcat5.5/common/lib/ (Debian Tomcat5.5)
10 *   /var/lib/tomcat6/common/classes/ (Debian Tomcat6)
11 *   or in the root of a grails application (development).
12 * More:
13 *  Grails user guide - 3.3 The DataSource and 3.4 Externalized Configuration
14 *  http://grails.org/doc/latest/guide/
15 *  http://groovy.codehaus.org/ConfigSlurper
16 */
17
18/*******************
19Init, please ignore.
20*******************/
21def appName = grails.util.Metadata.current.'app.name'
22println "EXT($appName): External config start."
23
24/***********************************
25Required Settings, please set these.
26************************************/
27
28environments {
29    production {
30        println "EXT($appName): Configure production datasource."
31
32        // Enable ONE dataSource with your database settings.
33        // Delete dbCreate line after setup!
34        dataSource {
35            /** HSQLDB - In memory */
36//             driverClassName = "org.hsqldb.jdbcDriver"
37//             username = "sa"
38//             password = ""
39//             dbCreate = "create-drop"
40//             url = "jdbc:hsqldb:mem:devDb"
41            /** HSQLDB - In file */
42//             driverClassName = "org.hsqldb.jdbcDriver"
43//             username = "sa"
44//             password = ""
45//             dbCreate = "update"
46//             url = "jdbc:hsqldb:file:prodDb;shutdown=true"
47            /** MSSQL */
48            //For more info see the docs that you downloaded with the driver.
49//             dialect = org.hibernate.dialect.SQLServerDialect // MSSQL 2000+2005 Useful with `grails schema-export`
50//             driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
51//             username = "gnumimsadmin"
52//             password = "gnumimsadmin"
53//             dbCreate = "update"
54//             url = "jdbc:sqlserver://gnumimssql01:1433;databaseName=gnumims_prod"
55            /** MySQL */
56            dialect = org.hibernate.dialect.MySQL5InnoDBDialect
57            driverClassName = "com.mysql.jdbc.Driver"
58            username = "gnumimsadmin"
59            password = "gnumimsadmin"
60            dbCreate = "update"
61            url = "jdbc:mysql://gnumimssql01:3306/gnumims_prod?autoReconnect=true&sessionVariables=storage_engine=InnoDB"
62        }
63    }
64}
65
66// It is highly recommended to limit the currencyList to the ONE that the site uses e.g:
67// 'EUR', 'XCD', 'USD', 'XOF', 'NOK', 'AUD', 'XAF', 'TRL'
68// 'NZD', 'MAD', 'DKK', 'GBP', 'CHF', 'XPF', 'ILS', 'ROL'
69currencyList = ['AUD']
70
71/*******************
72Optional Settings.
73*******************/
74
75 // Set true to enable demo mode and create demo data.
76demoMode.enabled = false
77
78// Task generation interval, increase value to reduce system load.
79taskRecurringScheduleJob.repeatInterval = 10
80
81/*******************
82Exit Functions.
83*******************/
84
85if(demoMode.enabled) {
86    println "EXT($appName): Demo mode enabled."
87    currencyList = ['EUR', 'XCD', 'USD', 'XOF', 'NOK', 'AUD', 'XAF', 'TRL',
88                    'NZD', 'MAD', 'DKK', 'GBP', 'CHF', 'XPF', 'ILS', 'ROL']
89}
90
91println "EXT($appName): External config end."
Note: See TracBrowser for help on using the repository browser.