Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed all created date, last modified from email domain summary #7090

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading