From 06854bce6e1f9f7d745a4591308c191ec031459c Mon Sep 17 00:00:00 2001 From: amontenegro Date: Wed, 24 Apr 2024 11:48:45 -0600 Subject: [PATCH] Working on API object --- .../orcid/api/member/model/Employment.java | 79 ++++++++++ .../orcid/api/member/model/Employments.java | 56 +++++++ .../api/member/model/ExternalIdentifier.java | 87 +++++++++++ .../api/member/model/ExternalIdentifiers.java | 46 ++++++ .../org/orcid/api/member/model/Fundings.java | 11 ++ .../orcid/api/member/model/ItemsCount.java | 53 +++++++ .../orcid/api/member/model/PeerReviews.java | 66 +++++++++ .../member/model/ProfessionalActivities.java | 57 ++++++++ .../member/model/ProfessionalActivity.java | 82 +++++++++++ .../orcid/api/member/model/RecordSummary.java | 138 ++++++++++++++++++ .../org/orcid/api/member/model/Works.java | 11 ++ .../pojo/summary/AffiliationSummary.java | 16 ++ 12 files changed, 702 insertions(+) create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/Employment.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/Employments.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/ExternalIdentifier.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/ExternalIdentifiers.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/Fundings.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/ItemsCount.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/PeerReviews.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/ProfessionalActivities.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/ProfessionalActivity.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/RecordSummary.java create mode 100644 orcid-api-web/src/main/java/org/orcid/api/member/model/Works.java diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/Employment.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/Employment.java new file mode 100644 index 00000000000..654aeac12e8 --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/Employment.java @@ -0,0 +1,79 @@ +package org.orcid.api.member.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", "endDate", "organizationName", "validated" }) +@XmlRootElement(name = "employment", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "Employment") +public class Employment { + @XmlElement(name = "put-code", namespace = "http://www.orcid.org/ns/summary") + private Long putCode; + @XmlElement(name = "end-date", namespace = "http://www.orcid.org/ns/common") + private FuzzyDate endDate; + @XmlElement(name = "organization-name", namespace = "http://www.orcid.org/ns/summary") + private String organizationName; + @XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/summary") + private boolean validated; + + public Long getPutCode() { + return putCode; + } + + public void setPutCode(Long putCode) { + this.putCode = putCode; + } + + public FuzzyDate getEndDate() { + return endDate; + } + + public void setEndDate(FuzzyDate endDate) { + this.endDate = endDate; + } + + public String getOrganizationName() { + return organizationName; + } + + public void setOrganizationName(String organizationName) { + this.organizationName = organizationName; + } + + public boolean isValidated() { + return validated; + } + + public void setValidated(boolean validated) { + this.validated = validated; + } + + @Override + public int hashCode() { + return Objects.hash(endDate, organizationName, putCode, validated); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Employment other = (Employment) obj; + return Objects.equals(endDate, other.endDate) && Objects.equals(organizationName, other.organizationName) && Objects.equals(putCode, other.putCode) + && validated == other.validated; + } + +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/Employments.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/Employments.java new file mode 100644 index 00000000000..f8a3b22d042 --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/Employments.java @@ -0,0 +1,56 @@ +package org.orcid.api.member.model; + +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", "employments" }) +@XmlRootElement(name = "employments", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "Employments list") +public class Employments { + @XmlElement(name = "count", namespace = "http://www.orcid.org/ns/activities") + private Integer count; + @XmlElement(name = "employment", namespace = "http://www.orcid.org/ns/activities") + private List employments; + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public List getEmployments() { + return employments; + } + + public void setEmployments(List employments) { + this.employments = employments; + } + + @Override + public int hashCode() { + return Objects.hash(count, employments); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Employments other = (Employments) obj; + return Objects.equals(count, other.count) && Objects.equals(employments, other.employments); + } +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/ExternalIdentifier.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/ExternalIdentifier.java new file mode 100644 index 00000000000..2da14ac74f8 --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/ExternalIdentifier.java @@ -0,0 +1,87 @@ +package org.orcid.api.member.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 io.swagger.v3.oas.annotations.media.Schema; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(propOrder = { "putCode", "externalIdType", "externalIdValue", "externalIdUrl", "validated" }) +@XmlRootElement(name = "external-identifier", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "External identifier") +public class ExternalIdentifier { + @XmlElement(name = "put-code", namespace = "http://www.orcid.org/ns/activities") + private Long putCode; + @XmlElement(name = "external-id-type", namespace = "http://www.orcid.org/ns/activities") + private String externalIdType; + @XmlElement(name = "external-id-value", namespace = "http://www.orcid.org/ns/activities") + private String externalIdValue; + @XmlElement(name = "external-id-url", namespace = "http://www.orcid.org/ns/activities") + private String externalIdUrl; + @XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/activities") + private boolean validated; + + public Long getPutCode() { + return putCode; + } + + public void setPutCode(Long putCode) { + this.putCode = putCode; + } + + public String getExternalIdType() { + return externalIdType; + } + + public void setExternalIdType(String externalIdType) { + this.externalIdType = externalIdType; + } + + public String getExternalIdValue() { + return externalIdValue; + } + + public void setExternalIdValue(String externalIdValue) { + this.externalIdValue = externalIdValue; + } + + public String getExternalIdUrl() { + return externalIdUrl; + } + + public void setExternalIdUrl(String externalIdUrl) { + this.externalIdUrl = externalIdUrl; + } + + public boolean isValidated() { + return validated; + } + + public void setValidated(boolean validated) { + this.validated = validated; + } + + @Override + public int hashCode() { + return Objects.hash(externalIdType, externalIdUrl, externalIdValue, putCode, validated); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ExternalIdentifier other = (ExternalIdentifier) obj; + return Objects.equals(externalIdType, other.externalIdType) && Objects.equals(externalIdUrl, other.externalIdUrl) + && Objects.equals(externalIdValue, other.externalIdValue) && Objects.equals(putCode, other.putCode) && validated == other.validated; + } + +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/ExternalIdentifiers.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/ExternalIdentifiers.java new file mode 100644 index 00000000000..61073ed15de --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/ExternalIdentifiers.java @@ -0,0 +1,46 @@ +package org.orcid.api.member.model; + +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 = { "externalIdentifiers" }) +@XmlRootElement(name = "external-identifiers", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "External identifiers list") +public class ExternalIdentifiers { + @XmlElement(name = "external-identifier", namespace = "http://www.orcid.org/ns/activities") + List externalIdentifiers; + + public List getExternalIdentifiers() { + return externalIdentifiers; + } + + public void setExternalIdentifiers(List externalIdentifiers) { + this.externalIdentifiers = externalIdentifiers; + } + + @Override + public int hashCode() { + return Objects.hash(externalIdentifiers); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ExternalIdentifiers other = (ExternalIdentifiers) obj; + return Objects.equals(externalIdentifiers, other.externalIdentifiers); + } +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/Fundings.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/Fundings.java new file mode 100644 index 00000000000..676ad93a461 --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/Fundings.java @@ -0,0 +1,11 @@ +package org.orcid.api.member.model; + +import javax.xml.bind.annotation.XmlRootElement; + +import io.swagger.v3.oas.annotations.media.Schema; + +@XmlRootElement(name = "fundings", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "Fundings") +public class Fundings extends ItemsCount { + +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/ItemsCount.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/ItemsCount.java new file mode 100644 index 00000000000..7596b3d574e --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/ItemsCount.java @@ -0,0 +1,53 @@ +package org.orcid.api.member.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.XmlType; + +import io.swagger.v3.oas.annotations.media.Schema; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(propOrder = { "selfAssertedCount", "validatedCount" }) +@Schema(description = "Items count abstract class") +public abstract class ItemsCount { + @XmlElement(name = "self-asserted-count", namespace = "http://www.orcid.org/ns/summary") + private Integer selfAssertedCount; + @XmlElement(name = "validated-count", namespace = "http://www.orcid.org/ns/summary") + private Integer validatedCount; + + public Integer getSelfAssertedCount() { + return selfAssertedCount; + } + + public void setSelfAssertedCount(Integer selfAssertedCount) { + this.selfAssertedCount = selfAssertedCount; + } + + public Integer getValidatdeCount() { + return validatedCount; + } + + public void setValidatedCount(Integer validatedCount) { + this.validatedCount = validatedCount; + } + + @Override + public int hashCode() { + return Objects.hash(selfAssertedCount, validatedCount); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ItemsCount other = (ItemsCount) obj; + return Objects.equals(selfAssertedCount, other.selfAssertedCount) && Objects.equals(validatedCount, other.validatedCount); + } +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/PeerReviews.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/PeerReviews.java new file mode 100644 index 00000000000..77aefbdf744 --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/PeerReviews.java @@ -0,0 +1,66 @@ +package org.orcid.api.member.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 io.swagger.v3.oas.annotations.media.Schema; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(propOrder = { "peer-review-publication-grants", "self-asserted-count", "total" }) +@XmlRootElement(name = "peer-reviews", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "Peer reviews") +public class PeerReviews { + @XmlElement(name = "peer-review-publication-grants", namespace = "http://www.orcid.org/ns/summary") + private Integer peerReviewPublicationGrants; + @XmlElement(name = "self-asserted-count", namespace = "http://www.orcid.org/ns/summary") + private Integer selfAssertedCount; + @XmlElement(name = "total", namespace = "http://www.orcid.org/ns/summary") + private Integer total; + + public Integer getPeerReviewPublicationGrants() { + return peerReviewPublicationGrants; + } + + public void setPeerReviewPublicationGrants(Integer peerReviewPublicationGrants) { + this.peerReviewPublicationGrants = peerReviewPublicationGrants; + } + + public Integer getSelfAssertedCount() { + return selfAssertedCount; + } + + public void setSelfAssertedCount(Integer selfAssertedCount) { + this.selfAssertedCount = selfAssertedCount; + } + + public Integer getTotal() { + return total; + } + + public void setTotal(Integer total) { + this.total = total; + } + + @Override + public int hashCode() { + return Objects.hash(peerReviewPublicationGrants, selfAssertedCount, total); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + PeerReviews other = (PeerReviews) obj; + return Objects.equals(peerReviewPublicationGrants, other.peerReviewPublicationGrants) && Objects.equals(selfAssertedCount, other.selfAssertedCount) + && Objects.equals(total, other.total); + } +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/ProfessionalActivities.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/ProfessionalActivities.java new file mode 100644 index 00000000000..42c962e60d6 --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/ProfessionalActivities.java @@ -0,0 +1,57 @@ +package org.orcid.api.member.model; + +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", "professionalActivities" }) +@XmlRootElement(name = "professional-activities", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "Professional activities list") +public class ProfessionalActivities { + @XmlElement(name = "count", namespace = "http://www.orcid.org/ns/activities") + private Integer count; + @XmlElement(name = "professional-activity", namespace = "http://www.orcid.org/ns/activities") + private List professionalActivities; + + public Integer getCount() { + return count; + } + + public void setCount(Integer count) { + this.count = count; + } + + public List getProfessionalActivities() { + return professionalActivities; + } + + public void setProfessionalActivities(List professionalActivities) { + this.professionalActivities = professionalActivities; + } + + @Override + public int hashCode() { + return Objects.hash(count, professionalActivities); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ProfessionalActivities other = (ProfessionalActivities) obj; + return Objects.equals(count, other.count) && Objects.equals(professionalActivities, other.professionalActivities); + } + +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/ProfessionalActivity.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/ProfessionalActivity.java new file mode 100644 index 00000000000..3c4c5461433 --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/ProfessionalActivity.java @@ -0,0 +1,82 @@ +package org.orcid.api.member.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 io.swagger.v3.oas.annotations.media.Schema; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(propOrder = { "putCode", "type", "organizationName", "role", "url", "validated" }) +@XmlRootElement(name = "professional-activity", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "Professional activity") +public class ProfessionalActivity { + @XmlElement(name = "put-code", namespace = "http://www.orcid.org/ns/summary") + private Long putCode; + @XmlElement(name = "type", namespace = "http://www.orcid.org/ns/summary") + private String type; + @XmlElement(name = "organization-name", namespace = "http://www.orcid.org/ns/summary") + private String organizationName; + @XmlElement(name = "role", namespace = "http://www.orcid.org/ns/summary") + private String role; + @XmlElement(name = "url", namespace = "http://www.orcid.org/ns/summary") + private String url; + @XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/summary") + private boolean validated; + public Long getPutCode() { + return putCode; + } + public void setPutCode(Long putCode) { + this.putCode = putCode; + } + 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(organizationName, putCode, role, 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; + ProfessionalActivity other = (ProfessionalActivity) obj; + return Objects.equals(organizationName, other.organizationName) && Objects.equals(putCode, other.putCode) && Objects.equals(role, other.role) + && Objects.equals(type, other.type) && Objects.equals(url, other.url) && validated == other.validated; + } +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/RecordSummary.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/RecordSummary.java new file mode 100644 index 00000000000..377aa0eb2fa --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/RecordSummary.java @@ -0,0 +1,138 @@ +package org.orcid.api.member.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.CreatedDate; +import org.orcid.jaxb.model.v3.release.common.LastModifiedDate; + +import io.swagger.v3.oas.annotations.media.Schema; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(propOrder = { "createdDate", "lastModifiedDate", "creditName", "orcidIdentifier", "externalIdentifiers", "employments", "profilessionalActivities", "fundings", + "works", "peerReviews" }) +@XmlRootElement(name = "work-summary", namespace = "http://www.orcid.org/ns/work") +@Schema(description = "Record summary") +public class RecordSummary { + + @XmlElement(name = "last-modified-date", namespace = "http://www.orcid.org/ns/common") + private LastModifiedDate lastModifiedDate; + @XmlElement(name = "created-date", namespace = "http://www.orcid.org/ns/common") + private CreatedDate createdDate; + @XmlElement(name = "credit-name", namespace = "http://www.orcid.org/ns/summary") + private String creditName; + @XmlElement(name = "external-identifiers", namespace = "http://www.orcid.org/ns/summary") + private ExternalIdentifiers externalIdentifiers; + @XmlElement(name = "employments", namespace = "http://www.orcid.org/ns/summary") + private Employments employments; + @XmlElement(name = "professional-activities", namespace = "http://www.orcid.org/ns/summary") + private ProfessionalActivities professionalActivities; + @XmlElement(name = "fundings", namespace = "http://www.orcid.org/ns/summary") + private Fundings fundings; + @XmlElement(name = "works", namespace = "http://www.orcid.org/ns/summary") + private Works works; + @XmlElement(name = "peer-reviews", namespace = "http://www.orcid.org/ns/summary") + private PeerReviews peerReviews; + + public LastModifiedDate getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(LastModifiedDate lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public CreatedDate getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(CreatedDate createdDate) { + this.createdDate = createdDate; + } + + public String getCreditName() { + return creditName; + } + + public void setCreditName(String creditName) { + this.creditName = creditName; + } + + public ExternalIdentifiers getExternalIdentifiers() { + return externalIdentifiers; + } + + public void setExternalIdentifiers(ExternalIdentifiers externalIdentifiers) { + this.externalIdentifiers = externalIdentifiers; + } + + public Employments getEmployments() { + return employments; + } + + public void setEmployments(Employments employments) { + this.employments = employments; + } + + public ProfessionalActivities getProfessionalActivities() { + return professionalActivities; + } + + public void setProfessionalActivities(ProfessionalActivities professionalActivities) { + this.professionalActivities = professionalActivities; + } + + public Fundings getFundings() { + return fundings; + } + + public void setFundings(Fundings fundings) { + this.fundings = fundings; + } + + public Works getWorks() { + return works; + } + + public void setWorks(Works works) { + this.works = works; + } + + public PeerReviews getPeerReviews() { + return peerReviews; + } + + public void setPeerReviews(PeerReviews peerReviews) { + this.peerReviews = peerReviews; + } + + @Override + public int hashCode() { + return Objects.hash(createdDate, creditName, employments, externalIdentifiers, fundings, lastModifiedDate, peerReviews, professionalActivities, works); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + RecordSummary other = (RecordSummary) obj; + return Objects.equals(createdDate, other.createdDate) && Objects.equals(creditName, other.creditName) && Objects.equals(employments, other.employments) + && Objects.equals(externalIdentifiers, other.externalIdentifiers) && Objects.equals(fundings, other.fundings) + && Objects.equals(lastModifiedDate, other.lastModifiedDate) && Objects.equals(peerReviews, other.peerReviews) + && Objects.equals(professionalActivities, other.professionalActivities) && Objects.equals(works, other.works); + } + + public RecordSummary valueOf(org.orcid.pojo.summary.RecordSummary coreSummaryObject) { + RecordSummary summary = new RecordSummary(); + return summary; + } +} diff --git a/orcid-api-web/src/main/java/org/orcid/api/member/model/Works.java b/orcid-api-web/src/main/java/org/orcid/api/member/model/Works.java new file mode 100644 index 00000000000..f7d41ea9f8e --- /dev/null +++ b/orcid-api-web/src/main/java/org/orcid/api/member/model/Works.java @@ -0,0 +1,11 @@ +package org.orcid.api.member.model; + +import javax.xml.bind.annotation.XmlRootElement; + +import io.swagger.v3.oas.annotations.media.Schema; + +@XmlRootElement(name = "works", namespace = "http://www.orcid.org/ns/summary") +@Schema(description = "Works") +public class Works extends ItemsCount { + +} diff --git a/orcid-core/src/main/java/org/orcid/pojo/summary/AffiliationSummary.java b/orcid-core/src/main/java/org/orcid/pojo/summary/AffiliationSummary.java index 6a7bad05497..11b21b589d0 100644 --- a/orcid-core/src/main/java/org/orcid/pojo/summary/AffiliationSummary.java +++ b/orcid-core/src/main/java/org/orcid/pojo/summary/AffiliationSummary.java @@ -13,6 +13,7 @@ public class AffiliationSummary { private String role; private String type; private boolean validated; + private long putCode; public String getOrganizationName() { return organizationName; @@ -69,11 +70,22 @@ public boolean isValidated() { public void setValidated(boolean validated) { this.validated = validated; } + + public long getPutCode() { + return putCode; + } + + public void setPutCode(long putCode) { + this.putCode = putCode; + } public static AffiliationSummary valueOf(AffiliationForm as, String orcid, String type) { AffiliationSummary form = new AffiliationSummary(); if (as != null) { + if(!PojoUtil.isEmpty(as.getPutCode())) { + form.setPutCode(Long.valueOf(as.getPutCode().getValue())); + } if (!PojoUtil.isEmpty(as.getAffiliationName())) { form.setOrganizationName(as.getAffiliationName().getValue()); } @@ -131,6 +143,10 @@ public static AffiliationSummary valueof(org.orcid.jaxb.model.v3.release.record. if(as.getSource() != null) { form.setValidated(!SourceUtils.isSelfAsserted(as.getSource(), orcid)); } + + if(as.getPutCode() != null) { + form.setPutCode(as.getPutCode()); + } } return form; }