Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DARIAH-DE
TextGridRep Portal
Commits
0a7ec97a
Commit
0a7ec97a
authored
Mar 12, 2020
by
Ubbo Veentjer
Browse files
use aggregator txt for download and switchboard
parent
1fdb6184
Pipeline
#127620
passed with stages
in 7 minutes and 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/info/textgrid/rep/browse/BrowseController.java
View file @
0a7ec97a
...
@@ -38,8 +38,8 @@ public class BrowseController {
...
@@ -38,8 +38,8 @@ public class BrowseController {
private
AggregatorClientService
aggregatorClient
;
private
AggregatorClientService
aggregatorClient
;
private
I18NProvider
i18nProvider
;
private
I18NProvider
i18nProvider
;
@Value
(
"${switchboard.enabled}"
)
@Value
(
"${switchboard.
test.
enabled}"
)
private
boolean
switchboardEnabled
;
private
boolean
switchboard
Test
Enabled
;
private
static
final
Log
log
=
LogFactory
.
getLog
(
BrowseController
.
class
);
private
static
final
Log
log
=
LogFactory
.
getLog
(
BrowseController
.
class
);
...
@@ -175,12 +175,14 @@ public class BrowseController {
...
@@ -175,12 +175,14 @@ public class BrowseController {
}
}
model
.
addAttribute
(
"teiHtml"
,
teiHtml
);
model
.
addAttribute
(
"teiHtml"
,
teiHtml
);
model
.
addAttribute
(
"isTEI"
,
true
);
model
.
addAttribute
(
"isTEI"
,
true
);
}
}
if
(
switchboardEnabled
)
{
try
{
String
text4switchboard
=
URLEncoder
.
encode
(
tgrepConfig
.
getTextgridHost
()
+
"/1.0/aggregator/text/"
+
id
,
"UTF-8"
);
tools
.
add
(
new
ViewMode
(
"Switchboard"
,
"https://switchboard.clarin-dev.eu/#/textgridrep/"
+
text4switchboard
+
"/text%2Fplain"
,
false
));
// Switchboard TEST
// Switchboard TEST
try
{
if
(
switchboardTestEnabled
)
{
String
xml4switchboard
=
URLEncoder
.
encode
(
tgrepConfig
.
getTextgridHost
()
+
"/1.0/tgcrud-public/rest/"
+
id
+
"/data"
,
"UTF-8"
);
String
xml4switchboard
=
URLEncoder
.
encode
(
tgrepConfig
.
getTextgridHost
()
+
"/1.0/tgcrud-public/rest/"
+
id
+
"/data"
,
"UTF-8"
);
//tools.add(new ViewMode("Switchboard XML", "https://switchboard.clarin-dev.eu/#/textgridrep/"+xml4switchboard+"/text%2Fxml", false));
//tools.add(new ViewMode("Switchboard XML", "https://switchboard.clarin-dev.eu/#/textgridrep/"+xml4switchboard+"/text%2Fxml", false));
tools
.
add
(
new
ViewMode
(
"Switchboard XML"
,
"https://switchboard.clarin-dev.eu/#/textgridrep/"
+
xml4switchboard
+
"/application%2Ftei+xml"
,
false
));
tools
.
add
(
new
ViewMode
(
"Switchboard XML"
,
"https://switchboard.clarin-dev.eu/#/textgridrep/"
+
xml4switchboard
+
"/application%2Ftei+xml"
,
false
));
...
@@ -192,12 +194,12 @@ public class BrowseController {
...
@@ -192,12 +194,12 @@ public class BrowseController {
tools
.
add
(
new
ViewMode
(
"Switchboard TEI-Corpus"
,
"https://switchboard.clarin-dev.eu/#/textgridrep/"
+
xmlc4switchboard
+
"/text%2Fxml"
,
false
));
tools
.
add
(
new
ViewMode
(
"Switchboard TEI-Corpus"
,
"https://switchboard.clarin-dev.eu/#/textgridrep/"
+
xmlc4switchboard
+
"/text%2Fxml"
,
false
));
String
zip4switchboard
=
URLEncoder
.
encode
(
tgrepConfig
.
getTextgridHost
()
+
"/1.0/aggregator/zip/"
+
id
,
"UTF-8"
);
String
zip4switchboard
=
URLEncoder
.
encode
(
tgrepConfig
.
getTextgridHost
()
+
"/1.0/aggregator/zip/"
+
id
,
"UTF-8"
);
tools
.
add
(
new
ViewMode
(
"Switchboard zip"
,
"https://switchboard.clarin-dev.eu/#/textgridrep/"
+
zip4switchboard
+
"/application%2Fzip"
,
false
));
tools
.
add
(
new
ViewMode
(
"Switchboard zip"
,
"https://switchboard.clarin-dev.eu/#/textgridrep/"
+
zip4switchboard
+
"/application%2Fzip"
,
false
));
}
catch
(
UnsupportedEncodingException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
}
catch
(
UnsupportedEncodingException
e
)
{
log
.
error
(
"error encoding url for switchboard"
,
e
);
}
}
// Voyant
// Voyant
tools
.
add
(
new
ViewMode
(
"Voyant"
,
tgrepConfig
.
getToolVoyantHost
()
+
"/?input="
+
tgrepConfig
.
getTextgridHost
()
+
"/1.0/tgcrud-public/rest/"
+
id
+
"/data"
,
false
,
"digivoy-button"
));
tools
.
add
(
new
ViewMode
(
"Voyant"
,
tgrepConfig
.
getToolVoyantHost
()
+
"/?input="
+
tgrepConfig
.
getTextgridHost
()
+
"/1.0/tgcrud-public/rest/"
+
id
+
"/data"
,
false
,
"digivoy-button"
));
...
...
src/main/resources/application.properties
View file @
0a7ec97a
...
@@ -15,4 +15,5 @@ lang.available: en, de
...
@@ -15,4 +15,5 @@ lang.available: en, de
lang.default
:
en
lang.default
:
en
# switchboard test
# switchboard test
switchboard.enabled
:
false
switchboard.test.enabled
:
false
\ No newline at end of file
src/main/webapp/WEB-INF/jsp/browse.jsp
View file @
0a7ec97a
...
@@ -161,6 +161,11 @@ document.addEventListener("DOMContentLoaded", function(event) {
...
@@ -161,6 +161,11 @@ document.addEventListener("DOMContentLoaded", function(event) {
</a>
</a>
</li>
</li>
<c:if
test=
"
${
isTEI
}
"
>
<c:if
test=
"
${
isTEI
}
"
>
<li>
<a
href=
"${textgridHost}/1.0/aggregator/text/${metadata.object.generic.generated.textgridUri.value}"
>
Plain Text (txt)
</a>
</li>
<li>
<li>
<a
href=
"${textgridHost}/1.0/aggregator/epub/${metadata.object.generic.generated.textgridUri.value}"
>
<a
href=
"${textgridHost}/1.0/aggregator/epub/${metadata.object.generic.generated.textgridUri.value}"
>
E-Book (epub)
E-Book (epub)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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