1
|
# UTIS - README
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
## Installation
|
7
|
|
8
|
At the example of jetty8 in Debian like systems:
|
9
|
|
10
|
### Requirements
|
11
|
|
12
|
Java runtime environment 1.8
|
13
|
|
14
|
## setting up with docker-compose
|
15
|
|
16
|
here we are using the official `jetty:9.4-jre8-slim` docker image that is provided by the jetty project on [Docker hub](https://hub.docker.com/_/jetty)
|
17
|
|
18
|
Requirement: Install **docker** and **docker-compose**
|
19
|
|
20
|
|
21
|
~~~
|
22
|
mkdir /opt/jetty9-docker
|
23
|
cd /opt/jetty9-docker
|
24
|
~~~
|
25
|
|
26
|
create user and group that are expected in the jetty9.4 container with the respective UID
|
27
|
|
28
|
~~~
|
29
|
addgroup --quiet --system jetty
|
30
|
adduser --quiet --system --ingroup jetty --no-create-home --disabled-password --uid 999 jetty
|
31
|
~~~
|
32
|
|
33
|
create a `docker-compose.yaml` file with the following content:
|
34
|
|
35
|
~~~
|
36
|
version: "2.0"
|
37
|
services:
|
38
|
utis-jetty:
|
39
|
restart: unless-stopped
|
40
|
image: jetty:9.4-jre8-slim
|
41
|
ports:
|
42
|
- "8080:8080"
|
43
|
volumes:
|
44
|
- ./webapps:/var/lib/jetty/webapps
|
45
|
- ./log:/usr/local/jetty/log
|
46
|
- ./utis:/var/lib/jetty/utis
|
47
|
user: jetty
|
48
|
~~~
|
49
|
|
50
|
create the folders to be bound to the container
|
51
|
|
52
|
~~~
|
53
|
mkdir log utis webapps
|
54
|
~~~
|
55
|
|
56
|
copy the utis war file to the webapps folder
|
57
|
|
58
|
~~~
|
59
|
cp $WORKSPACE/target/eubon-utis.war webapps/eubon-utis.war
|
60
|
~~~
|
61
|
|
62
|
Set the permissions so that the user jetty has read and write access to these folders:
|
63
|
|
64
|
~~~
|
65
|
chown -R jetty:jetty log utis webapps
|
66
|
chmod 774 jetty:jetty log utis webapps
|
67
|
~~~
|
68
|
|
69
|
start the docker container
|
70
|
|
71
|
~~~
|
72
|
docker-compose up -d
|
73
|
~~~
|
74
|
|
75
|
## Service end-point URLs
|
76
|
|
77
|
utis controllers:
|
78
|
|
79
|
* http://127.0.0.1:8080/eubon-utis/
|
80
|
* http://127.0.0.1:8080/eubon-utis/search.html
|
81
|
* http://127.0.0.1:8080/eubon-utis/capabilities.html
|
82
|
|
83
|
swagger api-doc REST service at:
|
84
|
|
85
|
* http://127.0.0.1:8080/eubon-utis/api-docs.json
|
86
|
* http://127.0.0.1:8080/eubon-utis/api-docs/default/utis-controller.json
|
87
|
|
88
|
swagger ui at:
|
89
|
|
90
|
* http://127.0.0.1:8080/eubon-utis/doc/
|
91
|
|
92
|
## Logfiles
|
93
|
|
94
|
Since version 1.3 on linux systems the logfiles are located at `/var/log/utis`. Previous versions of utis put the logfiles in `/var/log/jetty8`.
|
95
|
The `ContextDependentInitializer` may choose to place the logs into another directory if it is not possible to write the logs into `/var/log/utis`.
|
96
|
Please refer to this class for further details.
|
97
|
|
98
|
## Development
|
99
|
|
100
|
### Running in dev mode
|
101
|
|
102
|
UTIS can be configuired for easier development. This encompasses two java system properties which can be specifed by passing environment variables to the jvm:
|
103
|
|
104
|
|
105
|
#### `excludedClients`
|
106
|
|
107
|
-DexcludedClients=[Client class simple names comma separated]
|
108
|
|
109
|
The client adapters identified by their simple class name will be disabled. See `org.bgbm.utis.controller.UtisController` line 9ff for implementation details.
|
110
|
|
111
|
e.g:
|
112
|
|
113
|
-DexcludedClients=EUNIS_Client,GBIFBackboneClient,PlaziClient
|
114
|
|
115
|
will disable the named clients "EUNIS_Client,GBIFBackboneClient,PlaziClient" which have time and cpu consuming startup phases.
|
116
|
|
117
|
### `skipStoreUpdating`
|
118
|
|
119
|
This option will cause the `org.cybertaxonomy.utis.store.Neo4jStoreUpdater` to completely skip the continiuous updating of the the cached data which
|
120
|
is otherwise fetched from the source on a periodic base:
|
121
|
|
122
|
-DskipStoreUpdating
|
123
|
|
124
|
|
125
|
### Using swagger
|
126
|
|
127
|
* https://github.com/martypitt/swagger-springmvc
|
128
|
* https://github.com/adrianbk/swagger-springmvc-demo/tree/master/swagger-ui
|
129
|
|
130
|
|
131
|
### On Spring MVC
|
132
|
Content Negotiation Using Spring MVC
|
133
|
* http://java.dzone.com/articles/content-negotiation-using
|