Commit 431681b6 authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

add a controller advice component for common model additions

improves #56
parent e1ca5003
Pipeline #139134 passed with stages
in 9 minutes and 45 seconds
package info.textgrid.rep;
import java.util.Locale;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;
import info.textgrid.rep.i18n.I18N;
import info.textgrid.rep.i18n.I18NProvider;
import info.textgrid.rep.service.TgrepConfigurationService;
/**
* Add ModelAttributes to all Controllers which are needed for
* all Models like i18n (the translation map) or the config
*
* @author Ubbo Veentjer
*/
@ControllerAdvice
public class CommonModelControllerAdvice {
private TgrepConfigurationService tgrepConfig;
private I18NProvider i18nProvider;
@Autowired
public CommonModelControllerAdvice(I18NProvider i18nProvider, TgrepConfigurationService tgrepConfig) {
this.i18nProvider = i18nProvider;
this.tgrepConfig = tgrepConfig;
}
@ModelAttribute
public void handleRequest(Model model, Locale locale) {
I18N i18n = i18nProvider.getI18N(locale);
// translation array
model.addAttribute("i18n", i18n.getTranslationMap());
model.addAttribute("language", i18n.getLanguage());
// config
model.addAttribute("config", this.tgrepConfig);
}
}
......@@ -2,37 +2,24 @@ package info.textgrid.rep;
import java.util.Locale;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import info.textgrid.rep.i18n.I18N;
import info.textgrid.rep.i18n.I18NProvider;
@Controller
public class TGRepErrorController implements ErrorController {
@Autowired
private I18NProvider i18nProvider;
@RequestMapping("/error")
public String handleError(Model model, Locale locale, HttpServletRequest request) {
I18N i18n = i18nProvider.getI18N(locale);
if(request.getAttribute("javax.servlet.error.exception") != null) {
Exception exception = (Exception) request.getAttribute("javax.servlet.error.exception");
model.addAttribute("exception", exception.getMessage());
model.addAttribute("stacktrace", exception.getStackTrace());
}
model.addAttribute("statusCode", request.getAttribute("javax.servlet.error.status_code"));
// translation array
model.addAttribute("i18n", i18n.getTranslationMap());
model.addAttribute("language", i18n.getLanguage());
return "error";
}
......
package info.textgrid.rep.advancedsearch;
import java.util.Locale;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import info.textgrid.rep.i18n.I18N;
import info.textgrid.rep.i18n.I18NProvider;
@Controller
public class AdvancedSearchController {
private static final Log log = LogFactory.getLog(AdvancedSearchController.class);
private I18NProvider i18nProvider;
@Autowired
public AdvancedSearchController(I18NProvider i18nProvider) {
this.i18nProvider = i18nProvider;
}
@GetMapping("/advanced-search")
public String render(
Locale locale,
Model model) {
I18N i18n = i18nProvider.getI18N(locale);
model.addAttribute("i18n", i18n.getTranslationMap());
model.addAttribute("language", i18n.getLanguage());
public String render(Model model) {
return "advancedsearch";
}
......
......@@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.SessionAttributes;
import info.textgrid.namespaces.middleware.tgsearch.ResultType;
import info.textgrid.rep.i18n.I18N;
import info.textgrid.rep.i18n.I18NProvider;
import info.textgrid.rep.service.TgrepConfigurationService;
import info.textgrid.rep.service.TgsearchClientService;
import info.textgrid.rep.shared.ViewMode;
......@@ -26,9 +25,6 @@ public class BasketController {
@Autowired
private TgsearchClientService tgsearchClientService;
@Autowired
private TgrepConfigurationService tgrepConfig;
@Autowired
private I18NProvider i18nProvider;
......@@ -65,14 +61,7 @@ public class BasketController {
model.addAttribute("viewmodes", viewmodes);
model.addAttribute("results", results);
model.addAttribute("aggregatorUrl", tgrepConfig.getTextgridHost()+"/1.0/aggregator");
model.addAttribute("voyantUrl", tgrepConfig.getToolVoyantHost());
model.addAttribute("basketItemString", basket.getItemsAsString());
model.addAttribute("textgridHost", this.tgrepConfig.getTextgridHost());
// translation array
model.addAttribute("i18n", i18n.getTranslationMap());
model.addAttribute("language", i18n.getLanguage());
return "basket";
......
......@@ -6,7 +6,6 @@ import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
......@@ -68,11 +67,7 @@ public class BrowseController {
I18N i18n = i18nProvider.getI18N(locale);
// common variables for browse-root aggregations and browse single items
model.addAttribute("handleHost", this.tgrepConfig.getHandleHost());
model.addAttribute("textgridHost", this.tgrepConfig.getTextgridHost());
model.addAttribute("mode", mode);
model.addAttribute("i18n", i18n.getTranslationMap());
model.addAttribute("language", i18n.getLanguage());
// if no id, browse all root aggregations
if (id == null || id.equals("root")) {
......@@ -202,7 +197,7 @@ public class BrowseController {
}
// Voyant
tools.add(new ViewMode("Voyant", tgrepConfig.getToolVoyantHost() + "/?input=" + tgrepConfig.getTextgridHost() + "/1.0/tgcrud-public/rest/" + id + "/data", false));
tools.add(new ViewMode("Voyant", tgrepConfig.getVoyantHost() + "/?input=" + tgrepConfig.getTextgridHost() + "/1.0/tgcrud-public/rest/" + id + "/data", false));
// Annotate
tools.add(new ViewMode("Annotate", tgrepConfig.getToolAnnotateHost() + "/data.html?uri=" + id, false, "annotation-button"));
......
......@@ -12,8 +12,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import info.textgrid.namespaces.middleware.tgsearch.FacetType;
import info.textgrid.rep.i18n.I18N;
import info.textgrid.rep.i18n.I18NProvider;
import info.textgrid.rep.service.TgsearchClientService;
@Controller
......@@ -22,9 +20,6 @@ public class BrowseFacetController {
@Autowired
private TgsearchClientService tgsearchClientService;
@Autowired
private I18NProvider i18nProvider;
private static final Log log = LogFactory.getLog(BrowseFacetController.class);
@GetMapping("/facet/{facet}")
......@@ -35,9 +30,7 @@ public class BrowseFacetController {
@RequestParam(value="limit", required=false, defaultValue="0") int limit,
@RequestParam(value="order", required=false, defaultValue="count.desc") String order) {
I18N i18n = i18nProvider.getI18N(locale);
// boolean sandbox = Utils.userWantsSandbox(PortalUtil.getUserId(renderRequest));
boolean sandbox = false;
// list facets configured for this portlet
......@@ -46,8 +39,6 @@ public class BrowseFacetController {
List<FacetType> facets = tgsearchClientService.listFacet(facetList, limit, order, sandbox)
.getFacetGroup().get(0).getFacet();
model.addAttribute("i18n", i18n.getTranslationMap());
model.addAttribute("language", i18n.getLanguage());
model.addAttribute("facets", facets);
model.addAttribute("facet", facet);
return "browsefacet";
......
package info.textgrid.rep.markdown;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Locale;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.commonmark.node.Node;
import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
......@@ -61,8 +57,6 @@ public class DocController {
}
model.addAttribute("content", content);
model.addAttribute("i18n", i18n.getTranslationMap());
model.addAttribute("language", i18n.getLanguage());
return "markdown";
......
......@@ -17,7 +17,6 @@ import org.springframework.web.util.HtmlUtils;
import info.textgrid.namespaces.middleware.tgsearch.Response;
import info.textgrid.rep.i18n.I18N;
import info.textgrid.rep.i18n.I18NProvider;
import info.textgrid.rep.service.TgrepConfigurationService;
import info.textgrid.rep.service.TgsearchClientService;
import info.textgrid.rep.shared.Pager;
import info.textgrid.rep.shared.Utils;
......@@ -29,9 +28,6 @@ public class SearchController {
@Autowired
private TgsearchClientService tgsearchClientService;
@Autowired
private TgrepConfigurationService tgrepConfig;
@Autowired
private I18NProvider i18nProvider;
......@@ -96,15 +92,8 @@ public class SearchController {
model.addAttribute("limit", limit);
model.addAttribute("filter", filter);
model.addAttribute("filterQueryString", Utils.getFilterQueryString(filter));
model.addAttribute("aggregatorUrl", this.tgrepConfig.getTextgridHost() + "/1.0/aggregator");
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());
model.addAttribute("language", i18n.getLanguage());
// which .jsp to render
return "search";
......
......@@ -16,7 +16,7 @@ public class TgrepConfigurationService {
@Value("${handle.host}")
private String handleHost;
@Value("${tool.voyant.host}")
private String toolVoyantHost;
private String voyantHost;
@Value("${tool.annotate.host}")
private String toolAnnotateHost;
@Value("${tool.mirador.host}")
......@@ -40,11 +40,11 @@ public class TgrepConfigurationService {
this.handleHost = handleHost;
}
public String getToolVoyantHost() {
return toolVoyantHost;
public String getVoyantHost() {
return voyantHost;
}
public void setToolVoyantHost(String toolVoyantHost) {
this.toolVoyantHost = toolVoyantHost;
public void setToolVoyantHost(String voyantHost) {
this.voyantHost = voyantHost;
}
public String getToolAnnotateHost() {
......@@ -75,11 +75,16 @@ public class TgrepConfigurationService {
this.toolSwitchboardHost = toolSwitchboardHost;
}
// composed
public String getAggregatorUrl() {
return getTextgridHost()+"/1.0/aggregator";
}
@PostConstruct
public void postConstruct() {
log.info("textgrid host: " + textgridHost);
log.info("handle host: " + handleHost);
log.info("voyant host: " + toolVoyantHost);
log.info("voyant host: " + voyantHost);
log.info("annotate host: " + toolAnnotateHost);
log.info("mirador host: " + toolMiradorHost);
log.info("digilib host: " + toolDigilibHost);
......
......@@ -39,7 +39,7 @@
<h3 class="tgrep sidebar_subheading">${i18n['tools']}</h3>
<ul class="tgrep sidebar_list">
<li class="tgrep sidebar_item">
<a class="aggregator-items" href="${voyantUrl}?input=${aggregatorUrl}/zip/${basketItemString}?meta=false&only=text/xml" rel="noindex nofollow" class="tgrep sidebar_link">Voyant</a>
<a class="aggregator-items" href="${config.voyantHost}?input=${config.aggregatorUrl}/zip/${basketItemString}?meta=false&only=text/xml" rel="noindex nofollow" class="tgrep sidebar_link">Voyant</a>
</li>
</ul>
</section>
......@@ -62,9 +62,9 @@
<div class="tg dropdown" role="group">
<a class="tg dropdown_toggle">${i18n['download-all']}</a>
<ul class="tg dropdown_menu">
<li class="tg dropdown_item"><a class="aggregator-items tg dropdown_link" href="${aggregatorUrl}/epub/${basketItemString}" data-type="ebook">E-Book</a></li>
<li class="tg dropdown_item"><a class="aggregator-items tg dropdown_link" href="${aggregatorUrl}/zip/${basketItemString}" data-type="zip">ZIP</a></li>
<li class="tg dropdown_item"><a class="aggregator-items tg dropdown_link" href="${aggregatorUrl}/teicorpus/${basketItemString}" data-type="teicorpus">TEI-Corpus</a></li>
<li class="tg dropdown_item"><a class="aggregator-items tg dropdown_link" href="${config.aggregatorUrl}/epub/${basketItemString}" data-type="ebook">E-Book</a></li>
<li class="tg dropdown_item"><a class="aggregator-items tg dropdown_link" href="${config.aggregatorUrl}/zip/${basketItemString}" data-type="zip">ZIP</a></li>
<li class="tg dropdown_item"><a class="aggregator-items tg dropdown_link" href="${config.aggregatorUrl}/teicorpus/${basketItemString}" data-type="teicorpus">TEI-Corpus</a></li>
</ul>
</div>
</div>
......
......@@ -78,7 +78,7 @@
</c:if>
<c:if test="${not empty metadata.object.generic.generated.pid[0].value}">
<dt>${i18n['pid']}</dt>
<dd><a href="${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">${metadata.object.generic.generated.pid[0].value}</a><br/>
<dd><a href="${config.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>
......@@ -101,44 +101,44 @@
<h3 class="tgrep sidebar_subheading">${i18n['download']}</h3>
<ul class="tgrep sidebar_list">
<li>
<a href="${textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data">
<a href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data">
${i18n['object']} <c:if test="${isTEI}">(TEI)</c:if>
</a>
</li>
<li>
<a href="${textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/metadata">
<a href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/metadata">
${i18n['metadata']} (XML)
</a>
</li>
<li>
<a href="${textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/tech">
<a href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/tech">
${i18n['techmd']} (XML)
</a>
</li>
<c:if test="${isTEI}">
<li>
<a href="${textgridHost}/1.0/aggregator/text/${metadata.object.generic.generated.textgridUri.value}">
<a href="${config.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}">
<a href="${config.textgridHost}/1.0/aggregator/epub/${metadata.object.generic.generated.textgridUri.value}">
E-Book (epub)
</a>
</li>
<li>
<a href="${textgridHost}/1.0/aggregator/html/${metadata.object.generic.generated.textgridUri.value}">
<a href="${config.textgridHost}/1.0/aggregator/html/${metadata.object.generic.generated.textgridUri.value}">
HTML
</a>
</li>
<li>
<a href="${textgridHost}/1.0/aggregator/zip/${metadata.object.generic.generated.textgridUri.value}">
<a href="${config.textgridHost}/1.0/aggregator/zip/${metadata.object.generic.generated.textgridUri.value}">
ZIP
</a>
</li>
</c:if>
<c:if test="${fn:contains(metadata.object.generic.provided.format, 'aggregation')}">
<a href="${textgridHost}/1.0/aggregator/teicorpus/${metadata.object.generic.generated.textgridUri.value}">
<a href="${config.textgridHost}/1.0/aggregator/teicorpus/${metadata.object.generic.generated.textgridUri.value}">
TEI-Corpus (XML)
</a>
</c:if>
......@@ -247,11 +247,11 @@
defaultZoomLevel: 1,
//sequenceMode: true,
prefixUrl: "/images/openseadragon/",
tileSources: "${textgridHost}/1.0/digilib/rest/IIIF/${metadata.object.generic.generated.textgridUri.value}/info.json"
tileSources: "${config.textgridHost}/1.0/digilib/rest/IIIF/${metadata.object.generic.generated.textgridUri.value}/info.json"
});
</script>
-->
<img src="${textgridHost}/1.0/digilib/rest/IIIF/${metadata.object.generic.generated.textgridUri.value}/full/,1000/0/native.jpg"/>
<img src="${config.textgridHost}/1.0/digilib/rest/IIIF/${metadata.object.generic.generated.textgridUri.value}/full/,1000/0/native.jpg"/>
</c:when>
<c:when test="${metadata.object.generic.provided.identifier[0].type eq 'METSXMLID'}">
......@@ -262,8 +262,8 @@
<p>
${i18n['iframe-html-message']}
</p>
<a target="_blank" href="${textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data">${i18n['open-html-in-new-window']}</a>
<iframe id="htmlIframe" width="560" height="600" frameborder="0" src="${textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data"></iframe>
<a target="_blank" href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data">${i18n['open-html-in-new-window']}</a>
<iframe id="htmlIframe" width="560" height="600" frameborder="0" src="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data"></iframe>
</c:when>
<c:when test="${metadata.object.generic.provided.format eq 'text/markdown'}">
......@@ -272,7 +272,7 @@
<c:otherwise>
<p>${i18n['dont-know-what-todo']} ${format}</p>
<a target="_blank" href="${textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data">${i18n['open-html-in-new-window']}</a>
<a target="_blank" href="${config.textgridHost}/1.0/tgcrud-public/rest/${metadata.object.generic.generated.textgridUri.value}/data">${i18n['open-html-in-new-window']}</a>
</c:otherwise>
</c:choose>
......
......@@ -7,8 +7,8 @@
<dl>
<dt>${i18n['edition-citation-heading']}</dt>
<dd>TextGrid Repository (${fn:substring(metadata.object.generic.generated.issued, 0, 4)}). ${metadata.object.edition.agent[0].value}. ${metadata.object.generic.provided.title[0]}. ${metadata.object.generic.generated.project.value}.
<a href="${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
<a href="${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
</a>
</dd>
</dl>
......@@ -18,8 +18,8 @@
<dl>
<dt>${i18n['collection-citation-heading']}</dt>
<dd>TextGrid Repository (${fn:substring(metadata.object.generic.generated.issued, 0, 4)}). ${metadata.object.generic.provided.title[0]}. ${metadata.object.generic.generated.project.value}. ${metadata.object.collection.collector[0].value}.
<a href="${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
<a href="${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
</a>
</dd>
</dl>
......@@ -37,8 +37,8 @@
</c:forEach>
</c:forEach>
${metadata.object.generic.provided.title[0]}. ${metadata.object.generic.generated.project.value}. ${metadata.object.item.rightsHolder[0].value}.
<a href="${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
<a href="${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
</a>
</dd>
</dl>
......@@ -48,8 +48,8 @@
<dl>
<dt>${i18n['work-citation-heading']}</dt>
<dd>TextGrid Repository (${fn:substring(metadata.object.generic.generated.issued, 0, 4)}). ${metadata.object.work.agent[0].value}. ${metadata.object.generic.provided.title[0]}. ${metadata.object.generic.generated.project.value}.
<a href="${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
<a href="${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
</a>
</dd>
</dl>
......@@ -67,8 +67,8 @@
</c:forEach>
</c:forEach>
${metadata.object.generic.provided.title[0]}. ${metadata.object.generic.generated.project.value}. ${metadata.object.item.rightsHolder[0].value}.
<a href="${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
<a href="${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}">
${config.handleHost}/${fn:substringAfter(metadata.object.generic.generated.pid[0].value, 'hdl:')}
</a>
</dd>
</dl>
......
......@@ -57,11 +57,11 @@
<div class="tg dropdown" role="group">
<a class="tg dropdown_toggle -download">${i18n['download-all']}</a>
<ul class="tg dropdown_menu">
<li class="tg dropdown_item"><a class="tg dropdown_link" href="${aggregatorUrl}/zip/query?query=${utils:urlencode(realQueryString)}${filterQueryString}${aggregatorSandboxParam}" data-type="zip">ZIP</a></li>
<li class="tg dropdown_item"><a class="tg dropdown_link" href="${aggregatorUrl}/zip/query?query=${utils:urlencode(realQueryString)}${filterQueryString}${aggregatorSandboxParam}&transform=text&meta=false&only=text/xml&dirnames=" data-type="zip">ZIP / text only</a></li>
<li class="tg dropdown_item"><a class="tg dropdown_link" href="${config.aggregatorUrl}/zip/query?query=${utils:urlencode(realQueryString)}${filterQueryString}${aggregatorSandboxParam}" data-type="zip">ZIP</a></li>
<li class="tg dropdown_item"><a class="tg dropdown_link" href="${config.aggregatorUrl}/zip/query?query=${utils:urlencode(realQueryString)}${filterQueryString}${aggregatorSandboxParam}&transform=text&meta=false&only=text/xml&dirnames=" data-type="zip">ZIP / text only</a></li>
<!-- other exports do not work yet
<li class="tg dropdown_item"><a class="tg dropdown_link" href="${aggregatorUrl}/epub/query?query=${query}${filterQueryString}" data-type="ebook">E-Book</a></li>
<li class="tg dropdown_item"><a class="tg dropdown_link" href="${aggregatorUrl}/teicorpus/query?query=${query}${filterQueryString}" data-type="tei-corpus">TEI-Corpus</a></li>
<li class="tg dropdown_item"><a class="tg dropdown_link" href="${config.aggregatorUrl}/epub/query?query=${query}${filterQueryString}" data-type="ebook">E-Book</a></li>
<li class="tg dropdown_item"><a class="tg dropdown_link" href="${config.aggregatorUrl}/teicorpus/query?query=${query}${filterQueryString}" data-type="tei-corpus">TEI-Corpus</a></li>
-->
</ul>
</div>
......
......@@ -4,7 +4,7 @@
<li class="tgrep gallery-item">
<div>
<div class="tgrep gallery-item_image">
<a href="${utils:browseUrl(result.object.generic.generated.textgridUri.value)}"> <img src="${utils:getImageUrl(textgridHost, result)}"
<a href="${utils:browseUrl(result.object.generic.generated.textgridUri.value)}"> <img src="${utils:getImageUrl(config.textgridHost, result)}"
alt="${result.object.generic.provided.title[0]}" title="${result.object.generic.provided.title[0]}" />
</a>
</div>
......@@ -24,7 +24,7 @@
${i18n['add-to-shelf']}</button>
</c:otherwise>
</c:choose></li>
<li><a href="${textgridHost}/1.0/tgcrud-public/rest/${result.object.generic.generated.textgridUri.value}/data"
<li><a href="${config.textgridHost}/1.0/tgcrud-public/rest/${result.object.generic.generated.textgridUri.value}/data"
class="tgrep gallery-item_button -download">${i18n['download']}</a></li>
</ul>
</div>
......
......@@ -47,7 +47,7 @@
<div class="tgrep result_image">
<a href="${utils:browseUrl(result.object.generic.generated.textgridUri.value)}">
<img src="${utils:getImageUrl(textgridHost, result)}" alt="${result.object.generic.provided.title[0]}" title="${result.object.generic.provided.title[0]}" />
<img src="${utils:getImageUrl(config.textgridHost, result)}" alt="${result.object.generic.provided.title[0]}" title="${result.object.generic.provided.title[0]}" />
</a>
</div>
......@@ -72,7 +72,7 @@
</c:choose>
</li>
<li>
<a href="${textgridHost}/1.0/tgcrud-public/rest/${result.object.generic.generated.textgridUri.value}/data" class="tgrep result_button -download">${i18n['download']}</a>
<a href="${config.textgridHost}/1.0/tgcrud-public/rest/${result.object.generic.generated.textgridUri.value}/data" class="tgrep result_button -download">${i18n['download']}</a>
</li>
</ul>
</div>
......@@ -126,13 +126,13 @@
<dt>${i18n['pid']}</dt>
<dd>
${result.object.generic.generated.pid[0].value}
(<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>)
(<a href="${config.handleHost}/${result.object.generic.generated.pid[0].value}">resolve PID</a> /
<a href="${config.handleHost}/${result.object.generic.generated.pid[0].value}?noredirect">PID metadata</a>)
</dd>
</c:if>
<dt>${i18n['raw-metadata']}</dt>
<dd><a href="${textgridHost}/1.0/tgcrud-public/rest/${result.object.generic.generated.textgridUri.value}/metadata">XML</a></dd> <dt>${i18n['tech-metadata']}</dt>
<dd><a href="${textgridHost}/1.0/tgcrud-public/rest/${result.object.generic.generated.textgridUri.value}/tech">XML</a></dd>
<dd><a href="${config.textgridHost}/1.0/tgcrud-public/rest/${result.object.generic.generated.textgridUri.value}/metadata">XML</a></dd> <dt>${i18n['tech-metadata']}</dt>
<dd><a href="${config.textgridHost}/1.0/tgcrud-public/rest/${result.object.generic.generated.textgridUri.value}/tech">XML</a></dd>
</dl>
</div>
</li>
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