1 | DASISH annotator back-end installation |
---|
2 | ------------------------------------ |
---|
3 | |
---|
4 | Contents: |
---|
5 | - Requirements |
---|
6 | - Installation and configuration |
---|
7 | -- placing war-file and ds#webannotator.xml |
---|
8 | -- The fragment to be present in Tomcat's context.xml |
---|
9 | -- The fragment to be present in Tomcat's web.xml |
---|
10 | - Testing |
---|
11 | |
---|
12 | |
---|
13 | = Requirements = |
---|
14 | |
---|
15 | * annotator-backend-XXX-mpi-deploy.tar.gz package |
---|
16 | * Tomcat >=6 |
---|
17 | * PostgreSQL >=9.2.4 database for keeping annotations |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | = Installation and configuration = |
---|
22 | ========================================================================================= |
---|
23 | == Plasing war-file and ds#webannotator.xml at the tomcat's conf/Catalina/localhost == |
---|
24 | |
---|
25 | You must deploy the annotator's .war file to the tomcat-webuser. Make a directory for the |
---|
26 | application, like e.g. lat/webapps/dasish-web-annotator on lux16, and deploy .war there following |
---|
27 | the standard TLA procedure. |
---|
28 | |
---|
29 | Then the corresponding ds#webannotator.xml looks as follows: |
---|
30 | |
---|
31 | <?xml version='1.0' encoding='utf-8'?> |
---|
32 | <Context path="/ds/webannotator" |
---|
33 | docBase="/lat/webapps/dasish-web-annotator/current" |
---|
34 | debug="0" reloadable="true" crossContext="true"> |
---|
35 | </Context> |
---|
36 | |
---|
37 | |
---|
38 | ============================================================================================= |
---|
39 | == context.xml === |
---|
40 | |
---|
41 | The file must contain the fragment for the database, like e.g.on lux16: |
---|
42 | |
---|
43 | <Resource |
---|
44 | name="jdbc/DASISH" |
---|
45 | auth="Container" |
---|
46 | type="javax.sql.DataSource" |
---|
47 | driverClassName="org.postgresql.Driver" |
---|
48 | url="jdbc:postgresql://localhost/dasish" |
---|
49 | username="XXXXXXX" |
---|
50 | password="YYYYYYY" |
---|
51 | maxActive="20" |
---|
52 | maxIdle="5" |
---|
53 | maxWait="4000" /> |
---|
54 | |
---|
55 | |
---|
56 | ============================================================================================= |
---|
57 | == web.xml === |
---|
58 | |
---|
59 | So far no parameters to be placed in the "global" web.xml |
---|
60 | |
---|
61 | |
---|
62 | ============================================================================================= |
---|
63 | |
---|
64 | = Testing = |
---|
65 | |
---|
66 | If the application is succesfully deployed, you will get the jsp page after requesting |
---|
67 | |
---|
68 | <server uri>/ds/webannotator |
---|
69 | |
---|
70 | Note that the path "ds/webannotator" is the same as mentioned in ds#webannotator.xml above. |
---|
71 | |
---|
72 | On this web-page there is a number of test GET requests there which you can send if you want |
---|
73 | to check if it works. For this you will need a login and a password. Ask the dasish backend's |
---|
74 | responsible developer (Olha). |
---|
75 | |
---|
76 | If you want to test POST, PUT and DELETE requests use e.g. |
---|
77 | |
---|
78 | -- chrome REST console, see |
---|
79 | https://chrome.google.com/webstore/detail/rest-console/cokgbflfommojglbmbpenpphppikmonn |
---|
80 | |
---|
81 | -- or a FireFox add-on "Rest client", |
---|
82 | see https://addons.mozilla.org/nl/firefox/addon/restclient/ |
---|
83 | |
---|
84 | NOTE that POST and PUT |
---|
85 | |
---|
86 | For Posting/Putting files of cached representations use curl, e.g. |
---|
87 | |
---|
88 | curl -u <user>:<password> -H "Content-Type: multipart/mixed" -F |
---|
89 | "metadata=@cachedInfoToAdd.xml; type=application/xml " -F "content=@artnouveauspain.png; |
---|
90 | type=image/png" -X POST |
---|
91 | http://localhost:8080/annotator-backend/api/targets/00000000-0000-0000-0000-000000000033/fragment/"(1,1)"/cached -i -v |
---|
92 | |
---|
93 | |
---|
94 | |
---|