Commit a24becf9 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

445: Link from search results presentation to quick-search * on

respective collection (OPENED)

Task-Url: #445
parent 24079e83
Pipeline #27075 passed with stage
in 46 seconds
......@@ -19,8 +19,8 @@ allprojects {
}
ext {
coreVersion = "6.5.4-SNAPSHOT"
gtfVersion = "2.3.7-SNAPSHOT"
processingVersion = "4.3.10-SNAPSHOT"
gtfVersion = "2.3.8-SNAPSHOT"
processingVersion = "4.3.11-SNAPSHOT"
colregModelVersion = "4.5.10-SNAPSHOT"
dariahSpVersion = "2.1.7-RELEASE"
......
......@@ -137,28 +137,19 @@ public class ItemController extends BaseController {
List<Resource> infos = ResourceHelper.findRecursive(res, "PrimaryInfo");
if (!infos.isEmpty()) {
String queryMessageCode;
String label;
for (Resource info : infos) {
if (info.getChildResources()!=null) {
// Check for available translations
for (Resource c : info.getChildResources()) {
if (c.getKey().equals("Type") && c.getValue()!=null) {
queryMessageCode = "~eu.dariah.de.minfba.search.view.item.presentation_metadata.primary_info_types." + c.getValue().toString().toLowerCase();
label = messageSource.getMessage(queryMessageCode, null, locale);
if (!label.equals(queryMessageCode)) {
c.setValue(label);
}
}
}
}
}
contentElements.put("Info", infos);
contentElements.put("Info", this.translateTypeLabels(infos, locale));
}
List<Resource> frames = ResourceHelper.findRecursive(res, "EmbeddedFrame");
if (!frames.isEmpty()) {
contentElements.put("Frame", frames);
}
List<Resource> secInfos = ResourceHelper.findRecursive(res, "SecondaryInfo");
if (!secInfos.isEmpty()) {
model.addAttribute("secondaryInfo", this.translateTypeLabels(secInfos, locale));
}
List<Resource> keywords = ResourceHelper.findRecursive(res, "Keyword");
if (!keywords.isEmpty()) {
......@@ -197,6 +188,26 @@ public class ItemController extends BaseController {
return "item/view";
}
private List<Resource> translateTypeLabels(List<Resource> infos, Locale locale) {
String queryMessageCode;
String label;
for (Resource info : infos) {
if (info.getChildResources()!=null) {
// Check for available translations
for (Resource c : info.getChildResources()) {
if (c.getKey().equals("Type") && c.getValue()!=null) {
queryMessageCode = "~eu.dariah.de.minfba.search.view.item.presentation_metadata.primary_info_types." + c.getValue().toString().toLowerCase();
label = messageSource.getMessage(queryMessageCode, null, locale);
if (!label.equals(queryMessageCode)) {
c.setValue(label);
}
}
}
}
}
return infos;
}
@PostMapping(value = "/")
public String postItem(@PathVariable String type, @PathVariable String itemId, @RequestParam(required= false, name="query") String jsonQuery, Model model, Locale locale, RedirectAttributes attributes, HttpServletResponse response) throws IOException {
if (jsonQuery!=null) {
......
Subproject commit 19f2b3cfa0b844dff45eb23e4fa0ebb8e4858617
Subproject commit 9b73506483a4159053f603fe949ffeba464e7761
Subproject commit 48b394b5c9577e324192bdf751a123ff486c1ee8
Subproject commit d6e325d9c85c3d5a7a0f62d6c1206e34e126c709
Subproject commit a86cb5d2f3e86747d08a27cf8a83bdb452e80dd2
Subproject commit 35e2b0ec1e6a1e6610243f0556bcad9c10c69577
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