1
0
Fork 0

expanded paper abstract in the result/children XML element (ticket #9497)

This commit is contained in:
Claudio Atzori 2024-03-13 16:25:31 +01:00
parent eb5887cb9a
commit 7863c92466
3 changed files with 18 additions and 0 deletions

View File

@ -161,6 +161,12 @@ public class CreateRelatedEntitiesJob_phase1 {
title.setValue(StringUtils.left(title.getValue(), ModelHardLimits.MAX_TITLE_LENGTH)); title.setValue(StringUtils.left(title.getValue(), ModelHardLimits.MAX_TITLE_LENGTH));
re.setTitle(title); re.setTitle(title);
} }
if (result.getDescription() != null && !result.getDescription().isEmpty()) {
final Field<String> description = result.getDescription().stream().findFirst().get();
if (StringUtils.isNotBlank(description.getValue())) {
re.setDescription(StringUtils.left(description.getValue(), ModelHardLimits.MAX_RELATED_ABSTRACT_LENGTH));
}
}
re.setDateofacceptance(getValue(result.getDateofacceptance())); re.setDateofacceptance(getValue(result.getDateofacceptance()));
re.setPublisher(getValue(result.getPublisher())); re.setPublisher(getValue(result.getPublisher()));

View File

@ -23,6 +23,7 @@ public class RelatedEntity implements Serializable {
private String websiteurl; // datasource, organizations, projects private String websiteurl; // datasource, organizations, projects
// results // results
private String description;
private String dateofacceptance; private String dateofacceptance;
private String publisher; private String publisher;
private List<StructuredProperty> pid; private List<StructuredProperty> pid;
@ -77,6 +78,14 @@ public class RelatedEntity implements Serializable {
return websiteurl; return websiteurl;
} }
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public void setWebsiteurl(String websiteurl) { public void setWebsiteurl(String websiteurl) {
this.websiteurl = websiteurl; this.websiteurl = websiteurl;
} }

View File

@ -1071,6 +1071,9 @@ public class XmlRecordFactory implements Serializable {
if (re.getTitle() != null && isNotBlank(re.getTitle().getValue())) { if (re.getTitle() != null && isNotBlank(re.getTitle().getValue())) {
metadata.add(XmlSerializationUtils.mapStructuredProperty("title", re.getTitle())); metadata.add(XmlSerializationUtils.mapStructuredProperty("title", re.getTitle()));
} }
if (StringUtils.isNotBlank(re.getDescription())) {
metadata.add(XmlSerializationUtils.asXmlElement("description", re.getDescription()));
}
if (isNotBlank(re.getDateofacceptance())) { if (isNotBlank(re.getDateofacceptance())) {
metadata metadata
.add(XmlSerializationUtils.asXmlElement("dateofacceptance", re.getDateofacceptance())); .add(XmlSerializationUtils.asXmlElement("dateofacceptance", re.getDateofacceptance()));