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

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

Apply bug fix for ticket #76.
Rename all instances of Lucene to Searchable.
Improved global directory config.
Add log levels for searchable plugin and compass.

File size: 24.3 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// enable Sitemesh preprocessing of GSP pages
36grails.views.gsp.sitemesh.preprocess = true
37// scaffolding templates configuration
38grails.scaffolding.templates.domainSuffix = 'Instance'
39
40// Set to false to use the new Grails 1.2 JSONBuilder in the render method
41grails.json.legacy.builder=false
42
43// enabled native2ascii conversion of i18n properties files
44grails.enable.native2ascii = true
45
46// whether to install the java.util.logging bridge for sl4j. Disable fo AppEngine!
47grails.logging.jul.usebridge = true
48// packages to include in Spring bean scanning
49grails.spring.bean.packages = []
50
51/**
52* Internal searchable index config.
53*/
54// Is set true by createDataService.startSearchableIndex() once bootstrap completes.
55appSearchable.cascadeOnUpdate = false
56
57/**
58* Directory configuration.
59* Pickup the Tomcat/Catalina directory else use the target or current dir.
60*/
61def fs = File.separator // Local variable.
62globalDirs.targetDir = new File("target${fs}").isDirectory() ? "target${fs}" : ''
63globalDirs.catalinaBase = System.properties.getProperty('catalina.base')
64globalDirs.logDirectory = globalDirs.catalinaBase ? "${globalDirs.catalinaBase}${fs}logs${fs}" : globalDirs.targetDir
65globalDirs.workDirectory = globalDirs.catalinaBase ? "${globalDirs.catalinaBase}${fs}work${fs}" : globalDirs.targetDir
66globalDirs.searchableIndexDirectory = "${globalDirs.workDirectory}SearchableIndex${fs}${appName}${fs}"
67
68/**
69 * Log4j configuration.
70 * Causing this file to reload (e.g. edit+save) may break the appLog destination
71 * and further logs will be written to files or directories like "[:]".
72 * For more info see http://logging.apache.org/log4j/1.2/manual.html
73 * For log levels see http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html
74 * Basic log levels are ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < OFF
75 */
76
77log4j = {
78    appenders {
79        // Use if we want to prevent creation of a stacktrace.log file.
80        'null' name:'stacktrace'
81
82        // Use this if we want to modify the default appender called 'stdout'.
83        console name:'stdout', layout:pattern(conversionPattern: '[%t] %-5p %c{2} %x - %m%n')
84
85        // Custom log file.
86        rollingFile name:"appLog",
87                        file:"${globalDirs.logDirectory}${appName}.log".toString(),
88                        maxFileSize:'300kB',
89                        maxBackupIndex:1,
90                        layout:pattern(conversionPattern: '%d{[EEE, dd-MMM-yyyy @ HH:mm:ss.SSS]} [%t] %-5p %c %x - %m%n')
91    }
92
93    // This is for the built-in stuff and from the default Grails-1.2.1 config.
94    error 'org.codehaus.groovy.grails.web.servlet',  //  controllers
95            'org.codehaus.groovy.grails.web.pages', //  GSP
96            'org.codehaus.groovy.grails.web.sitemesh', //  layouts
97            'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
98            'org.codehaus.groovy.grails.web.mapping', // URL mapping
99            'org.codehaus.groovy.grails.commons', // core / classloading
100            'org.codehaus.groovy.grails.plugins', // plugins
101            'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
102            'org.springframework',
103            'org.hibernate',
104            'net.sf.ehcache.hibernate'
105
106    warn   'org.mortbay.log' // Jetty
107
108    error 'grails.app' // Set the default log level for our app code.
109    info 'grails.app.bootstrap' // Set the log level per type and per type.class
110    error 'grails.app.service.AuthService'
111    error 'grails.app.service.NavigationService'
112    error 'grails.app.service.com.zeddware.grails.plugins.filterpane.FilterService'
113    info 'org.codehaus.groovy.grails.plugins.searchable'
114    //info 'org.compass'
115    error 'grails.app.task' // Quartz jobs.
116    info 'grails.app.task.InventoryIndexJob'
117
118    // Move anything that should behave differently into this section.
119    switch(environment) {
120        case 'development':
121            // Configure the root logger to output to stdout and appLog appenders.
122            root {
123                error 'stdout','appLog'
124                additivity = true
125            }
126            //debug "org.hibernate.SQL"
127            debug 'grails.app.service'
128            debug 'grails.app.controller'
129            break
130        case 'test':
131            // Configure the root logger to only output to appLog appender.
132            root {
133                error 'stdout','appLog'
134                additivity = true
135            }
136            debug 'grails.app.service'
137            debug 'grails.app.controller'
138            break
139        case 'production':
140            // Configure the root logger to only output to appLog appender.
141            root {
142                error 'appLog'
143                additivity = true
144            }
145            warn 'grails.app.service'
146            warn 'grails.app.controller'
147            debug 'grails.app.service.AssetCsvService'
148            debug 'grails.app.service.PersonCsvService'
149            debug 'grails.app.service.InventoryCsvService'
150            debug 'grails.app.service.AssetTreeService' /// @todo: remove after testing.
151            break
152    }
153}
154
155/**
156 * Environment specific configuration.
157 */
158environments {
159
160    production {
161        grails.serverURL = "http://www.changeme.com" // Set serverURL stem for creating absolute links.
162    }
163
164    development {
165        grails.serverURL = "http://localhost:8080/${appName}" // Set serverURL stem for creating absolute links.
166    }
167
168    test {
169        grails.serverURL = "http://localhost:8080/${appName}" // Set serverURL stem for creating absolute links.
170    }
171
172} // end environments
173
174/**
175 * Navigation plugin menu.
176 * The top level titles are taken from i18n message bundles.
177 * Subitems i18n message bundles are not currently resolving with this plugin.
178 */
179navigation.nav = [
180    [order:10, controller:'appCore', title:'home', action:'start',
181        subItems: [
182            [order:10, controller:'appCore', title:'Start', action:'start', isVisible: { true }],
183            [order:20, controller:'appCore', title:'Manager', action:'manager', isVisible: { authenticateService.ifAnyGranted('ROLE_Manager,ROLE_AppAdmin') }],
184            [order:30, controller:'appCore', title:'Admin', action:'appAdmin', isVisible: { authenticateService.ifAllGranted('ROLE_AppAdmin') }],
185            [order:90, controller:'appCore', title:'Timeout', action:'changeSessionTimeout', isVisible: { params.action == 'changeSessionTimeout' }],
186            [order:91, controller:'appCore', title:'Password', action:'changePassword', isVisible: { params.action == 'changePassword' }],
187        ]
188    ],
189    [order:20, controller:'taskDetailed', title:'tasks', action:'search',
190        subItems: [
191            [order:10, controller:'taskDetailed', title:'Search', action:'search', isVisible: { true }],
192            [order:11, controller:'taskDetailed', title:'Calendar', action:'searchCalendar', isVisible: { true }],
193            [order:20, controller:'taskDetailed', title:'+Scheduled', action:'create', isVisible: { true }],
194            [order:30, controller:'taskDetailed', title:'+Unsheduled', action:'createUnscheduled', isVisible: { true }],
195            [order:40, controller:'taskDetailed', title:'+Callout', action:'createImmediateCallout', isVisible: { true }],
196            [order:90, controller:'taskDetailed', title:'Show', action:'show', id:'nav', isVisible: { params.action == 'show' }],
197            [order:91, controller:'taskDetailed', title:'Edit', action:'edit', id:'nav', isVisible: { params.action == 'edit' }]
198        ]
199    ],
200    [order:30, controller:'inventoryItemDetailed', title:'inventory', action:'search',
201        subItems: [
202            [order:10, controller:'inventoryItemDetailed', title:'Search', action:'search', isVisible: { true }],
203            [order:20, controller:'inventoryItemDetailed', title:'Create', action:'create', isVisible: { true }],
204            [order:90, controller:'inventoryItemDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
205            [order:91, controller:'inventoryItemDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
206        ]
207    ],
208    [order:40, controller:'assetDetailed', title:'assets', action:'search',
209        subItems: [
210            [order:10, controller:'assetDetailed', title:'Search', action:'search', isVisible: { true }],
211            [order:20, controller:'assetDetailed', title:'Create', action:'create', isVisible: { true }],
212            [order:90, controller:'assetDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
213            [order:91, controller:'assetDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }],
214            [order:99, controller:'assetSubItemDetailed', title:'Sub Items', action:'search', isVisible: { true }]
215        ]
216    ]
217]
218
219/**
220 * Navigation plugin alternate menu.
221 * The alternate menu top level titles are not displayed anywhere.
222 * Subitems i18n message bundles are not currently resolving with this plugin.
223 */
224navigation.navAlt = [
225    [order:10, controller:'person', title:'person', action:'list',
226        subItems: [
227            [order:10, controller:'person', title:'Person List', action:'list', isVisible: { true }],
228            [order:20, controller:'person', title:'Create', action:'create', isVisible: { true }],
229            [order:90, controller:'person', title:'Show', action:'show', isVisible: { params.action == 'show' }],
230            [order:91, controller:'person', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
231        ]
232    ],
233    [order:20, controller:'taskProcedureDetailed', title:'taskProcedure', action:'list',
234        subItems: [
235            [order:10, controller:'taskProcedureDetailed', title:'Task Procedure List', action:'list', isVisible: { true }],
236            [order:20, controller:'taskProcedureDetailed', title:'Create', action:'create', isVisible: { true }],
237            [order:90, controller:'taskProcedureDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
238            [order:91, controller:'taskProcedureDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
239        ]
240    ],
241    [order:30, controller:'assetSubItemDetailed', title:'assetSubItem', action:'search',
242        subItems: [
243            [order:10, controller:'assetSubItemDetailed', title:'Sub Item Search', action:'search', isVisible: { true }],
244            [order:20, controller:'assetSubItemDetailed', title:'Create', action:'create', isVisible: { true }],
245            [order:90, controller:'assetSubItemDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
246            [order:91, controller:'assetSubItemDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
247        ]
248    ],
249    [order:40, controller:'maintenancePolicyDetailed', title:'maintenancePolicy', action:'list',
250        subItems: [
251            [order:10, controller:'maintenancePolicyDetailed', title:'Maintenance Policy List', action:'list', isVisible: { true }],
252            [order:20, controller:'maintenancePolicyDetailed', title:'Create', action:'create', isVisible: { true }],
253            [order:90, controller:'maintenancePolicyDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
254            [order:91, controller:'maintenancePolicyDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
255        ]
256    ],
257    [order:50, controller:'supplierDetailed', title:'supplier', action:'list',
258        subItems: [
259            [order:10, controller:'supplierDetailed', title:'Supplier List', action:'list', isVisible: { true }],
260            [order:20, controller:'supplierDetailed', title:'Create', action:'create', isVisible: { true }],
261            [order:90, controller:'supplierDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
262            [order:91, controller:'supplierDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
263        ]
264    ],
265    [order:60, controller:'manufacturerDetailed', title:'manufacturer', action:'list',
266        subItems: [
267            [order:10, controller:'manufacturerDetailed', title:'Manufacturer List', action:'list', isVisible: { true }],
268            [order:20, controller:'manufacturerDetailed', title:'Create', action:'create', isVisible: { true }],
269            [order:90, controller:'manufacturerDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
270            [order:91, controller:'manufacturerDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
271        ]
272    ],
273    [order:70, controller:'inventoryStoreDetailed', title:'inventoryStore', action:'list',
274        subItems: [
275            [order:10, controller:'inventoryStoreDetailed', title:'Inventory Store List', action:'list', isVisible: { true }],
276            [order:20, controller:'inventoryStoreDetailed', title:'Create', action:'create', isVisible: { true }],
277            [order:90, controller:'inventoryStoreDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
278            [order:91, controller:'inventoryStoreDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
279        ]
280    ],
281    [order:80, controller:'inventoryLocationDetailed', title:'inventoryLocation', action:'list',
282        subItems: [
283            [order:10, controller:'inventoryLocationDetailed', title:'Inventory Location List', action:'list', isVisible: { true }],
284            [order:20, controller:'inventoryLocationDetailed', title:'Create', action:'create', isVisible: { true }],
285            [order:90, controller:'inventoryLocationDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
286            [order:91, controller:'inventoryLocationDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
287        ]
288    ],
289    [order:90, controller:'inventoryGroupDetailed', title:'inventoryGroup', action:'list',
290        subItems: [
291            [order:10, controller:'inventoryGroupDetailed', title:'Inventory Group List', action:'list', isVisible: { true }],
292            [order:20, controller:'inventoryGroupDetailed', title:'Create', action:'create', isVisible: { true }],
293            [order:90, controller:'inventoryGroupDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
294            [order:91, controller:'inventoryGroupDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
295        ]
296    ],
297    [order:100, controller:'manufacturerTypeDetailed', title:'manufacturerType', action:'list',
298        subItems: [
299            [order:10, controller:'manufacturerTypeDetailed', title:'Manufacturer Type List', action:'list', isVisible: { true }],
300            [order:20, controller:'manufacturerTypeDetailed', title:'Create', action:'create', isVisible: { true }],
301            [order:90, controller:'manufacturerTypeDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
302            [order:91, controller:'manufacturerTypeDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
303        ]
304    ],
305    [order:110, controller:'supplierTypeDetailed', title:'supplierType', action:'list',
306        subItems: [
307            [order:10, controller:'supplierTypeDetailed', title:'Supplier Type List', action:'list', isVisible: { true }],
308            [order:20, controller:'supplierTypeDetailed', title:'Create', action:'create', isVisible: { true }],
309            [order:90, controller:'supplierTypeDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
310            [order:91, controller:'supplierTypeDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
311        ]
312    ],
313    [order:120, controller:'siteDetailed', title:'site', action:'list',
314        subItems: [
315            [order:10, controller:'siteDetailed', title:'Site List', action:'list', isVisible: { true }],
316            [order:20, controller:'siteDetailed', title:'Create', action:'create', isVisible: { true }],
317            [order:90, controller:'siteDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
318            [order:91, controller:'siteDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
319        ]
320    ],
321    [order:130, controller:'sectionDetailed', title:'section', action:'list',
322        subItems: [
323            [order:10, controller:'sectionDetailed', title:'Section List', action:'list', isVisible: { true }],
324            [order:20, controller:'sectionDetailed', title:'Create', action:'create', isVisible: { true }],
325            [order:90, controller:'sectionDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
326            [order:91, controller:'sectionDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
327        ]
328    ],
329    [order:140, controller:'extendedAttributeTypeDetailed', title:'extendedAttributeType', action:'list',
330        subItems: [
331            [order:10, controller:'extendedAttributeTypeDetailed', title:'Attribute Type List', action:'list', isVisible: { true }],
332            [order:20, controller:'extendedAttributeTypeDetailed', title:'Create', action:'create', isVisible: { true }],
333            [order:90, controller:'extendedAttributeTypeDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
334            [order:91, controller:'extendedAttributeTypeDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
335        ]
336    ],
337    [order:150, controller:'departmentDetailed', title:'department', action:'list',
338        subItems: [
339            [order:10, controller:'departmentDetailed', title:'Department List', action:'list', isVisible: { true }],
340            [order:20, controller:'departmentDetailed', title:'Create', action:'create', isVisible: { true }],
341            [order:90, controller:'departmentDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
342            [order:91, controller:'departmentDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
343        ]
344    ],
345    [order:160, controller:'productionReferenceDetailed', title:'productionReference', action:'list',
346        subItems: [
347            [order:10, controller:'productionReferenceDetailed', title:'Production Reference List', action:'list', isVisible: { true }],
348            [order:20, controller:'productionReferenceDetailed', title:'Create', action:'create', isVisible: { true }],
349            [order:90, controller:'productionReferenceDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
350            [order:91, controller:'productionReferenceDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
351        ]
352    ],
353    [order:170, controller:'costCodeDetailed', title:'costCode', action:'list',
354        subItems: [
355            [order:10, controller:'costCodeDetailed', title:'Cost Code List', action:'list', isVisible: { true }],
356            [order:20, controller:'costCodeDetailed', title:'Create', action:'create', isVisible: { true }],
357            [order:90, controller:'costCodeDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
358            [order:91, controller:'costCodeDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
359        ]
360    ],
361    [order:180, controller:'personGroupDetailed', title:'personGroup', action:'list',
362        subItems: [
363            [order:10, controller:'personGroupDetailed', title:'Person Group List', action:'list', isVisible: { true }],
364            [order:20, controller:'personGroupDetailed', title:'Create', action:'create', isVisible: { true }],
365            [order:90, controller:'personGroupDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
366            [order:91, controller:'personGroupDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
367        ]
368    ],
369    [order:190, controller:'personGroupTypeDetailed', title:'personGroupType', action:'list',
370        subItems: [
371            [order:10, controller:'personGroupTypeDetailed', title:'Person Group Type List', action:'list', isVisible: { true }],
372            [order:20, controller:'personGroupTypeDetailed', title:'Create', action:'create', isVisible: { true }],
373            [order:90, controller:'personGroupTypeDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
374            [order:91, controller:'personGroupTypeDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
375        ]
376    ],
377    [order:200, controller:'taskGroupDetailed', title:'taskProcedure', action:'list',
378        subItems: [
379            [order:10, controller:'taskGroupDetailed', title:'Task Group List', action:'list', isVisible: { true }],
380            [order:20, controller:'taskGroupDetailed', title:'Create', action:'create', isVisible: { true }],
381            [order:90, controller:'taskGroupDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
382            [order:91, controller:'taskGroupDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
383        ]
384    ],
385    [order:210, controller:'unitOfMeasureDetailed', title:'unitOfMeasure', action:'list',
386        subItems: [
387            [order:10, controller:'unitOfMeasureDetailed', title:'Unit Of Measure List', action:'list', isVisible: { true }],
388            [order:20, controller:'unitOfMeasureDetailed', title:'Create', action:'create', isVisible: { true }],
389            [order:90, controller:'unitOfMeasureDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
390            [order:91, controller:'unitOfMeasureDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
391        ]
392    ],
393    [order:220, controller:'inventoryItemPurchaseDetailed', title:'inventoryItemPurchase', action:'search',
394        subItems: [
395            [order:10, controller:'inventoryItemPurchaseDetailed', title:'Purchase Search', action:'search', isVisible: { true }],
396            [order:20, controller:'inventoryItemPurchaseDetailed', title:'Order', action:'create', isVisible: { true }],
397            [order:90, controller:'inventoryItemPurchaseDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }],
398            [order:91, controller:'inventoryItemPurchaseDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }]
399        ]
400    ]
401]
402
403/**
404 * Custom application global settings.
405 * @todo: externalise these settings to a config file (along with the database settings) or have them configurable via the web interface+database.
406 */
407taskRecurringScheduleJob.repeatInterval=10
408// It is recommended to limit the currencyList to the one that the site uses e.g: currencyList = ['AUD']
409currencyList = ['EUR', 'XCD', 'USD', 'XOF', 'NOK', 'AUD', 'XAF', 'NZD', 'MAD', 'DKK', 'GBP', 'CHF', 'XPF', 'ILS', 'ROL', 'TRL']
410
Note: See TracBrowser for help on using the repository browser.