-
Notifications
You must be signed in to change notification settings - Fork 1
/
CONFIGURATION.txt
387 lines (294 loc) · 17.3 KB
/
CONFIGURATION.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
LAMUS2 CONFIGURATION
1. Web container context
1.1. JNDI Resources
Lamus2 needs the 'corpusstructure3' (or another name for the hybrid corpusstructure), "ams2cmdi" and 'lamus2' databases for direct access, so these resources should be available in the web container configuration.
<Resource
name="jdbc/CSDB_HYBRID"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/corpusstructure3"
username="dummy"
password="password"
maxActive="20"
maxIdle="5"
maxWait="4000"
removeAbandoned="true"
removeAbandonedTimeout="300"
logAbandoned="true"
/>
<Resource
name="jdbc/AMS2-CMDI-DB"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/ams2cmdi"
username="webuser"
password="start1a"
maxActive="10"
maxIdle="5"
maxWait="4000"
removeAbandoned="true"
removeAbandonedTimeout="300"
logAbandoned="true"
/>
<Resource
name="jdbc/LAMUS2_DB"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/lamus2"
username="dummy"
password="password"
maxActive="15"
maxIdle="5"
maxWait="4000"
removeAbandoned="true"
removeAbandonedTimeout="300"
logAbandoned="true"
/>
1.2. Context parameters
The other necessary properties should be defined as parameters in the web context configuration.
LAMUS 2
<Parameter name="nl.mpi.lamus.csdb_hybrid_db_resource"
value="java:comp/env/jdbc/CSDB_HYBRID"
description="corpusstructure (hybrid) database resource"
override="false"/>
<Parameter name="nl.mpi.lamus.lamus2_db_resource"
value="java:comp/env/jdbc/LAMUS2_DB"
description="lamus2 database resource"
override="false"/>
<Parameter name="nl.mpi.lamus.lamus2_manualUrl"
value="http://www.mpi.nl/corpus/html/lamus2/index.html"
description="location of the Lamus 2 Manual"
override="false"/>
<Parameter name="nl.mpi.lamus.workspace_base_directory"
value="/lat/corpora/lamus2/workspaces/"
description="Base path for workspaces"
override="false"/>
<Parameter name="nl.mpi.lamus.workspace_upload_directory_name"
value="upload"
description="Sub-directory for uploaded files in the workspace"
override="false"/>
<Parameter name="nl.mpi.lamus.corpusstructure_directory_name"
value="Corpusstructure"
description="Sub-directory for corpus in the archive domain"
override="false"/>
<Parameter name="nl.mpi.lamus.metadata_directory_name"
value="Metadata"
description="Sub-directory for metadata in the archive domain"
override="false"/>
<Parameter name="nl.mpi.lamus.annotations_directory_name"
value="Annotations"
description="Sub-directory for text resources in the archive domain"
override="false"/>
<Parameter name="nl.mpi.lamus.media_directory_name"
value="Media"
description="Sub-directory for media resources in the archive domain"
override="false"/>
<Parameter name="nl.mpi.lamus.info_directory_name"
value="Info"
description="Sub-directory for info files in the archive domain"
override="false"/>
<Parameter name="nl.mpi.lamus.orphans_directory_name"
value="sessions"
description="Directory, under a top node, which can be used as a backdoor for large files to be loaded into a workspace"
override="false"/>
<Parameter name="nl.mpi.lamus.trashcan_base_directory"
value="/lat/corpora/cmdi_test/trashcan/"
description="Path for deleted files in the archive"
override="false"/>
<Parameter name="nl.mpi.lamus.versioning_base_directory"
value="/lat/corpora/cmdi_test/versioning/"
description="Path for versioned files in the archive"
override="false"/>
<Parameter name="nl.mpi.lamus.db.httproot"
value="http://lux16.mpi.nl/cmdi_test/"
description="Base for node http URL"
override="false"/>
<Parameter name="nl.mpi.lamus.db.httpsroot"
value="https://lux16.mpi.nl/cmdi_test/"
description="Base for node https URL"
override="false"/>
<Parameter name="nl.mpi.lamus.db.localroot"
value="file:/lat/corpora/cmdi_test/"
description="Base for node local URL"
override="false"/>
<Parameter name="nl.mpi.lamus.mail.server"
value="mailhost.mpi.nl"
override="false"/>
<Parameter name="nl.mpi.lamus.mail.from_address"
value="[email protected]"
override="false"/>
<Parameter name="nl.mpi.lamus.mailAddress"
value="[email protected]"
description="the LAMUS will send messages to"
override="false"/>
<Parameter name="nl.mpi.lamus.manager.users"
value="[email protected]"
override="false"/>
<Parameter name="nl.mpi.lamus.handle.prefix"
value="11142"
override="false"/>
<Parameter name="nl.mpi.lamus.handle.admin_key_file"
value="/lat/tools/cmdiHandleAssigner/admpriv.bin"
override="false"/>
<Parameter name="nl.mpi.lamus.handle.admin_user_handle"
value="0.NA/11142"
override="false"/>
<Parameter name="nl.mpi.lamus.handle.admin_user_handle_index"
value="300"
override="false"/>
<Parameter name="nl.mpi.lamus.handle.admin_handle_password"
value="null"
override="false"/>
<Parameter name="nl.mpi.lamus.corpusstructure.service_location"
value="http://lux16.mpi.nl:8088/corpusstructure/api"
description="Location of the corpusstructure service API"
override="false"/>
<Parameter name="nl.mpi.lamus.corpusstructure.service_versioning_path"
value="version"
description="Path for the versioning service"
override="false"/>
<Parameter name="nl.mpi.lamus.corpusstructure.service_version_creation_path"
value="create"
description="Sub path for the versioning creation service"
override="false"/>
<Parameter name="nl.mpi.lamus.corpusstructure.service_crawler_path"
value="crawler"
description="Path for the crawler service"
override="false"/>
<Parameter name="nl.mpi.lamus.corpusstructure.service_crawler_start_path"
value="start"
description="Sub path for the crawler start service"
override="false"/>
<Parameter name="nl.mpi.lamus.corpusstructure.service_crawler_details_path"
value="details"
description="Sub path for the crawler details service"
override="false"/>
<Parameter name="nl.mpi.lamus.corpusstructure.service_archiveobjects_path"
value="archiveobjects"
description="Sub path for the archiveobjects service"
override="false"/>
<Parameter name="nl.mpi.lamus.corpusstructure.service_archiveobjects_updateurl_path"
value="updateurl"
description="Sub path for the archiveobjects updateurl service"
override="false"/>
<Parameter name="nl.mpi.lamus.translation_service.location"
value="https://lux16.mpi.nl/ds/TranslationService"
description="Location of the translation service"
override="false"/>
<Parameter name="nl.mpi.lamus.asv_openhandle_base_url"
value="https://lux16.mpi.nl/ds/asv_hybrid?openhandle="
description="Base URL to open a node in ASV using the hanlde"
override="false"/>
<Parameter name="nl.mpi.lamus.schematronValidationFile_upload"
value="/lat/tomcat-corpman/conf/cmdi_schematron_upload.sch"
description="Path to a schematron file to be used in Lamus for CMDI validation during file upload"
override="false"/>
<Parameter name="nl.mpi.lamus.schematronValidationFile_submit"
value="/lat/tomcat-corpman/conf/cmdi_schematron_submit.sch"
description="Path to a schematron file to be used in Lamus for CMDI validation during workspace submission"
override="false"/>
<Parameter name="nl.mpi.lamus.allowedProfilesFile"
value="/lat/tomcat-corpman/conf/cmdi_allowed_profiles.xml"
description="Path to an XML file containing the CMDI profiles allowed in the archive, including some information about them that can be useful to Lamus"
override="false"/>
<Parameter name="nl.mpi.lamus.permissionConfigFile_CMDI"
value="/lat/tomcat-corpman/conf/apa-permissions_cmdi.conf"
description="name of a config file containing paths which require adjustments in the filesystem permissions, done by Lamus2"
override="false"/>
<Parameter name="nl.mpi.lamus.typecheckerSpecialConfigFolders"
value="/lat/corpora/cmdi/TestRoot"
description="Comma separated list of paths (top nodes) where the typechecker special configuraiton should be applied (ARCHIVABLE_SHORTTERM becom acceptable within those folders)."
override="false"/>
<Parameter name="nl.mpi.lamus.type_recheck_size_limit_in_megabytes"
value="8"
description="File size limit for which the typechecker should check a file again (when importing from the archive)."
override="false"/>
<Parameter name="nl.mpi.lamus.max_directory_name_length"
value="100"
description="Used by ArchiveFileHelper.correctPathElement to truncate unreasonably long names."
override="false"/>
<Parameter name="nl.mpi.lamus.disallowed_folder_names_workspace"
value="^tmp$,^temp$,^DesktopFolderDB$,^\.svn$"
description="Folder names which are not allowed (reserved due to filesystem restrictions, for instance), defined as regular expressions."
override="false"/>
RRS
<Parameter name="nl.mpi.rrsUrl"
value="https://lux16.mpi.nl/ds/RRS_V1/"
description="Base URL for RRS"
override="false"/>
<Parameter name="nl.mpi.rrsRegister"
value="RrsRegistration"
description="Name of RrsRegistration"
override="false"/>
AMS2
<Parameter name="nl.mpi.auth.cmdi.baseurl"
value="http://127.0.0.1/am/ams2-cmdi"
description=""
override="false"/>
<Parameter name="nl.mpi.auth.recalc.url"
value="pages/recalc.face"
description=""
override="false"/>
<Parameter name="nl.mpi.auth.recalc.param"
value="nodeid"
description=""
override="false"/>
<Parameter name="nl.mpi.auth.recalc_csdb.url"
value="pages/recalc_csdb.face"
description=""
override="false"/>
<Parameter name="nl.mpi.auth.recalc_webserver.url"
value="pages/recalc_webserver.face"
description=""
override="false"/>
2. Schematron configuration
In order to perform the validation of allowed profiles being introduced into the archive, schematron is used.
Two schematron files are included in the configuration folder of tomcat-corpman, one to be used during upload (/lat/tomcat-corpman/conf/cmdi_schematron_upload.sch) and the other during submission (/lat/tomcat-corpman/conf/cmdi_schematron_submit.sch).
These schematron files need an extra file which contains the list of allowed CMDI profiles (/lat/tomcat-corpman/conf/cmdi_allowed_profiles.xml).
3. Filters
When building the application, a parameter is passed, indicating the server for which it is being compiled. This loads a few more properties from the filter file regarding the given server.
So, whenever the a new server is used to deploy the application, a new filter file should be created.
shhaa.li=https://lux16.mpi.nl/Shibboleth.sso/Login
shhaa.lo=https://lux16.mpi.nl/Shibboleth.sso/Logout
4. Frameworks
4.1. Spring
Lamus2 uses Spring mostly for dependency injection.
The chosen approach was the Java based configuration. So there are a few classes containing some bean definitions (usually under a package with "spring" in the name - for instance the class "LamusBeans"), but most of the beans are automatically created using annotations in the corresponding classes ("@Service" or "@Component"), while they are loaded into the depending classes using other annotations ("@Autowired" and "@Resource", for instance).
The properties included in "properties" files, as well as the web container context parameters, are loaded in a beans class (most of them in "LamusProperties"), also using Spring.
There are some beans which are defined multiple times with different values, depending on the usage. For instance, some beans require a value when the unit tests are being executed and a different one when the application is deployed in the server. For this purpose, a few Spring profiles are available. The profile for which a certain configuration file is used are defined with an annotation ("@Profile").
In the server, a couple of parameters are also defined for this purpose. These are defined, at the moment, in the file "jkc#lamus2.xml".
<Parameter name="spring.profiles.default" value="cmdi-production" description="Default Spring profile, may be overridden using spring.profiles.active" />
<Parameter name="spring.profiles.active" value="production" />
There are a few profiles mentioned throughout the code, but the most important are:
- cmdi-adapter-csdb (now used instead of "production", for the latest hybrid archive situation)
- production
- testing
The remaining ones are used in less common situations or are still being developed:
- demoserver
- mock
- acceptance
4.2. Hibernate/JPA
The JPA configuration is necessary in order to use the corpus structure API. More specifically, Lamus2 uses Hibernate to interact with it.
This configuration is located in the 'wicket' project (war file), under "src/main/resources". In the war package, it's located in "WEB-INF/classes/META-INF/persistence.xml".
At the moment it looks like this:
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="corpusstructure2-persistency" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<non-jta-data-source>java:/comp/env/jdbc/CSDB2</non-jta-data-source>
<class>nl.mpi.archiving.corpusstructure.core.database.pojo.ArchiveProperty</class>
<class>nl.mpi.archiving.corpusstructure.core.database.pojo.CorpusStructure</class>
<class>nl.mpi.archiving.corpusstructure.core.database.pojo.ArchiveObject</class>
<class>nl.mpi.archiving.corpusstructure.core.database.pojo.User</class>
<class>nl.mpi.archiving.corpusstructure.core.database.pojo.UserGroup</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
4.3. Wicket
This parameter is defined in "jkc#lamus2.xml" and indicates in which Wicket setting the application is being run.
<Parameter name="configuration" value="deployment" />