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