Skip to content

Commit

Permalink
Removed all created date, last modified from email domain summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Camelia-Orcid committed Sep 26, 2024
1 parent d749f3a commit f4fa943
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,17 +524,13 @@ 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);
}
}
List<EmailDomain> emailDomainsTop3 = new ArrayList<EmailDomain>();
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);
});

Expand Down
27 changes: 3 additions & 24 deletions orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private RecordSummary getRecordSummary() {
EmailDomains emailDomains = new EmailDomains();
emailDomains.setCount(4);
emailDomains.setEmailDomains(new ArrayList<EmailDomain>());
emailDomains.getEmailDomains().add(getEmailDomain("sometrusted.org", getEmailDomainCreatedDate(), getEmailDomainLastModified()));
emailDomains.getEmailDomains().add(getEmailDomain("sometrusted.org"));
record.setEmailDomains(emailDomains);

//Set education/qualifications
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f4fa943

Please sign in to comment.