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 766f3f4f65a..3ecd48fb678 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 @@ -73,10 +73,11 @@ import org.orcid.pojo.summary.ExternalIdentifiersSummary; import org.orcid.pojo.summary.RecordSummaryPojo; import org.orcid.utils.DateUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; public class SummaryManagerImpl implements SummaryManager { - @Resource(name = "recordNameManagerReadOnlyV3") private RecordNameManagerReadOnly recordNameManagerReadOnly; @@ -285,8 +286,7 @@ public RecordSummaryPojo getRecordSummaryPojo(String orcid) { for (EmailDomain ed : recordSummary.getEmailDomains().getEmailDomains()) { EmailDomainSummary eds = new EmailDomainSummary(); eds.setValue(ed.getValue()); - eds.setCreatedDate(ed.getCreatedDate().toFuzzyDate().toString()); - eds.setLastModified(ed.getLastModified().toFuzzyDate().toString()); + emailDomains.add(eds); } } pojo.setEmailDomains(emailDomains); @@ -520,7 +520,6 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci emailDomains = profileEmailDomainManagerReadOnly.getPublicEmailDomains(orcid); List edList = new ArrayList(); if (emailDomains != null && !emailDomains.isEmpty()) { - EmailDomain ed = null; for (ProfileEmailDomainEntity ped : emailDomains) { ed = new EmailDomain(); @@ -530,7 +529,6 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci edList.add(ed); } } - List emailDomainsTop3 = new ArrayList(); edList.stream().limit(3).forEach(t -> { EmailDomain ed = new EmailDomain(); @@ -544,7 +542,9 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci eds.setCount(edList.size()); if (!emailDomainsTop3.isEmpty()) { eds.setEmailDomains(emailDomainsTop3); + } + recordSummary.setEmailDomains(eds); } } diff --git a/orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java b/orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java index a31928c6841..91de4928b3c 100644 --- a/orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java +++ b/orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java @@ -6,6 +6,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.orcid.jaxb.model.v3.release.common.FuzzyDate; @@ -14,9 +15,9 @@ import io.swagger.v3.oas.annotations.media.Schema; @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(propOrder = { "value","createdDate", "lastModified"}) -@XmlRootElement(name = "education-qualification", namespace = "http://www.orcid.org/ns/summary") -@Schema(description = "Education Qualification") +@XmlType(propOrder = { "value"}) +@XmlRootElement(name = "email-domain", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "Email Domain") public class EmailDomain { @XmlElement(name = "value", namespace = "http://www.orcid.org/ns/summary") protected String value; @@ -32,7 +33,8 @@ public String getValue() { public void setValue(String value) { this.value = value; } - + + @XmlTransient public Date getCreatedDate() { return createdDate; } @@ -41,6 +43,7 @@ public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } + @XmlTransient public Date getLastModified() { return lastModified; } diff --git a/orcid-core/src/main/java/org/orcid/pojo/summary/EmailDomainSummary.java b/orcid-core/src/main/java/org/orcid/pojo/summary/EmailDomainSummary.java index 4513d3db408..a8e6c1ba0a8 100644 --- a/orcid-core/src/main/java/org/orcid/pojo/summary/EmailDomainSummary.java +++ b/orcid-core/src/main/java/org/orcid/pojo/summary/EmailDomainSummary.java @@ -5,8 +5,6 @@ public class EmailDomainSummary { private String value; - private String createdDate; - private String lastModified; public String getValue() { return value; @@ -16,22 +14,6 @@ public void setValue(String value) { this.value = value; } - public String getCreatedDate() { - return createdDate; - } - - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - - public String getLastModified() { - return lastModified; - } - - public void setLastModified(String lastModified) { - this.lastModified = lastModified; - } - public static EmailDomainSummary valueOf(ProfileEmailDomainEntity pem) { EmailDomainSummary form = new EmailDomainSummary(); @@ -40,14 +22,6 @@ public static EmailDomainSummary valueOf(ProfileEmailDomainEntity pem) { if(!PojoUtil.isEmpty(pem.getEmailDomain())) { form.setValue(pem.getEmailDomain()); } - - if (pem.getDateCreated() != null) { - form.setCreatedDate(org.orcid.pojo.ajaxForm.Date.valueOf(pem.getDateCreated()).toFuzzyDate().toString()); - } - - if (pem.getLastModified() !=null) { - form.setLastModified(org.orcid.pojo.ajaxForm.Date.valueOf(pem.getLastModified()).toFuzzyDate().toString()); - } } return form; }