Commit 0a7ec97a authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

use aggregator txt for download and switchboard

parent 1fdb6184
Pipeline #127620 passed with stages
in 7 minutes and 17 seconds
......@@ -38,8 +38,8 @@ public class BrowseController {
private AggregatorClientService aggregatorClient;
private I18NProvider i18nProvider;
@Value("${switchboard.enabled}")
private boolean switchboardEnabled;
@Value("${switchboard.test.enabled}")
private boolean switchboardTestEnabled;
private static final Log log = LogFactory.getLog(BrowseController.class);
......@@ -175,12 +175,14 @@ public class BrowseController {
}
model.addAttribute("teiHtml", teiHtml);
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
try {
if(switchboardTestEnabled) {
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+"/application%2Ftei+xml", false));
......@@ -192,12 +194,12 @@ public class BrowseController {
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");
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
tools.add(new ViewMode("Voyant", tgrepConfig.getToolVoyantHost() + "/?input=" + tgrepConfig.getTextgridHost() + "/1.0/tgcrud-public/rest/" + id + "/data", false, "digivoy-button"));
......
......@@ -15,4 +15,5 @@ lang.available: en, de
lang.default: en
# switchboard test
switchboard.enabled: false
\ No newline at end of file
switchboard.test.enabled: false
......@@ -161,6 +161,11 @@ document.addEventListener("DOMContentLoaded", function(event) {
</a>
</li>
<c:if test="${isTEI}">
<li>
<a href="${textgridHost}/1.0/aggregator/text/${metadata.object.generic.generated.textgridUri.value}">
Plain Text (txt)
</a>
</li>
<li>
<a href="${textgridHost}/1.0/aggregator/epub/${metadata.object.generic.generated.textgridUri.value}">
E-Book (epub)
......
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