Commit df8a2824 authored by Benjamin Rokseth's avatar Benjamin Rokseth
Browse files

Rename PORT to URL for Koha and Fuseki services

parent 4eb46130
...@@ -2,8 +2,8 @@ FROM java:8 ...@@ -2,8 +2,8 @@ FROM java:8
ADD ./build/libs/services-1.0-SNAPSHOT-standalone.jar /services/ ADD ./build/libs/services-1.0-SNAPSHOT-standalone.jar /services/
WORKDIR /services WORKDIR /services
CMD java \ CMD java \
-DKOHA_PORT="$KOHA_PORT" \ -DKOHA_URL="$KOHA_URL" \
-DKOHA_USER="$KOHA_USER" \ -DKOHA_USER="$KOHA_USER" \
-DKOHA_PASSWORD="$KOHA_PASSWORD" \ -DKOHA_PASSWORD="$KOHA_PASSWORD" \
-DFUSEKI_PORT="$FUSEKI_PORT" \ -DFUSEKI_URL="$FUSEKI_URL" \
-jar /services/services-1.0-SNAPSHOT-standalone.jar -jar /services/services-1.0-SNAPSHOT-standalone.jar
KOHA_PORT=http://192.168.50.12:8081 KOHA_URL=http://192.168.50.12:8081
KOHA_USER=admin KOHA_USER=admin
KOHA_PASSWORD=secret KOHA_PASSWORD=secret
FUSEKI_PORT=http://192.168.50.50:3030 FUSEKI_URL=http://192.168.50.50:3030
...@@ -23,7 +23,7 @@ import java.nio.charset.StandardCharsets; ...@@ -23,7 +23,7 @@ import java.nio.charset.StandardCharsets;
public class KohaAdapterDefault implements KohaAdapter { public class KohaAdapterDefault implements KohaAdapter {
private static final String KOHA_PORT = System.getProperty("KOHA_PORT", "http://192.168.50.12:8081"); private static final String KOHA_URL = System.getProperty("KOHA_URL", "http://192.168.50.12:8081");
private static final String KOHA_USER = System.getProperty("KOHA_USER", "admin"); private static final String KOHA_USER = System.getProperty("KOHA_USER", "admin");
private static final String KOHA_PASSWORD = System.getProperty("KOHA_PASSWORD", "secret"); private static final String KOHA_PASSWORD = System.getProperty("KOHA_PASSWORD", "secret");
private static final String SESSION_COOKIE_KEY = "CGISESSID"; private static final String SESSION_COOKIE_KEY = "CGISESSID";
...@@ -31,11 +31,11 @@ public class KohaAdapterDefault implements KohaAdapter { ...@@ -31,11 +31,11 @@ public class KohaAdapterDefault implements KohaAdapter {
private NewCookie sessionCookie; private NewCookie sessionCookie;
public KohaAdapterDefault() { public KohaAdapterDefault() {
System.out.println("Koha adapter started with KOHA_PORT: " + KOHA_PORT); System.out.println("Koha adapter started with KOHA_URL: " + KOHA_URL);
} }
private void login() { private void login() {
String url = KOHA_PORT + "/cgi-bin/koha/svc/authentication"; String url = KOHA_URL + "/cgi-bin/koha/svc/authentication";
Form form = new Form(); Form form = new Form();
form.param("userid", KOHA_USER); form.param("userid", KOHA_USER);
...@@ -78,7 +78,7 @@ public class KohaAdapterDefault implements KohaAdapter { ...@@ -78,7 +78,7 @@ public class KohaAdapterDefault implements KohaAdapter {
private Response requestItems(String id) { private Response requestItems(String id) {
Client client = ClientBuilder.newClient(); Client client = ClientBuilder.newClient();
String url = KOHA_PORT + "/cgi-bin/koha/svc/bib/" + id + "?items=1"; String url = KOHA_URL + "/cgi-bin/koha/svc/bib/" + id + "?items=1";
WebTarget webTarget = client.target(url); WebTarget webTarget = client.target(url);
Invocation.Builder invocationBuilder = webTarget.request(MediaType.TEXT_XML); Invocation.Builder invocationBuilder = webTarget.request(MediaType.TEXT_XML);
invocationBuilder.cookie(sessionCookie.toCookie()); invocationBuilder.cookie(sessionCookie.toCookie());
......
...@@ -23,12 +23,12 @@ import no.deichman.services.utils.RandomStringDefault; ...@@ -23,12 +23,12 @@ import no.deichman.services.utils.RandomStringDefault;
public class RepositoryDefault implements Repository { public class RepositoryDefault implements Repository {
private static final String FUSEKI_PORT = System.getProperty("FUSEKI_PORT", "http://192.168.50.50:3030"); private static final String FUSEKI_URL = System.getProperty("FUSEKI_URL", "http://192.168.50.50:3030");
private static final String UPDATE_URI = FUSEKI_PORT + "/ds/update"; private static final String UPDATE_URI = FUSEKI_URL + "/ds/update";
private static final String SPARQL_URI = FUSEKI_PORT + "/ds/sparql"; private static final String SPARQL_URI = FUSEKI_URL + "/ds/sparql";
public RepositoryDefault() { public RepositoryDefault() {
System.out.println("Repository started with FUSEKI_PORT: " + FUSEKI_PORT); System.out.println("Repository started with FUSEKI_URL: " + FUSEKI_URL);
} }
@Override @Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment