Commit c1f8df4c authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

remove switchboard test, cleanup obsolete annotation artefacts

parent f8e603a4
Pipeline #134428 passed with stages
in 8 minutes and 51 seconds
......@@ -10,7 +10,6 @@ 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;
......@@ -25,9 +24,6 @@ import info.textgrid.rep.service.tgsearch.TgrepConfigurationService;
import info.textgrid.rep.service.tgsearch.TgsearchClientService;
import info.textgrid.rep.shared.Utils;
import info.textgrid.rep.shared.ViewMode;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.Jwts;
@Controller
public class BrowseController {
......@@ -38,9 +34,6 @@ public class BrowseController {
private AggregatorClientService aggregatorClient;
private I18NProvider i18nProvider;
@Value("${switchboard.test.enabled}")
private boolean switchboardTestEnabled;
private static final Log log = LogFactory.getLog(BrowseController.class);
@Autowired
......@@ -186,19 +179,6 @@ public class BrowseController {
// txt
String text4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/text/" + id , "UTF-8");
tools.add(new ViewMode("Switchboard (txt)", tgrepConfig.getToolSwitchboardHost() + "/" + text4switchboard + "/text%2Fplain", false));
// Switchboard TEST
if(switchboardTestEnabled) {
//tools.add(new ViewMode("Switchboard XML", tgrepConfig.getToolSwitchboardHost() + "/" + xml4switchboard+"/text%2Fxml", false));
tools.add(new ViewMode("Switchboard XML", tgrepConfig.getToolSwitchboardHost() + "/" + xml4switchboard+"/application%2Ftei+xml", false));
String html4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/html/" + id , "UTF-8");
tools.add(new ViewMode("Switchboard HTML", tgrepConfig.getToolSwitchboardHost() + "/" + html4switchboard+"/text%2Fhtml", false));
String pdf4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/pdf/" + id , "UTF-8");
tools.add(new ViewMode("Switchboard PDF", tgrepConfig.getToolSwitchboardHost() + "/" + pdf4switchboard+"/application%2Fpdf", false));
String xmlc4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/teicorpus/" + id , "UTF-8");
tools.add(new ViewMode("Switchboard TEI-Corpus", tgrepConfig.getToolSwitchboardHost() + "/" + xmlc4switchboard+"/text%2Fxml", false));
String zip4switchboard = URLEncoder.encode(tgrepConfig.getTextgridHost() + "/1.0/aggregator/zip/" + id , "UTF-8");
tools.add(new ViewMode("Switchboard zip", tgrepConfig.getToolSwitchboardHost() + "/" + zip4switchboard+"/application%2Fzip", false));
}
} catch (UnsupportedEncodingException e) {
log.error("error encoding url for switchboard", e);
}
......@@ -229,14 +209,6 @@ public class BrowseController {
model.addAttribute("tools", tools);
}
/*
* long userId = PortalUtil.getUserId(renderRequest); String userName =
* PortalUtil.getUserName(userId, ""); String eppn = Utils.getEppn(userId);
*
* if(Utils.userWantsAnnotation(userId)) { model.addAttribute("annotationEnabled", true);
* model.addAttribute("annotationToken", this.generateToken(prefs, eppn, userName)); }
*/
return "browse";
}
......@@ -256,12 +228,4 @@ public class BrowseController {
return false;
}
/* TODO: JWT generation */
public static String tokenFromAuthstring(String authString, String secret) {
Jws<Claims> jwtres = Jwts.parser().setSigningKey(secret.getBytes()).parseClaimsJws(authString);
String tstring = jwtres.getBody().get("token").toString();
String token = tstring.substring(tstring.lastIndexOf("@") + 1);
return token;
}
}
......@@ -16,5 +16,3 @@ tool.switchboard.host: https://switchboard.clarin.eu/#/textgridrep
lang.available: en, de
lang.default: en
# switchboard test
switchboard.test.enabled: false
......@@ -9,57 +9,17 @@
<%@ include file="components/js-incl.jsp" %>
<style>
iframe {
width: 100%;
}
iframe {
width: 100%;
}
</style>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
$("#htmlIframe").contents().find("body").attr("style","margin-left: 0");
});
document.addEventListener("DOMContentLoaded", function(event) {
$("#htmlIframe").contents().find("body").attr("style","margin-left: 0");
});
</script>
<c:if test="${annotationEnabled}">
<link rel="stylesheet" type="text/css" href="https://annotation.de.dariah.eu/annotatorjs/annotator.min.css" />
<script type="text/javascript" src="https://annotation.de.dariah.eu/annotatorjs/annotator-full.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var token = '${annotationToken}';
console.log("tkoen: " + token);
var ann = new Annotator(document.body);
/*ann.addPlugin('Auth', {
'token': token
});*/
ann.addPlugin('GroupPermissions');
var annotatorServerUrl = 'https://annotation.de.dariah.eu/AnnotationManager';
var uri = window.location.href;
ann.addPlugin('Store', {
prefix: annotatorServerUrl+'/annotator',
annotationData : {
'uri' : uri,
},
loadFromSearch : {
'limit' : 20,
'uri' : uri
}
});
// tags
ann.addPlugin('Tags');
ann.addPlugin('Filter');
});
</script>
</c:if>
<div class="tgrep wrap">
<c:if test="${browseRootAggregations}">
......
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