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
1fdb6184
Commit
1fdb6184
authored
Mar 04, 2020
by
Ubbo Veentjer
Browse files
add conf option for enabling switchboard tests
parent
1f8a04db
Pipeline
#123715
passed with stages
in 10 minutes and 56 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/info/textgrid/rep/browse/BrowseController.java
View file @
1fdb6184
...
...
@@ -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"
));
...
...
src/main/resources/application.properties
View file @
1fdb6184
...
...
@@ -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
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