-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the implementation for emailDomains
- Loading branch information
1 parent
0b4177c
commit d50e10a
Showing
8 changed files
with
376 additions
and
103 deletions.
There are no files selected for viewing
242 changes: 147 additions & 95 deletions
242
orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package org.orcid.core.model; | ||
|
||
import java.util.Objects; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
import org.orcid.jaxb.model.v3.release.common.FuzzyDate; | ||
import org.orcid.pojo.ajaxForm.Date; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@XmlType(propOrder = { "putCode", "type", "organizationName", "role", "url", "startDate", "endDate", "validated" }) | ||
@XmlRootElement(name = "education-qualification", namespace = "http://www.orcid.org/ns/summary") | ||
@Schema(description = "Education Qualification") | ||
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", namespace = "http://www.orcid.org/ns/common") | ||
protected Date lastModified; | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(String value) { | ||
this.value = value; | ||
} | ||
|
||
public Date getCreatedDate() { | ||
return createdDate; | ||
} | ||
|
||
public void setCreatedDate(Date createdDate) { | ||
this.createdDate = createdDate; | ||
} | ||
|
||
public Date getLastModified() { | ||
return lastModified; | ||
} | ||
|
||
public void setLastModified(Date lastModified) { | ||
this.lastModified = lastModified; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(value, createdDate, lastModified); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
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); | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
orcid-core/src/main/java/org/orcid/core/model/EmailDomains.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package org.orcid.core.model; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlElement; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@XmlType(propOrder = { "count", "emailDomains" }) | ||
@XmlRootElement(name = "email-domains", namespace = "http://www.orcid.org/ns/summary") | ||
@Schema(description = "Email domains list") | ||
public class EmailDomains implements Serializable { | ||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
@XmlElement(name = "count", namespace = "http://www.orcid.org/ns/summary") | ||
private Integer count; | ||
@XmlElement(name = "email-domain", namespace = "http://www.orcid.org/ns/summary") | ||
private List<EmailDomain> emailDomains; | ||
|
||
public Integer getCount() { | ||
return count; | ||
} | ||
|
||
public void setCount(Integer count) { | ||
this.count = count; | ||
} | ||
|
||
public List<EmailDomain> getEmailDomains() { | ||
return emailDomains; | ||
} | ||
|
||
public void setEmailDomains(List<EmailDomain> emailDomains ) { | ||
this.emailDomains = emailDomains ; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(count, emailDomains); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
EmailDomains other = (EmailDomains) obj; | ||
return Objects.equals(count, other.count) && Objects.equals(emailDomains, other.emailDomains); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
orcid-core/src/main/java/org/orcid/pojo/summary/EmailDomainSummary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.orcid.pojo.summary; | ||
|
||
import java.util.Date; | ||
|
||
import org.orcid.persistence.jpa.entities.ProfileEmailDomainEntity; | ||
import org.orcid.pojo.ajaxForm.PojoUtil; | ||
|
||
public class EmailDomainSummary { | ||
private String value; | ||
private Date createdDate; | ||
private Date lastModified; | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(String value) { | ||
this.value = value; | ||
} | ||
|
||
public Date getCreatedDate() { | ||
return createdDate; | ||
} | ||
|
||
public void setCreatedDate(Date createdDate) { | ||
this.createdDate = createdDate; | ||
} | ||
|
||
public Date getLastModified() { | ||
return lastModified; | ||
} | ||
|
||
public void setLastModified(Date lastModified) { | ||
this.lastModified = lastModified; | ||
} | ||
|
||
|
||
public static EmailDomainSummary valueOf(ProfileEmailDomainEntity pem) { | ||
EmailDomainSummary form = new EmailDomainSummary(); | ||
|
||
if (pem != null) { | ||
if(!PojoUtil.isEmpty(pem.getEmailDomain())) { | ||
form.setValue(pem.getEmailDomain()); | ||
} | ||
|
||
if (pem.getDateCreated() != null) { | ||
form.setCreatedDate(pem.getDateCreated()); | ||
} | ||
|
||
if (pem.getLastModified() !=null) { | ||
form.setLastModified(pem.getLastModified()); | ||
} | ||
} | ||
return form; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters