Commit 25480ac7 authored by Stefan Funk's avatar Stefan Funk 🐧
Browse files

Add handleHost param in config file

Add switchboardHost and set productive LSR hostname
Add switchboard XML tool link
parent 7eacc29b
......@@ -68,6 +68,7 @@ public class BrowseController {
// common variables for browse-root aggregations and browse single items
model.addAttribute("textgridHost", this.tgrepConfig.getTextgridHost());
model.addAttribute("handleHost", this.tgrepConfig.getHandleHost());
model.addAttribute("mode", mode);
model.addAttribute("i18n", i18n.getTranslationMap());
model.addAttribute("language", i18n.getLanguage());
......@@ -177,13 +178,16 @@ public class BrowseController {
model.addAttribute("isTEI", true);
}
// CLARIN Language Resource Switchboard (LRS)
try {
// XML
String xml4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/tgcrud-public/rest/" + id + "/data", "UTF-8");
tools.add(new ViewMode("Switchboard (TEI)", tgrepConfig.getToolSwitchboardHost() + "/" + xml4switchboard + "/application%2Ftei+xml", false));
// txt
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));
tools.add(new ViewMode("Switchboard (txt)", tgrepConfig.getToolSwitchboardHost() + "/" + text4switchboard + "/text%2Fplain", false));
// Switchboard TEST
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));
String html4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/html/" + id , "UTF-8");
......@@ -199,7 +203,6 @@ public class BrowseController {
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));
......
......@@ -104,6 +104,7 @@ public class SearchController {
model.addAttribute("aggregatorSandboxParam", aggregatorSandboxParam);
model.addAttribute("realQueryString", realQueryString);
model.addAttribute("textgridHost", this.tgrepConfig.getTextgridHost());
model.addAttribute("handleHost", this.tgrepConfig.getHandleHost());
// translation array
model.addAttribute("i18n", i18n.getTranslationMap());
......
......@@ -9,6 +9,8 @@ public class TgrepConfigurationService {
@Value("${textgrid.host}")
private String textgridHost;
@Value("${handle.host}")
private String handleHost;
@Value("${tool.voyant.host}")
private String toolVoyantHost;
@Value("${tool.annotate.host}")
......@@ -17,6 +19,8 @@ public class TgrepConfigurationService {
private String toolMiradorHost;
@Value("${tool.digilib.host}")
private String toolDigilibHost;
@Value("${tool.switchboard.host}")
private String toolSwitchboardHost;
public String getTextgridHost() {
return textgridHost;
......@@ -25,6 +29,13 @@ public class TgrepConfigurationService {
this.textgridHost = textgridHost;
}
public String getHandleHost() {
return handleHost;
}
public void setHandleHost(String handleHost) {
this.handleHost = handleHost;
}
public String getToolVoyantHost() {
return toolVoyantHost;
}
......@@ -53,13 +64,22 @@ public class TgrepConfigurationService {
this.toolDigilibHost = toolDigilibHost;
}
public String getToolSwitchboardHost() {
return toolSwitchboardHost;
}
public void setToolSwitchboardHost(String toolSwitchboardHost) {
this.toolSwitchboardHost = toolSwitchboardHost;
}
@PostConstruct
public void postConstruct() {
System.out.println("--------textgrid host: " + textgridHost);
System.out.println("--------voyant host: " + toolVoyantHost);
System.out.println("--------annotate host: " + toolAnnotateHost);
System.out.println("--------mirador host: " + toolMiradorHost);
System.out.println("--------digilib host: " + toolDigilibHost);
System.out.println("--------textgrid host: " + textgridHost);
System.out.println("--------handle host: " + handleHost);
System.out.println("--------voyant host: " + toolVoyantHost);
System.out.println("--------annotate host: " + toolAnnotateHost);
System.out.println("--------mirador host: " + toolMiradorHost);
System.out.println("--------digilib host: " + toolDigilibHost);
System.out.println("--------switchboard host: " + toolSwitchboardHost);
}
}
......@@ -4,16 +4,17 @@ spring.mvc.view.suffix: .jsp
# textgrid defaults
textgrid.host: https://textgridlab.org
handle.host: https://hdl.handle.net
# tool defaults
tool.voyant.host: https://voyant-tools.org
tool.annotate.host: https://annotation.de.dariah.eu/AnnotationViewer
tool.mirador.host: https://textgridlab.org/1.0/iiif/mirador
tool.digilib.host: https://textgridlab.org/1.0/tgrep/digilib
tool.switchboard.host: https://switchboard.clarin.eu/#/textgridrep
lang.available: en, de
lang.default: en
# switchboard test
switchboard.test.enabled: false
......@@ -136,7 +136,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
</c:if>
<c:if test="${not empty metadata.object.generic.generated.pid[0].value}">
<dt>${i18n['pid']}</dt>
<dd><a href="https://hdl.handle.net/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">${metadata.object.generic.generated.pid[0].value}</a><br/>
<dd><a href="${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">${metadata.object.generic.generated.pid[0].value}</a><br/>
<a href="#citation">${i18n['citation']}</a></dd>
</c:if>
</dl>
......
......@@ -122,8 +122,8 @@
<dt>${i18n['pid']}</dt>
<dd>
${result.object.generic.generated.pid[0].value}
(<a href="http://hdl.handle.net/${result.object.generic.generated.pid[0].value}">resolve PID</a> /
<a href="http://hdl.handle.net/${result.object.generic.generated.pid[0].value}?noredirect">PID-metadata</a>)
(<a href="${handleHost}/${result.object.generic.generated.pid[0].value}">resolve PID</a> /
<a href="${handleHost}/${result.object.generic.generated.pid[0].value}?noredirect">PID metadata</a>)
</dd>
</c:if>
<dt>${i18n['raw-metadata']}</dt>
......
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