Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
digibib
ls.ext
Commits
df8a2824
Commit
df8a2824
authored
May 07, 2015
by
Benjamin Rokseth
Browse files
Rename PORT to URL for Koha and Fuseki services
parent
4eb46130
Changes
4
Hide whitespace changes
Inline
Side-by-side
services/Dockerfile
View file @
df8a2824
...
@@ -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
services/services.dev.env
View file @
df8a2824
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
services/src/main/java/no/deichman/services/kohaadapter/KohaAdapterDefault.java
View file @
df8a2824
...
@@ -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
());
...
...
services/src/main/java/no/deichman/services/repository/RepositoryDefault.java
View file @
df8a2824
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment