Commit 2c8f5ead authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

Merge branch 'v4.3-dev' into 'v4.x-master'

79: Support non-String static values in transformation language (OPENED)

See merge request !50
parents 32e1b280 a24becf9
Pipeline #27077 passed with stages
in 4 minutes and 38 seconds
......@@ -9,7 +9,7 @@ allprojects {
apply plugin: 'eclipse'
group = 'eu.dariah.de.minfba'
version = '4.3.17-SNAPSHOT'
version = '4.3.18-SNAPSHOT'
repositories {
mavenLocal()
......@@ -19,8 +19,8 @@ allprojects {
}
ext {
coreVersion = "6.5.4-SNAPSHOT"
gtfVersion = "2.3.6-SNAPSHOT"
processingVersion = "4.3.9-SNAPSHOT"
gtfVersion = "2.3.8-SNAPSHOT"
processingVersion = "4.3.11-SNAPSHOT"
colregModelVersion = "4.5.10-SNAPSHOT"
dariahSpVersion = "2.1.7-RELEASE"
......
......@@ -186,6 +186,7 @@ public class CollectionSyncClient extends BaseApiClientImpl<CollectionApiPojo, E
for (Endpoint eCurrent : cCurrent.getEndpoints()) {
if (this.endpointsAreSame(eCurrent, eFetched)) {
eCurrent.setAccessModelId(eFetched.getAccessModelId());
eCurrent.setPatterns(eFetched.getPatterns());
mergeOrUnchanged = true;
this.mergeDatamodelReferences(eCurrent, eFetched);
......
......@@ -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