serialising: 1. measures for all the entity types and 2. result level fulltext

This commit is contained in:
Claudio Atzori 2023-03-23 11:23:22 +01:00
parent 518618f1a9
commit 308e10d102
1 changed files with 12 additions and 2 deletions

View File

@ -207,12 +207,22 @@ public class XmlRecordFactory implements Serializable {
.map(p -> XmlSerializationUtils.mapStructuredProperty("pid", p))
.collect(Collectors.toList()));
}
if (entity.getMeasures() != null) {
metadata.addAll(measuresAsXml(entity.getMeasures()));
}
if (ModelSupport.isResult(type)) {
final Result r = (Result) entity;
if (r.getMeasures() != null) {
metadata.addAll(measuresAsXml(r.getMeasures()));
if (r.getFulltext() != null) {
metadata
.addAll(
r
.getFulltext()
.stream()
.filter(Objects::nonNull)
.map(c -> XmlSerializationUtils.asXmlElement("fulltext", c.getValue()))
.collect(Collectors.toList()));
}
if (r.getEoscifguidelines() != null) {