Commit 1fdb6184 authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

add conf option for enabling switchboard tests

parent 1f8a04db
Pipeline #123715 passed with stages
in 10 minutes and 56 seconds
......@@ -10,6 +10,7 @@ import javax.ws.rs.client.ClientBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -37,6 +38,9 @@ public class BrowseController {
private AggregatorClientService aggregatorClient;
private I18NProvider i18nProvider;
@Value("${switchboard.enabled}")
private boolean switchboardEnabled;
private static final Log log = LogFactory.getLog(BrowseController.class);
@Autowired
......@@ -174,25 +178,25 @@ public class BrowseController {
}
/*
// Switchboard TEST
try {
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");
tools.add(new ViewMode("Switchboard HTML", "https://switchboard.clarin-dev.eu/#/textgridrep/"+html4switchboard+"/text%2Fhtml", false));
String pdf4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/pdf/" + id , "UTF-8");
tools.add(new ViewMode("Switchboard PDF", "https://switchboard.clarin-dev.eu/#/textgridrep/"+pdf4switchboard+"/application%2Fpdf", false));
String xmlc4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/teicorpus/" + id , "UTF-8");
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();
if(switchboardEnabled) {
// Switchboard TEST
try {
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");
tools.add(new ViewMode("Switchboard HTML", "https://switchboard.clarin-dev.eu/#/textgridrep/"+html4switchboard+"/text%2Fhtml", false));
String pdf4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/pdf/" + id , "UTF-8");
tools.add(new ViewMode("Switchboard PDF", "https://switchboard.clarin-dev.eu/#/textgridrep/"+pdf4switchboard+"/application%2Fpdf", false));
String xmlc4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/teicorpus/" + id , "UTF-8");
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();
}
}
*/
// Voyant
tools.add(new ViewMode("Voyant", tgrepConfig.getToolVoyantHost() + "/?input=" + tgrepConfig.getTextgridHost() + "/1.0/tgcrud-public/rest/" + id + "/data", false, "digivoy-button"));
......
......@@ -13,3 +13,6 @@ tool.digilib.host: https://textgridlab.org/1.0/tgrep/digilib
lang.available: en, de
lang.default: en
# switchboard test
switchboard.enabled: false
\ No newline at end of file
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