root/trunk/grails-app/conf/Config.groovy @ 1114

Revision 1114, 7.7 KB (checked in by work@…, 3 years ago)

- added nbx14 config, we need a better solution to support multiple domain names / server configurations

  • Property svn:keywords set to Author Date Rev
Line 
1import dbnp.rest.common.CommunicationManager
2
3/**
4 * Application Configuration
5 *
6 * @author Jeroen Wesbeek
7 * @since 20100520
8 *
9 * Revision information:
10 * $Rev$
11 * $Author$
12 * $Date$
13 */
14
15// locations to search for config files that get merged into the main config
16// config files can either be Java properties files or ConfigSlurper scripts
17
18// grails.config.locations = [ "classpath:${appName}-config.properties",
19//                             "classpath:${appName}-config.groovy",
20//                             "file:${userHome}/.grails/${appName}-config.properties",
21//                             "file:${userHome}/.grails/${appName}-config.groovy"]
22
23// if(System.properties["${appName}.config.location"]) {
24//    grails.config.locations << "file:" + System.properties["${appName}.config.location"]
25// }
26grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
27grails.mime.use.accept.header = false
28grails.mime.types = [html: ['text/html', 'application/xhtml+xml'],
29        xml: ['text/xml', 'application/xml'],
30        text: 'text/plain',
31        js: 'text/javascript',
32        rss: 'application/rss+xml',
33        atom: 'application/atom+xml',
34        css: 'text/css',
35        csv: 'text/csv',
36        all: '*/*',
37        json: ['application/json', 'text/json'],
38        form: 'application/x-www-form-urlencoded',
39        multipartForm: 'multipart/form-data'
40]
41// The default codec used to encode data with ${}
42grails.views.default.codec = "none" // none, html, base64
43grails.views.gsp.encoding = "UTF-8"
44grails.converters.encoding = "UTF-8"
45
46// enabled native2ascii conversion of i18n properties files
47grails.enable.native2ascii = true
48
49// set per-environment serverURL stem for creating absolute links
50environments {
51        development {
52                grails.serverURL = "http://localhost:8080/${appName}"
53
54                CommunicationManager.SAMServerURL = 'http://localhost:8182/sam'
55                CommunicationManager.registerRestWrapperMethodsGSCFtoSAM()
56        }
57        ci {
58                // used by build script
59                grails.serverURL = "http://ci.gscf.nmcdsp.org"
60
61                CommunicationManager.SAMServerURL = 'http://ci.sam.nmcdsp.org'
62                CommunicationManager.registerRestWrapperMethodsGSCFtoSAM()
63        }
64        test {
65                // used by build script
66                grails.serverURL = "http://test.gscf.nmcdsp.org"
67
68                CommunicationManager.SAMServerURL = 'http://test.sam.nmcdsp.org'
69                CommunicationManager.registerRestWrapperMethodsGSCFtoSAM()
70        }
71        nbx14 {
72                // used by build script
73                grails.serverURL = "http://nbx14.osx.eu"
74
75                CommunicationManager.SAMServerURL = 'http://sam.nbx14.osx.eu'
76                CommunicationManager.registerRestWrapperMethodsGSCFtoSAM()
77        }
78        production {
79                grails.serverURL = "http://www.nmcdsp.org"
80
81                CommunicationManager.SAMServerURL = 'http://sam.nmcdsp.org'
82                CommunicationManager.registerRestWrapperMethodsGSCFtoSAM()
83        }
84        www {
85                // used by build script
86                grails.serverURL = "http://www.nmcdsp.org"
87
88                CommunicationManager.SAMServerURL = 'http://sam.nmcdsp.org'
89                CommunicationManager.registerRestWrapperMethodsGSCFtoSAM()
90        }
91}
92
93// log4j configuration
94log4j = {
95        // Example of changing the log pattern for the default console
96        // appender:
97        //
98        //appenders {
99        //    console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
100        //}
101
102        error 'org.codehaus.groovy.grails.web.servlet',  //  controllers
103                'org.codehaus.groovy.grails.web.pages', //  GSP
104                'org.codehaus.groovy.grails.web.sitemesh', //  layouts
105                'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
106                'org.codehaus.groovy.grails.web.mapping', // URL mapping
107                'org.codehaus.groovy.grails.commons', // core / classloading
108                'org.codehaus.groovy.grails.plugins', // plugins
109                'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
110                'org.springframework',
111                'org.hibernate'
112
113        warn 'org.mortbay.log'
114
115        //debug 'org.codehaus.groovy.grails.plugins'
116}
117
118graphviz {
119        // graphviz installation path is dependent on OS
120        // (requirement for class diagram plugin)
121        switch (System.properties["os.name"]) {
122                case "Mac OS X":
123                        // define mac path to Graphviz dot executable
124                        // (install using macports: sudo port install graphviz)
125                        dot.executable = "/opt/local/bin/dot"
126                        break
127                default:
128                        // assume the linux default path
129                        dot.executable = "/usr/bin/dot"
130        }
131}
132
133// cryptography settings
134// @see WizardTaglib.groovy (encrypt)
135// @see TemplateEditorController.groovy (decrypt)
136crypto {
137        shared.secret = "U73reG*mE^\$t@7s!e%"
138}
139
140// GSCF specific configuration
141gscf {
142        domain = [
143                // importable entities
144                // use: grailsApplication.config.gscf.domain.entities
145                entities: [
146                        // dbnp.data
147                        'dbnp.data.FeatureBase',
148                        'dbnp.data.FeatureType',
149                        'dbnp.data.Ontology',
150                        'dbnp.data.Term',
151
152                        // dbnp.studycapturing
153                        'dbnp.studycapturing.Assay',
154                        'dbnp.studycapturing.AssayModule',
155                        'dbnp.studycapturing.AssayType',
156                        'dbnp.studycapturing.Compound',
157                        'dbnp.studycapturing.Event',
158                        'dbnp.studycapturing.EventGroup',
159                        'dbnp.studycapturing.Person',
160                        'dbnp.studycapturing.PersonAffilitation',
161                        'dbnp.studycapturing.PersonRole',
162                        'dbnp.studycapturing.Publication',
163                        'dbnp.studycapturing.Sample',
164                        'dbnp.studycapturing.SamplingEvent',
165                        'dbnp.studycapturing.Study',
166                        'dbnp.studycapturing.StudyPerson',
167                        'dbnp.studycapturing.Subject',
168                        'dbnp.studycapturing.Template',
169                        'dbnp.studycapturing.TemplateEntity',
170                        'dbnp.studycapturing.TemplateField',
171                        'dbnp.studycapturing.TemplateFieldListItem',
172                        'dbnp.studycapturing.TemplateFieldType'
173                ],
174
175                // importable entities
176                // use: grailsApplication.config.gscf.domain.importableEntities
177                // @see ImporterController
178                importableEntities: [
179                        event: [name: 'Event', entity: 'dbnp.studycapturing.Event'],
180                        sample: [name: 'Sample', entity: 'dbnp.studycapturing.Sample'],
181                        study: [name: 'Study', entity: 'dbnp.studycapturing.Study'],
182                        subject: [name: 'Subject', entity: 'dbnp.studycapturing.Subject'],
183                        samplingevent: [name: 'SamplingEvent', entity: 'dbnp.studycapturing.SamplingEvent']
184
185                ]
186        ]
187}
188
189// jquery plugin
190grails.views.javascript.library = "jquery"
191
192// Needed for the Spring Security Core plugin:
193grails.plugins.springsecurity.userLookup.userDomainClassName = 'dbnp.authentication.SecUser'
194grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'dbnp.authentication.SecUserSecRole'
195grails.plugins.springsecurity.authority.className = 'dbnp.authentication.SecRole'
196grails.plugins.springsecurity.password.algorithm = 'SHA-256'
197grails.plugins.springsecurity.password.encodeHashAsBase64 = true
198grails.plugins.springsecurity.dao.reflectionSaltSourceProperty = 'username' // Use the persons username as salt for encryption
199grails.plugins.springsecurity.securityConfigType = grails.plugins.springsecurity.SecurityConfigType.Annotation
200grails.plugins.springsecurity.successHandler.targetUrlParameter = 'spring-security-redirect'
201
202// Needed for the (copy of) the Spring Security UI plugin
203grails.plugins.springsecurity.ui.forgotPassword.emailFrom = 'gscf@dbnp.org'
204grails.plugins.springsecurity.ui.forgotPassword.emailSubject = 'Password reset GSCF'
205
206// Make sure the different controllers provided by springsecurity.ui are only accessible by administrators
207// NB: the RegisterController is used for forgotten passwords. It should be accessible by anyone
208grails.plugins.springsecurity.controllerAnnotations.staticRules = [
209        '/user/**': ['ROLE_ADMIN'],
210        '/role/**': ['ROLE_ADMIN'],
211        '/aclclass/**': ['ROLE_ADMIN'],
212        '/aclentry/**': ['ROLE_ADMIN'],
213        '/aclobjectidentity/**': ['ROLE_ADMIN'],
214        '/aclsid/**': ['ROLE_ADMIN'],
215        '/persistentlogin/**': ['ROLE_ADMIN'],
216        '/registrationcode/**': ['ROLE_ADMIN'],
217        '/requestmap/**': ['ROLE_ADMIN'],
218        '/securityinfo/**': ['ROLE_ADMIN']
219]
220
221// Needed for sending emails
222grails {
223        mail {
224                host = "smtp.gmail.com"
225                port = 465
226                username = "gscfproject@gmail.com"
227                password = "gscf2010"
228                props = [
229                        "mail.smtp.auth": "true",
230                        "mail.smtp.socketFactory.port": '465',
231                        "mail.smtp.socketFactory.class": "javax.net.ssl.SSLSocketFactory",
232                        "mail.smtp.socketFactory.fallback": "false"
233                ]
234        }
235}
Note: See TracBrowser for help on using the browser.