Skip to content

Commit 2bdc449

Browse files
First draft education, qualifications, research resources, email domains added to record summary (#7084)
* First draft education, qualification and research resources added to record summary * Added the implementation for emailDomains * Email domain fixes + fix for failing tests * Fixed the failing test by specifying the right xml order * Added the new summaries to the record marshalling test * Added the updated orcid-model version and fixed the last modified element
1 parent 2f3f59c commit 2bdc449

File tree

13 files changed

+792
-72
lines changed

13 files changed

+792
-72
lines changed

orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java

Lines changed: 220 additions & 65 deletions
Large diffs are not rendered by default.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
package org.orcid.core.model;
2+
3+
import java.util.Objects;
4+
5+
import javax.xml.bind.annotation.XmlAccessType;
6+
import javax.xml.bind.annotation.XmlAccessorType;
7+
import javax.xml.bind.annotation.XmlElement;
8+
import javax.xml.bind.annotation.XmlRootElement;
9+
import javax.xml.bind.annotation.XmlType;
10+
11+
import org.orcid.jaxb.model.v3.release.common.FuzzyDate;
12+
13+
import io.swagger.v3.oas.annotations.media.Schema;
14+
15+
@XmlAccessorType(XmlAccessType.FIELD)
16+
@XmlType(propOrder = { "putCode", "type", "organizationName", "role", "url", "startDate", "endDate", "validated" })
17+
@XmlRootElement(name = "education-qualification", namespace = "http://www.orcid.org/ns/summary")
18+
@Schema(description = "Education Qualification")
19+
public class EducationQualification {
20+
@XmlElement(name = "put-code", namespace = "http://www.orcid.org/ns/summary")
21+
protected Long putCode;
22+
@XmlElement(name = "start-date", namespace = "http://www.orcid.org/ns/common")
23+
protected FuzzyDate startDate;
24+
@XmlElement(name = "end-date", namespace = "http://www.orcid.org/ns/common")
25+
protected FuzzyDate endDate;
26+
@XmlElement(name = "type", namespace = "http://www.orcid.org/ns/summary")
27+
protected String type;
28+
@XmlElement(name = "organization-name", namespace = "http://www.orcid.org/ns/summary")
29+
protected String organizationName;
30+
@XmlElement(name = "role", namespace = "http://www.orcid.org/ns/summary")
31+
protected String role;
32+
@XmlElement(name = "url", namespace = "http://www.orcid.org/ns/summary")
33+
protected String url;
34+
@XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/summary")
35+
protected boolean validated;
36+
37+
public Long getPutCode() {
38+
return putCode;
39+
}
40+
41+
public void setPutCode(Long putCode) {
42+
this.putCode = putCode;
43+
}
44+
45+
public FuzzyDate getStartDate() {
46+
return startDate;
47+
}
48+
49+
public void setStartDate(FuzzyDate startDate) {
50+
this.startDate = startDate;
51+
}
52+
53+
public FuzzyDate getEndDate() {
54+
return endDate;
55+
}
56+
57+
public void setEndDate(FuzzyDate endDate) {
58+
this.endDate = endDate;
59+
}
60+
61+
public String getType() {
62+
return type;
63+
}
64+
65+
public void setType(String type) {
66+
this.type = type;
67+
}
68+
69+
public String getOrganizationName() {
70+
return organizationName;
71+
}
72+
73+
public void setOrganizationName(String organizationName) {
74+
this.organizationName = organizationName;
75+
}
76+
77+
public String getRole() {
78+
return role;
79+
}
80+
81+
public void setRole(String role) {
82+
this.role = role;
83+
}
84+
85+
public String getUrl() {
86+
return url;
87+
}
88+
89+
public void setUrl(String url) {
90+
this.url = url;
91+
}
92+
93+
public boolean isValidated() {
94+
return validated;
95+
}
96+
97+
public void setValidated(boolean validated) {
98+
this.validated = validated;
99+
}
100+
101+
@Override
102+
public int hashCode() {
103+
return Objects.hash(endDate, organizationName, putCode, role, startDate, type, url, validated);
104+
}
105+
106+
@Override
107+
public boolean equals(Object obj) {
108+
if (this == obj)
109+
return true;
110+
if (obj == null)
111+
return false;
112+
if (getClass() != obj.getClass())
113+
return false;
114+
EducationQualification other = (EducationQualification) obj;
115+
return Objects.equals(endDate, other.endDate) && Objects.equals(organizationName, other.organizationName) && Objects.equals(putCode, other.putCode)
116+
&& Objects.equals(role, other.role) && Objects.equals(startDate, other.startDate) && Objects.equals(type, other.type) && Objects.equals(url, other.url)
117+
&& validated == other.validated;
118+
}
119+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package org.orcid.core.model;
2+
3+
import java.io.Serializable;
4+
import java.util.List;
5+
import java.util.Objects;
6+
7+
import javax.xml.bind.annotation.XmlAccessType;
8+
import javax.xml.bind.annotation.XmlAccessorType;
9+
import javax.xml.bind.annotation.XmlElement;
10+
import javax.xml.bind.annotation.XmlRootElement;
11+
import javax.xml.bind.annotation.XmlType;
12+
13+
import io.swagger.v3.oas.annotations.media.Schema;
14+
15+
@XmlAccessorType(XmlAccessType.FIELD)
16+
@XmlType(propOrder = { "count", "educationQualifications" })
17+
@XmlRootElement(name = "education-qualifications", namespace = "http://www.orcid.org/ns/summary")
18+
@Schema(description = "Education qualifications list")
19+
public class EducationQualifications implements Serializable {
20+
/**
21+
*
22+
*/
23+
private static final long serialVersionUID = 1L;
24+
@XmlElement(name = "count", namespace = "http://www.orcid.org/ns/summary")
25+
private Integer count;
26+
@XmlElement(name = "education-qualification", namespace = "http://www.orcid.org/ns/summary")
27+
private List<EducationQualification> educationQualifications;
28+
29+
public Integer getCount() {
30+
return count;
31+
}
32+
33+
public void setCount(Integer count) {
34+
this.count = count;
35+
}
36+
37+
public List<EducationQualification> getEducationQualifications() {
38+
return educationQualifications;
39+
}
40+
41+
public void setEducationQualifications(List<EducationQualification> educationQualifications ) {
42+
this.educationQualifications = educationQualifications ;
43+
}
44+
45+
@Override
46+
public int hashCode() {
47+
return Objects.hash(count, educationQualifications);
48+
}
49+
50+
@Override
51+
public boolean equals(Object obj) {
52+
if (this == obj)
53+
return true;
54+
if (obj == null)
55+
return false;
56+
if (getClass() != obj.getClass())
57+
return false;
58+
EducationQualifications other = (EducationQualifications) obj;
59+
return Objects.equals(count, other.count) && Objects.equals(educationQualifications, other.educationQualifications);
60+
}
61+
62+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package org.orcid.core.model;
2+
3+
import java.util.Objects;
4+
5+
import javax.xml.bind.annotation.XmlAccessType;
6+
import javax.xml.bind.annotation.XmlAccessorType;
7+
import javax.xml.bind.annotation.XmlElement;
8+
import javax.xml.bind.annotation.XmlRootElement;
9+
import javax.xml.bind.annotation.XmlType;
10+
11+
import org.orcid.jaxb.model.v3.release.common.FuzzyDate;
12+
import org.orcid.pojo.ajaxForm.Date;
13+
14+
import io.swagger.v3.oas.annotations.media.Schema;
15+
16+
@XmlAccessorType(XmlAccessType.FIELD)
17+
@XmlType(propOrder = { "value","createdDate", "lastModified"})
18+
@XmlRootElement(name = "education-qualification", namespace = "http://www.orcid.org/ns/summary")
19+
@Schema(description = "Education Qualification")
20+
public class EmailDomain {
21+
@XmlElement(name = "value", namespace = "http://www.orcid.org/ns/summary")
22+
protected String value;
23+
@XmlElement(name = "created-date", namespace = "http://www.orcid.org/ns/common")
24+
protected Date createdDate;
25+
@XmlElement(name = "last-modified-date", namespace = "http://www.orcid.org/ns/common")
26+
protected Date lastModified;
27+
28+
public String getValue() {
29+
return value;
30+
}
31+
32+
public void setValue(String value) {
33+
this.value = value;
34+
}
35+
36+
public Date getCreatedDate() {
37+
return createdDate;
38+
}
39+
40+
public void setCreatedDate(Date createdDate) {
41+
this.createdDate = createdDate;
42+
}
43+
44+
public Date getLastModified() {
45+
return lastModified;
46+
}
47+
48+
public void setLastModified(Date lastModified) {
49+
this.lastModified = lastModified;
50+
}
51+
52+
@Override
53+
public int hashCode() {
54+
return Objects.hash(value, createdDate, lastModified);
55+
}
56+
57+
@Override
58+
public boolean equals(Object obj) {
59+
if (this == obj)
60+
return true;
61+
if (obj == null)
62+
return false;
63+
if (getClass() != obj.getClass())
64+
return false;
65+
EmailDomain other = (EmailDomain) obj;
66+
return Objects.equals(createdDate, other.createdDate) && Objects.equals(lastModified, other.lastModified) && Objects.equals(value, other.value);
67+
}
68+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package org.orcid.core.model;
2+
3+
import java.io.Serializable;
4+
import java.util.List;
5+
import java.util.Objects;
6+
7+
import javax.xml.bind.annotation.XmlAccessType;
8+
import javax.xml.bind.annotation.XmlAccessorType;
9+
import javax.xml.bind.annotation.XmlElement;
10+
import javax.xml.bind.annotation.XmlRootElement;
11+
import javax.xml.bind.annotation.XmlType;
12+
13+
import io.swagger.v3.oas.annotations.media.Schema;
14+
15+
@XmlAccessorType(XmlAccessType.FIELD)
16+
@XmlType(propOrder = { "count", "emailDomains" })
17+
@XmlRootElement(name = "email-domains", namespace = "http://www.orcid.org/ns/summary")
18+
@Schema(description = "Email domains list")
19+
public class EmailDomains implements Serializable {
20+
/**
21+
*
22+
*/
23+
private static final long serialVersionUID = 1L;
24+
@XmlElement(name = "count", namespace = "http://www.orcid.org/ns/summary")
25+
private Integer count;
26+
@XmlElement(name = "email-domain", namespace = "http://www.orcid.org/ns/summary")
27+
private List<EmailDomain> emailDomains;
28+
29+
public Integer getCount() {
30+
return count;
31+
}
32+
33+
public void setCount(Integer count) {
34+
this.count = count;
35+
}
36+
37+
public List<EmailDomain> getEmailDomains() {
38+
return emailDomains;
39+
}
40+
41+
public void setEmailDomains(List<EmailDomain> emailDomains ) {
42+
this.emailDomains = emailDomains ;
43+
}
44+
45+
@Override
46+
public int hashCode() {
47+
return Objects.hash(count, emailDomains);
48+
}
49+
50+
@Override
51+
public boolean equals(Object obj) {
52+
if (this == obj)
53+
return true;
54+
if (obj == null)
55+
return false;
56+
if (getClass() != obj.getClass())
57+
return false;
58+
EmailDomains other = (EmailDomains) obj;
59+
return Objects.equals(count, other.count) && Objects.equals(emailDomains, other.emailDomains);
60+
}
61+
62+
}

orcid-core/src/main/java/org/orcid/core/model/RecordSummary.java

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
@XmlAccessorType(XmlAccessType.FIELD)
2222
@XmlType(propOrder = { "createdDate", "lastModifiedDate", "creditName", "orcidIdentifier", "externalIdentifiers", "employments", "professionalActivities", "fundings",
23-
"works", "peerReviews" })
23+
"works", "peerReviews", "emailDomains", "educationQualifications", "researchResources" })
2424
@XmlRootElement(name = "record-summary", namespace = "http://www.orcid.org/ns/summary")
2525
@Schema(description = "Record summary")
2626
public class RecordSummary implements Serializable {
@@ -52,6 +52,13 @@ public class RecordSummary implements Serializable {
5252
@XmlElement(name = "peer-reviews", namespace = "http://www.orcid.org/ns/summary")
5353
private PeerReviews peerReviews;
5454

55+
@XmlElement(name = "education-qualifications", namespace = "http://www.orcid.org/ns/summary")
56+
private EducationQualifications educationQualifications;
57+
@XmlElement(name = "research-resources", namespace = "http://www.orcid.org/ns/summary")
58+
private ResearchResources researchResources;
59+
@XmlElement(name = "email-domains", namespace = "http://www.orcid.org/ns/summary")
60+
private EmailDomains emailDomains;
61+
5562
public OrcidIdentifier getOrcidIdentifier() {
5663
return orcidIdentifier;
5764
}
@@ -132,10 +139,34 @@ public void setPeerReviews(PeerReviews peerReviews) {
132139
this.peerReviews = peerReviews;
133140
}
134141

142+
public EducationQualifications getEducationQualifications() {
143+
return educationQualifications;
144+
}
145+
146+
public void setEducationQualifications(EducationQualifications educationQualifications) {
147+
this.educationQualifications = educationQualifications;
148+
}
149+
150+
public ResearchResources getResearchResources() {
151+
return researchResources;
152+
}
153+
154+
public void setResearchResources(ResearchResources researchResources) {
155+
this.researchResources = researchResources;
156+
}
157+
158+
public EmailDomains getEmailDomains() {
159+
return emailDomains;
160+
}
161+
162+
public void setEmailDomains(EmailDomains emailDomains) {
163+
this.emailDomains = emailDomains;
164+
}
165+
135166
@Override
136167
public int hashCode() {
137168
return Objects.hash(createdDate, creditName, employments, externalIdentifiers, fundings, lastModifiedDate, orcidIdentifier, orcidUrlManager, peerReviews,
138-
professionalActivities, works);
169+
professionalActivities, works, emailDomains, educationQualifications, researchResources );
139170
}
140171

141172
@Override
@@ -151,6 +182,8 @@ public boolean equals(Object obj) {
151182
&& Objects.equals(externalIdentifiers, other.externalIdentifiers) && Objects.equals(fundings, other.fundings)
152183
&& Objects.equals(lastModifiedDate, other.lastModifiedDate) && Objects.equals(orcidIdentifier, other.orcidIdentifier)
153184
&& Objects.equals(orcidUrlManager, other.orcidUrlManager) && Objects.equals(peerReviews, other.peerReviews)
154-
&& Objects.equals(professionalActivities, other.professionalActivities) && Objects.equals(works, other.works);
155-
}
185+
&& Objects.equals(professionalActivities, other.professionalActivities) && Objects.equals(works, other.works)
186+
&& Objects.equals(educationQualifications, other.educationQualifications) && Objects.equals(researchResources, other.researchResources)
187+
&& Objects.equals(emailDomains, other.emailDomains) ;
188+
}
156189
}

0 commit comments

Comments
 (0)