Skip to content

Commit

Permalink
First draft education, qualifications, research resources, email doma…
Browse files Browse the repository at this point in the history
…ins 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
  • Loading branch information
Camelia-Orcid authored Sep 17, 2024
1 parent 2f3f59c commit 2bdc449
Show file tree
Hide file tree
Showing 13 changed files with 792 additions and 72 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
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 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 EducationQualification {
@XmlElement(name = "put-code", namespace = "http://www.orcid.org/ns/summary")
protected Long putCode;
@XmlElement(name = "start-date", namespace = "http://www.orcid.org/ns/common")
protected FuzzyDate startDate;
@XmlElement(name = "end-date", namespace = "http://www.orcid.org/ns/common")
protected FuzzyDate endDate;
@XmlElement(name = "type", namespace = "http://www.orcid.org/ns/summary")
protected String type;
@XmlElement(name = "organization-name", namespace = "http://www.orcid.org/ns/summary")
protected String organizationName;
@XmlElement(name = "role", namespace = "http://www.orcid.org/ns/summary")
protected String role;
@XmlElement(name = "url", namespace = "http://www.orcid.org/ns/summary")
protected String url;
@XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/summary")
protected boolean validated;

public Long getPutCode() {
return putCode;
}

public void setPutCode(Long putCode) {
this.putCode = putCode;
}

public FuzzyDate getStartDate() {
return startDate;
}

public void setStartDate(FuzzyDate startDate) {
this.startDate = startDate;
}

public FuzzyDate getEndDate() {
return endDate;
}

public void setEndDate(FuzzyDate endDate) {
this.endDate = endDate;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public String getOrganizationName() {
return organizationName;
}

public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}

public String getRole() {
return role;
}

public void setRole(String role) {
this.role = role;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public boolean isValidated() {
return validated;
}

public void setValidated(boolean validated) {
this.validated = validated;
}

@Override
public int hashCode() {
return Objects.hash(endDate, organizationName, putCode, role, startDate, type, url, validated);
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EducationQualification other = (EducationQualification) obj;
return Objects.equals(endDate, other.endDate) && Objects.equals(organizationName, other.organizationName) && Objects.equals(putCode, other.putCode)
&& Objects.equals(role, other.role) && Objects.equals(startDate, other.startDate) && Objects.equals(type, other.type) && Objects.equals(url, other.url)
&& validated == other.validated;
}
}
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", "educationQualifications" })
@XmlRootElement(name = "education-qualifications", namespace = "http://www.orcid.org/ns/summary")
@Schema(description = "Education qualifications list")
public class EducationQualifications implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@XmlElement(name = "count", namespace = "http://www.orcid.org/ns/summary")
private Integer count;
@XmlElement(name = "education-qualification", namespace = "http://www.orcid.org/ns/summary")
private List<EducationQualification> educationQualifications;

public Integer getCount() {
return count;
}

public void setCount(Integer count) {
this.count = count;
}

public List<EducationQualification> getEducationQualifications() {
return educationQualifications;
}

public void setEducationQualifications(List<EducationQualification> educationQualifications ) {
this.educationQualifications = educationQualifications ;
}

@Override
public int hashCode() {
return Objects.hash(count, educationQualifications);
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EducationQualifications other = (EducationQualifications) obj;
return Objects.equals(count, other.count) && Objects.equals(educationQualifications, other.educationQualifications);
}

}
68 changes: 68 additions & 0 deletions orcid-core/src/main/java/org/orcid/core/model/EmailDomain.java
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 = { "value","createdDate", "lastModified"})
@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-date", 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 orcid-core/src/main/java/org/orcid/core/model/EmailDomains.java
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);
}

}
41 changes: 37 additions & 4 deletions orcid-core/src/main/java/org/orcid/core/model/RecordSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

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

@XmlElement(name = "education-qualifications", namespace = "http://www.orcid.org/ns/summary")
private EducationQualifications educationQualifications;
@XmlElement(name = "research-resources", namespace = "http://www.orcid.org/ns/summary")
private ResearchResources researchResources;
@XmlElement(name = "email-domains", namespace = "http://www.orcid.org/ns/summary")
private EmailDomains emailDomains;

public OrcidIdentifier getOrcidIdentifier() {
return orcidIdentifier;
}
Expand Down Expand Up @@ -132,10 +139,34 @@ public void setPeerReviews(PeerReviews peerReviews) {
this.peerReviews = peerReviews;
}

public EducationQualifications getEducationQualifications() {
return educationQualifications;
}

public void setEducationQualifications(EducationQualifications educationQualifications) {
this.educationQualifications = educationQualifications;
}

public ResearchResources getResearchResources() {
return researchResources;
}

public void setResearchResources(ResearchResources researchResources) {
this.researchResources = researchResources;
}

public EmailDomains getEmailDomains() {
return emailDomains;
}

public void setEmailDomains(EmailDomains emailDomains) {
this.emailDomains = emailDomains;
}

@Override
public int hashCode() {
return Objects.hash(createdDate, creditName, employments, externalIdentifiers, fundings, lastModifiedDate, orcidIdentifier, orcidUrlManager, peerReviews,
professionalActivities, works);
professionalActivities, works, emailDomains, educationQualifications, researchResources );
}

@Override
Expand All @@ -151,6 +182,8 @@ public boolean equals(Object obj) {
&& Objects.equals(externalIdentifiers, other.externalIdentifiers) && Objects.equals(fundings, other.fundings)
&& Objects.equals(lastModifiedDate, other.lastModifiedDate) && Objects.equals(orcidIdentifier, other.orcidIdentifier)
&& Objects.equals(orcidUrlManager, other.orcidUrlManager) && Objects.equals(peerReviews, other.peerReviews)
&& Objects.equals(professionalActivities, other.professionalActivities) && Objects.equals(works, other.works);
}
&& Objects.equals(professionalActivities, other.professionalActivities) && Objects.equals(works, other.works)
&& Objects.equals(educationQualifications, other.educationQualifications) && Objects.equals(researchResources, other.researchResources)
&& Objects.equals(emailDomains, other.emailDomains) ;
}
}
Loading

0 comments on commit 2bdc449

Please sign in to comment.