source: trunk/grails-app/conf/Config.groovy @ 287

Last change on this file since 287 was 278, checked in by gav, 15 years ago

Add AssetTreeTagLib and asset overview.
Complete asset copy function with link and copy choices.

File size: 9.5 KB
Line 
1// locations to search for config files that get merged into the main config
2// config files can either be Java properties files or ConfigSlurper scripts
3
4// grails.config.locations = [ "classpath:${appName}-config.properties",
5//                             "classpath:${appName}-config.groovy",
6//                             "file:${userHome}/.grails/${appName}-config.properties",
7//                             "file:${userHome}/.grails/${appName}-config.groovy"]
8
9// if(System.properties["${appName}.config.location"]) {
10//    grails.config.locations << "file:" + System.properties["${appName}.config.location"]
11// }
12grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
13grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
14                      xml: ['text/xml', 'application/xml'],
15                      text: 'text-plain',
16                      js: 'text/javascript',
17                      rss: 'application/rss+xml',
18                      atom: 'application/atom+xml',
19                      css: 'text/css',
20                      csv: 'text/csv',
21                      pdf: 'application/pdf',
22                      rtf: 'application/rtf',
23                      excel: 'application/vnd.ms-excel',
24                      ods: 'application/vnd.oasis.opendocument.spreadsheet',
25                      all: '*/*',
26                      json: ['application/json','text/json'],
27                      form: 'application/x-www-form-urlencoded',
28                      multipartForm: 'multipart/form-data'
29                    ]
30// The default codec used to encode data with ${}
31grails.views.default.codec="none" // none, html, base64
32grails.views.gsp.encoding="UTF-8"
33grails.converters.encoding="UTF-8"
34
35// enabled native2ascii conversion of i18n properties files
36grails.enable.native2ascii = true
37
38/**
39 * Log4j configuration.
40 * Causing this file to reload (e.g. edit+save) may break the appLog destination
41 * and further logs will be written to files or directories like "[:]".
42 * For more info see http://logging.apache.org/log4j/1.2/manual.html
43 * For log levels see http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html
44 * Basic log levels are ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF
45 */
46// Pickup the Tomcat/Catalina logDirectory else use the current dir.
47def catalinaBase = System.properties.getProperty('catalina.base')
48def logDirectory = catalinaBase ? "${catalinaBase}/logs" : '.'
49
50log4j = {
51    appenders {
52        // Use if we want to prevent creation of a stacktrace.log file.
53        'null' name:'stacktrace'
54
55        // Use this if we want to modify the default appender called 'stdout'.
56        console name:'stdout', layout:pattern(conversionPattern: '[%t] %-5p %c{2} %x - %m%n')
57
58        // Custom log file.
59        rollingFile name:"appLog",
60                        file:"${logDirectory}/${appName}.log".toString(),
61                        maxFileSize:'1MB',
62                        maxBackupIndex:0,
63                        layout:pattern(conversionPattern: '%d{[EEE, dd-MMM-yyyy @ HH:mm:ss.SSS]} [%t] %-5p %c %x - %m%n')
64    }
65
66    // Configure the root logger to output to stdout and appLog appenders.
67    root {
68        error 'stdout','appLog'
69        additivity = true
70    }
71
72    // This is for the builtin stuff and from the default Grails-1.1.1 config.
73    error 'org.codehaus.groovy.grails.web.servlet',  //  controllers
74            'org.codehaus.groovy.grails.web.pages', //  GSP
75            'org.codehaus.groovy.grails.web.sitemesh', //  layouts
76            'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
77            'org.codehaus.groovy.grails.web.mapping', // URL mapping
78            'org.codehaus.groovy.grails.commons', // core / classloading
79            'org.codehaus.groovy.grails.plugins', // plugins
80            'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
81            'org.springframework',
82            'org.hibernate'
83
84    warn   'org.mortbay.log' // Jetty
85
86    error "grails.app" // Set the default log level for our app code.
87    info "grails.app.bootstrap" // Set the log level per type and per type.class
88    error "grails.app.service.PersonService"
89    error "grails.app.service.NavigationService"
90    error "grails.app.service.com.zeddware.grails.plugins.filterpane.FilterService"
91
92    // Move anything that should behave differently into this section.
93    switch(environment) {
94        case 'development':
95            debug "grails.app.service"
96            debug "grails.app.controller"
97            break
98        case 'test':
99            debug "grails.app.service"
100            debug "grails.app.controller"
101            break
102        case 'production':
103            warn "grails.app.service"
104            warn "grails.app.controller"
105            break
106    }
107}
108
109/**
110 * Environment specific configuration.
111 */
112environments {
113
114    production {
115        grails.serverURL = "http://www.changeme.com" // Set serverURL stem for creating absolute links.
116    }
117
118    development {
119        grails.serverURL = "http://localhost:8080/${appName}" // Set serverURL stem for creating absolute links.
120    }
121
122    test {
123        grails.serverURL = "http://localhost:8080/${appName}" // Set serverURL stem for creating absolute links.
124    }
125
126} // end environments
127
128/**
129 * Navigation plugin menu.
130 * The top level titles are taken from i18n message bundles.
131 * Subitems i18n message bundles are not currently resolving with this plugin.
132 */
133navigation.nav = [
134    [order:10, controller:'appCore', title:'home', action:'start',
135        subItems: [
136            [order:10, controller:'appCore', title:'Start', action:'start', isVisible: { true }],
137            [order:20, controller:'appCore', title:'Manager', action:'manager', isVisible: { authenticateService.ifAnyGranted('ROLE_Manager,ROLE_AppAdmin') }],
138            [order:30, controller:'appCore', title:'Admin', action:'appAdmin', isVisible: { authenticateService.ifAllGranted('ROLE_AppAdmin') }],
139            [order:90, controller:'appCore', title:'Timeout', action:'changeSessionTimeout', isVisible: { params.action == 'changeSessionTimeout' }],
140            [order:91, controller:'appCore', title:'Password', action:'changePassword', isVisible: { params.action == 'changePassword' }],
141        ]
142    ],
143    [order:20, controller:'taskDetailed', title:'tasks', action:'search',
144        subItems: [
145            [order:10, controller:'taskDetailed', title:'Search', action:'search', isVisible: { true }],
146            [order:11, controller:'taskDetailed', title:'Calendar', action:'searchCalendar', isVisible: { true }],
147            [order:20, controller:'taskDetailed', title:'Create', action:'create', isVisible: { true }],
148            [order:90, controller:'taskDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
149            [order:91, controller:'taskDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
150        ]
151    ],
152    [order:30, controller:'inventoryItemDetailed', title:'inventory', action:'search',
153        subItems: [
154            [order:10, controller:'inventoryItemDetailed', title:'Search', action:'search', isVisible: { true }],
155            [order:20, controller:'inventoryItemDetailed', title:'Create', action:'create', isVisible: { true }],
156            [order:90, controller:'inventoryItemDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
157            [order:91, controller:'inventoryItemDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
158        ]
159    ],
160    [order:40, controller:'assetDetailed', title:'assets', action:'overview',
161        subItems: [
162            [order:10, controller:'assetDetailed', title:'Overview', action:'overview', isVisible: { true }],
163            [order:11, controller:'assetDetailed', title:'Search', action:'search', isVisible: { true }],
164            [order:20, controller:'assetDetailed', title:'Create', action:'create', isVisible: { true }],
165            [order:90, controller:'assetDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
166            [order:91, controller:'assetDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
167        ]
168    ]
169]
170
171/**
172 * Navigation plugin alternate menu.
173 * The alternate top level titles are not displayed anywhere.
174 * Subitems i18n message bundles are not currently resolving with this plugin.
175 */
176navigation.navAlt = [
177    [order:10, controller:'person', title:'person', action:'list',
178        subItems: [
179            [order:10, controller:'person', title:'Person List', action:'list', isVisible: { true }],
180            [order:20, controller:'person', title:'Create', action:'create', isVisible: { true }],
181            [order:90, controller:'person', title:'Show', action:'show', isVisible: { params.action == 'show' }],
182            [order:91, controller:'person', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
183        ]
184    ],
185    [order:20, controller:'taskProcedureDetailed', title:'task', action:'list',
186        subItems: [
187            [order:10, controller:'taskProcedureDetailed', title:'Task Procedure List', action:'list', isVisible: { true }],
188            [order:20, controller:'taskProcedureDetailed', title:'Create', action:'create', isVisible: { true }],
189            [order:90, controller:'taskProcedureDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
190            [order:91, controller:'taskProcedureDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
191        ]
192    ]
193]
194
195/**
196 * Some custom globals.
197 */
198taskRecurringScheduleJob.repeatInterval=10
Note: See TracBrowser for help on using the repository browser.