-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Deactivated records should get 409 on GET requests * Send the summary to the cache * Fix unit tests * On the UI endpoint return json by default * Working on API object * Working on model object * Working on model object * Working on unit tests * Unit tests done * Adding more unit tests * Ready to test * Add type to professional activities * Ready to go * Fix unit tests
- Loading branch information
1 parent
1efc38f
commit 1c5f82a
Showing
47 changed files
with
1,627 additions
and
348 deletions.
There are no files selected for viewing
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
5 changes: 4 additions & 1 deletion
5
orcid-core/src/main/java/org/orcid/core/common/manager/SummaryManager.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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package org.orcid.core.common.manager; | ||
|
||
import org.orcid.pojo.summary.RecordSummary; | ||
import org.orcid.core.model.RecordSummary; | ||
import org.orcid.pojo.summary.RecordSummaryPojo; | ||
|
||
public interface SummaryManager { | ||
RecordSummary getRecordSummary(String orcid); | ||
|
||
RecordSummaryPojo getRecordSummaryPojo(String orcid); | ||
} |
354 changes: 270 additions & 84 deletions
354
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
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
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
106 changes: 106 additions & 0 deletions
106
orcid-core/src/main/java/org/orcid/core/model/Employment.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,106 @@ | ||
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.XmlType; | ||
|
||
import org.orcid.jaxb.model.v3.release.common.FuzzyDate; | ||
import org.orcid.jaxb.model.v3.release.record.AffiliationType; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@XmlType(propOrder = { "putCode", "type", "organizationName", "role", "url", "startDate", "endDate", "validated" }) | ||
@XmlRootElement(name = "employment", namespace = "http://www.orcid.org/ns/summary") | ||
@Schema(description = "Employment") | ||
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 = "type", namespace = "http://www.orcid.org/ns/summary") | ||
protected final String type = AffiliationType.EMPLOYMENT.value(); | ||
@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 String getType() { | ||
return type; | ||
} | ||
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; | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
orcid-core/src/main/java/org/orcid/core/model/Employments.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,61 @@ | ||
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", "employments" }) | ||
@XmlRootElement(name = "employments", namespace = "http://www.orcid.org/ns/summary") | ||
@Schema(description = "Employments list") | ||
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/summary") | ||
private List<Employment> employments; | ||
|
||
public Integer getCount() { | ||
return count; | ||
} | ||
|
||
public void setCount(Integer count) { | ||
this.count = count; | ||
} | ||
|
||
public List<Employment> getEmployments() { | ||
return employments; | ||
} | ||
|
||
public void setEmployments(List<Employment> 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); | ||
} | ||
} |
Oops, something went wrong.