From f4fa943e0329141c64b263c85f80bd3a6f9af449 Mon Sep 17 00:00:00 2001 From: Camelia Dumitru Date: Thu, 26 Sep 2024 13:55:13 +0100 Subject: [PATCH] Removed all created date, last modified from email domain summary --- .../manager/impl/SummaryManagerImpl.java | 4 --- .../org/orcid/core/model/EmailDomain.java | 27 +++---------------- .../model/RecordSummaryMarshallingTest.java | 4 +-- 3 files changed, 5 insertions(+), 30 deletions(-) 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 3ecd48fb678..3fcd322e53d 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 @@ -524,8 +524,6 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci for (ProfileEmailDomainEntity ped : emailDomains) { ed = new EmailDomain(); ed.setValue(ped.getEmailDomain()); - ed.setCreatedDate(Date.valueOf(ped.getDateCreated())); - ed.setLastModified(Date.valueOf(ped.getLastModified())); edList.add(ed); } } @@ -533,8 +531,6 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci edList.stream().limit(3).forEach(t -> { EmailDomain ed = new EmailDomain(); ed.setValue(t.getValue()); - ed.setCreatedDate(t.getCreatedDate()); - ed.setLastModified(t.getLastModified()); emailDomainsTop3.add(ed); }); 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 779717dd90d..371b7948f04 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 @@ -15,16 +15,12 @@ import io.swagger.v3.oas.annotations.media.Schema; @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(propOrder = { "value", "createdDate","lastModified"}) +@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; - @XmlElement(name = "created-date", namespace = "http://www.orcid.org/ns/common") - protected Date createdDate; - @XmlElement(name = "last-modified-date", namespace = "http://www.orcid.org/ns/common") - protected Date lastModified; public String getValue() { return value; @@ -34,27 +30,10 @@ public void setValue(String value) { this.value = value; } - @XmlTransient - public Date getCreatedDate() { - return createdDate; - } - - public void setCreatedDate(Date createdDate) { - this.createdDate = createdDate; - } - - @XmlTransient - public Date getLastModified() { - return lastModified; - } - - public void setLastModified(Date lastModified) { - this.lastModified = lastModified; - } @Override public int hashCode() { - return Objects.hash(value, createdDate, lastModified); + return Objects.hash(value); } @Override @@ -66,6 +45,6 @@ public boolean equals(Object obj) { if (getClass() != obj.getClass()) return false; EmailDomain other = (EmailDomain) obj; - return Objects.equals(createdDate, other.createdDate) && Objects.equals(lastModified, other.lastModified) && Objects.equals(value, other.value); + return Objects.equals(value, other.value); } } diff --git a/orcid-core/src/test/java/org/orcid/core/model/RecordSummaryMarshallingTest.java b/orcid-core/src/test/java/org/orcid/core/model/RecordSummaryMarshallingTest.java index 72c5a541aae..d55d341835b 100644 --- a/orcid-core/src/test/java/org/orcid/core/model/RecordSummaryMarshallingTest.java +++ b/orcid-core/src/test/java/org/orcid/core/model/RecordSummaryMarshallingTest.java @@ -97,7 +97,7 @@ private RecordSummary getRecordSummary() { EmailDomains emailDomains = new EmailDomains(); emailDomains.setCount(4); emailDomains.setEmailDomains(new ArrayList()); - emailDomains.getEmailDomains().add(getEmailDomain("sometrusted.org", getEmailDomainCreatedDate(), getEmailDomainLastModified())); + emailDomains.getEmailDomains().add(getEmailDomain("sometrusted.org")); record.setEmailDomains(emailDomains); //Set education/qualifications @@ -163,7 +163,7 @@ private EducationQualification getEducationQualification(int putCode, String rol return eq; } - private EmailDomain getEmailDomain(String domainValue, Date created, Date modified) { + private EmailDomain getEmailDomain(String domainValue) { EmailDomain emailDomain = new EmailDomain(); emailDomain.setValue(domainValue); //emailDomain.setCreatedDate(created);