diff --git a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java index c4a02169387..e49aaef6486 100644 --- a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java @@ -180,9 +180,13 @@ public RecordSummaryPojo getRecordSummaryPojo(String orcid) { if(recordSummary.getEmployments() != null && recordSummary.getEmployments().getEmployments() != null) { List affiliations = new ArrayList<>(); for(Employment e : recordSummary.getEmployments().getEmployments()) { - AffiliationSummary as = new AffiliationSummary(); + AffiliationSummary as = new AffiliationSummary(); + as.setStartDate(e.getStartDate() == null ? null : e.getStartDate().toString()); as.setEndDate(e.getEndDate() == null ? null : e.getEndDate().toString()); as.setOrganizationName(e.getOrganizationName()); + as.setRole(e.getRole()); + as.setType(e.getType()); + as.setUrl(e.getUrl()); as.setPutCode(e.getPutCode()); as.setValidated(e.isValidated()); affiliations.add(as); diff --git a/orcid-core/src/main/java/org/orcid/core/model/Employment.java b/orcid-core/src/main/java/org/orcid/core/model/Employment.java index 554211d8bce..a2ab224d1a8 100644 --- a/orcid-core/src/main/java/org/orcid/core/model/Employment.java +++ b/orcid-core/src/main/java/org/orcid/core/model/Employment.java @@ -10,6 +10,7 @@ import javax.xml.bind.annotation.XmlType; import org.orcid.jaxb.model.v3.release.common.FuzzyDate; +import org.orcid.jaxb.model.v3.release.record.AffiliationType; import io.swagger.v3.oas.annotations.media.Schema; @@ -29,7 +30,7 @@ public class Employment implements Serializable { @XmlElement(name = "end-date", namespace = "http://www.orcid.org/ns/common") protected FuzzyDate endDate; @XmlElement(name = "type", namespace = "http://www.orcid.org/ns/summary") - protected String type; + protected final String type = AffiliationType.EMPLOYMENT.value(); @XmlElement(name = "organization-name", namespace = "http://www.orcid.org/ns/summary") protected String organizationName; @XmlElement(name = "role", namespace = "http://www.orcid.org/ns/summary") @@ -79,6 +80,9 @@ public boolean isValidated() { } public void setValidated(boolean validated) { this.validated = validated; + } + public String getType() { + return type; } public static long getSerialversionuid() { return serialVersionUID;