Skip to content

Commit

Permalink
Ready to test
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Apr 27, 2024
1 parent 0f6fc5b commit 278c2c1
Show file tree
Hide file tree
Showing 13 changed files with 191 additions and 56 deletions.
94 changes: 86 additions & 8 deletions orcid-core/src/main/java/org/orcid/core/model/Employment.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,100 @@
package org.orcid.core.model;

import java.io.Serializable;
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.XmlTransient;
import javax.xml.bind.annotation.XmlType;

import org.orcid.jaxb.model.v3.release.record.AffiliationType;
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" })
@XmlType(propOrder = { "putCode", "organizationName", "role", "url", "startDate", "endDate", "validated" })
@XmlRootElement(name = "employment", namespace = "http://www.orcid.org/ns/summary")
@Schema(description = "Employment")
public class Employment extends ProfessionalActivity {
@XmlTransient
private String type = AffiliationType.EMPLOYMENT.name();


public class Employment implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@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 = "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 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;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
@Override
public int hashCode() {
return Objects.hash(endDate, organizationName, putCode, role, startDate, url, 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)
&& Objects.equals(role, other.role) && Objects.equals(startDate, other.startDate) && Objects.equals(url, other.url) && validated == other.validated;
}
}
11 changes: 8 additions & 3 deletions orcid-core/src/main/java/org/orcid/core/model/Employments.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.orcid.core.model;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

Expand All @@ -15,10 +16,14 @@
@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")
public class Employments implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@XmlElement(name = "count", namespace = "http://www.orcid.org/ns/summary")
private Integer count;
@XmlElement(name = "employment", namespace = "http://www.orcid.org/ns/activities")
@XmlElement(name = "employment", namespace = "http://www.orcid.org/ns/summary")
private List<Employment> employments;

public Integer getCount() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
@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")
@XmlElement(name = "put-code", namespace = "http://www.orcid.org/ns/summary")
private Long putCode;
@XmlElement(name = "external-id-type", namespace = "http://www.orcid.org/ns/activities")
@XmlElement(name = "external-id-type", namespace = "http://www.orcid.org/ns/summary")
private String externalIdType;
@XmlElement(name = "external-id-value", namespace = "http://www.orcid.org/ns/activities")
@XmlElement(name = "external-id-value", namespace = "http://www.orcid.org/ns/summary")
private String externalIdValue;
@XmlElement(name = "external-id-url", namespace = "http://www.orcid.org/ns/activities")
@XmlElement(name = "external-id-url", namespace = "http://www.orcid.org/ns/summary")
private String externalIdUrl;
@XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/activities")
@XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/summary")
private boolean validated;

public Long getPutCode() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.orcid.core.model;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

Expand All @@ -15,8 +16,12 @@
@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")
public class ExternalIdentifiers implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@XmlElement(name = "external-identifier", namespace = "http://www.orcid.org/ns/summary")
List<ExternalIdentifier> externalIdentifiers;

public List<ExternalIdentifier> getExternalIdentifiers() {
Expand Down
9 changes: 8 additions & 1 deletion orcid-core/src/main/java/org/orcid/core/model/Fundings.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package org.orcid.core.model;

import java.io.Serializable;

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 {
public class Fundings extends ItemsCount implements Serializable {

/**
*
*/
private static final long serialVersionUID = 1L;

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.orcid.core.model;

import java.io.Serializable;
import java.util.Objects;

import javax.xml.bind.annotation.XmlAccessType;
Expand All @@ -11,10 +12,14 @@
import io.swagger.v3.oas.annotations.media.Schema;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "peer-review-publication-grants", "self-asserted-count", "total" })
@XmlType(propOrder = { "peerReviewPublicationGrants", "selfAssertedCount", "total" })
@XmlRootElement(name = "peer-reviews", namespace = "http://www.orcid.org/ns/summary")
@Schema(description = "Peer reviews")
public class PeerReviews {
public class PeerReviews implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@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")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.orcid.core.model;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

Expand All @@ -15,10 +16,14 @@
@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")
public class ProfessionalActivities implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@XmlElement(name = "count", namespace = "http://www.orcid.org/ns/summary")
private Integer count;
@XmlElement(name = "professional-activity", namespace = "http://www.orcid.org/ns/activities")
@XmlElement(name = "professional-activity", namespace = "http://www.orcid.org/ns/summary")
private List<ProfessionalActivity> professionalActivities;

public Integer getCount() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@
import io.swagger.v3.oas.annotations.media.Schema;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "putCode", "type", "organizationName", "role", "url", "validated" })
@XmlType(propOrder = { "putCode", "type", "organizationName", "role", "url", "startDate", "endDate", "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;
protected Long putCode;
@XmlElement(name = "start-date", namespace = "http://www.orcid.org/ns/common")
private FuzzyDate startDate;
protected FuzzyDate startDate;
@XmlElement(name = "end-date", namespace = "http://www.orcid.org/ns/common")
private FuzzyDate endDate;
protected FuzzyDate endDate;
@XmlElement(name = "type", namespace = "http://www.orcid.org/ns/summary")
private String type;
protected String type;
@XmlElement(name = "organization-name", namespace = "http://www.orcid.org/ns/summary")
private String organizationName;
protected String organizationName;
@XmlElement(name = "role", namespace = "http://www.orcid.org/ns/summary")
private String role;
protected String role;
@XmlElement(name = "url", namespace = "http://www.orcid.org/ns/summary")
private String url;
protected String url;
@XmlElement(name = "validated", namespace = "http://www.orcid.org/ns/summary")
private boolean validated;
protected boolean validated;

public Long getPutCode() {
return putCode;
Expand Down
17 changes: 10 additions & 7 deletions orcid-core/src/main/java/org/orcid/core/model/RecordSummary.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
package org.orcid.core.model;

import java.io.Serializable;
import java.util.Objects;

import javax.annotation.Resource;
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.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;

import org.orcid.core.manager.impl.OrcidUrlManager;
import org.orcid.jaxb.model.common_v2.SourceClientId;
import org.orcid.jaxb.model.v3.release.common.CreatedDate;
import org.orcid.jaxb.model.v3.release.common.LastModifiedDate;
import org.orcid.jaxb.model.v3.release.common.OrcidIdentifier;
import org.orcid.pojo.summary.AffiliationSummary;
import org.orcid.utils.DateUtils;

import io.swagger.v3.oas.annotations.media.Schema;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "createdDate", "lastModifiedDate", "creditName", "orcidIdentifier", "orcidIdentifier", "externalIdentifiers", "employments", "profilessionalActivities", "fundings",
@XmlType(propOrder = { "createdDate", "lastModifiedDate", "creditName", "orcidIdentifier", "externalIdentifiers", "employments", "professionalActivities", "fundings",
"works", "peerReviews" })
@XmlRootElement(name = "work-summary", namespace = "http://www.orcid.org/ns/work")
@XmlRootElement(name = "record-summary", namespace = "http://www.orcid.org/ns/summary")
@Schema(description = "Record summary")
public class RecordSummary {
public class RecordSummary implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@XmlTransient
@Resource
private OrcidUrlManager orcidUrlManager;
@XmlElement(name = "last-modified-date", namespace = "http://www.orcid.org/ns/common")
Expand Down
9 changes: 8 additions & 1 deletion orcid-core/src/main/java/org/orcid/core/model/Works.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package org.orcid.core.model;

import java.io.Serializable;

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 {
public class Works extends ItemsCount implements Serializable {

/**
*
*/
private static final long serialVersionUID = 1L;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.orcid.org/ns/record", xmlns = {
@javax.xml.bind.annotation.XmlNs(prefix = "activities", namespaceURI = "http://www.orcid.org/ns/activities"),
@javax.xml.bind.annotation.XmlNs(prefix = "common", namespaceURI = "http://www.orcid.org/ns/common"),
@javax.xml.bind.annotation.XmlNs(prefix = "summary", namespaceURI = "http://www.orcid.org/ns/summary")},
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.orcid.core.model;

Loading

0 comments on commit 278c2c1

Please sign in to comment.