Project

General

Profile

Download (3.29 KB) Statistics
| Branch: | Tag: | Revision:
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
    app:
39
        image: jetty:9.4-jre8-slim
40
        ports:
41
        - "8080:8080"
42
        volumes:
43
        - ./webapps:/var/lib/jetty/webapps
44
        - ./log:/usr/local/jetty/log
45
        - ./utis:/var/lib/jetty/utis
46
        user: jetty
47
~~~
48

    
49
create the folders to be bound to the container
50

    
51
~~~
52
mkdir log utis webapps
53
~~~
54

    
55
copy the utis war file to the webapps folder
56

    
57
~~~
58
cp $WORKSPACE/target/eubon-utis.war webapps/eubon-utis.war
59
~~~
60

    
61
Set the permissions so that the user jetty has read and write access to these folders: 
62

    
63
~~~
64
chown -R jetty:jetty log utis webapps
65
chmod 774 jetty:jetty log utis webapps
66
~~~
67

    
68
start the docker container
69

    
70
~~~
71
docker-compose up -d
72
~~~
73

    
74
## Service end-point URLs
75

    
76
utis controllers:
77

    
78
* http://127.0.0.1:8080/eubon-utis/
79
* http://127.0.0.1:8080/eubon-utis/search.html
80
* http://127.0.0.1:8080/eubon-utis/capabilities.html
81

    
82
swagger api-doc REST service at:
83

    
84
* http://127.0.0.1:8080/eubon-utis/api-docs.json
85
* http://127.0.0.1:8080/eubon-utis/api-docs/default/utis-controller.json
86

    
87
swagger ui at:
88

    
89
* http://127.0.0.1:8080/eubon-utis/doc/
90

    
91
## Logfiles
92

    
93
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`.
94
The `ContextDependentInitializer` may choose to place the logs into another  directory if it is not possible to write the logs into `/var/log/utis`. 
95
Please refer to this class for further details.
96

    
97
## Development
98

    
99
### Running in dev mode
100

    
101
UTIS can be configuired for easier development. This encompasses two java system properties which can be specifed by passing environment variables to the jvm:
102

    
103

    
104
#### `excludedClients`
105

    
106
    -DexcludedClients=[Client class simple names comma separated]
107
    
108
The client adapters identified by their simple class name will be disabled. See `org.bgbm.utis.controller.UtisController` line 9ff for implementation details.
109

    
110
e.g:
111
     
112
    -DexcludedClients=EUNIS_Client,GBIFBackboneClient,PlaziClient
113
    
114
will disable the named clients "EUNIS_Client,GBIFBackboneClient,PlaziClient" which have time and cpu consuming startup phases.
115

    
116
### `skipStoreUpdating`
117

    
118
This option will cause the `org.cybertaxonomy.utis.store.Neo4jStoreUpdater` to completely skip the continiuous updating of the the cached data which 
119
is otherwise fetched from the source on a periodic base:
120

    
121
    -DskipStoreUpdating
122

    
123

    
124
### Using swagger
125

    
126
* https://github.com/martypitt/swagger-springmvc
127
* https://github.com/adrianbk/swagger-springmvc-demo/tree/master/swagger-ui
128

    
129

    
130
### On Spring MVC
131
Content Negotiation Using Spring MVC
132
* http://java.dzone.com/articles/content-negotiation-using
(2-2/3)