use of org.orcid.jaxb.model.record.summary_rc1.Employments in project ORCID-Source by ORCID.
the class PublicV2ApiServiceDelegatorImpl method viewEmployments.
@Override
public Response viewEmployments(String orcid) {
List<EmploymentSummary> employments = affiliationsManagerReadOnly.getEmploymentSummaryList(orcid, getLastModifiedTime(orcid));
Employments publicEmployments = new Employments();
for (EmploymentSummary summary : employments) {
if (Visibility.PUBLIC.equals(summary.getVisibility())) {
ActivityUtils.setPathToActivity(summary, orcid);
sourceUtilsReadOnly.setSourceName(summary);
publicEmployments.getSummaries().add(summary);
}
}
Api2_0_LastModifiedDatesHelper.calculateLastModified(publicEmployments);
ActivityUtils.setPathToEmployments(publicEmployments, orcid);
return Response.ok(publicEmployments).build();
}
use of org.orcid.jaxb.model.record.summary_rc1.Employments in project ORCID-Source by ORCID.
the class SourceUtils method setSourceName.
public void setSourceName(ActivitiesSummary as) {
if (as == null) {
return;
}
if (as.getEducations() != null) {
Educations educations = as.getEducations();
List<EducationSummary> list = educations.getSummaries();
if (list != null) {
for (EducationSummary summary : list) {
setSourceName(summary);
}
}
}
if (as.getEmployments() != null) {
Employments employments = as.getEmployments();
List<EmploymentSummary> list = employments.getSummaries();
if (list != null) {
for (EmploymentSummary summary : list) {
setSourceName(summary);
}
}
}
if (as.getFundings() != null) {
Fundings fundings = as.getFundings();
List<FundingGroup> groups = fundings.getFundingGroup();
if (groups != null) {
for (FundingGroup group : groups) {
List<FundingSummary> summaryList = group.getFundingSummary();
if (summaryList != null) {
for (FundingSummary summary : summaryList) {
setSourceName(summary);
}
}
}
}
}
if (as.getPeerReviews() != null) {
PeerReviews peerReviews = as.getPeerReviews();
List<PeerReviewGroup> groups = peerReviews.getPeerReviewGroup();
if (groups != null) {
for (PeerReviewGroup group : groups) {
List<PeerReviewSummary> summaryList = group.getPeerReviewSummary();
if (summaryList != null) {
for (PeerReviewSummary summary : summaryList) {
setSourceName(summary);
}
}
}
}
}
if (as.getWorks() != null) {
Works works = as.getWorks();
List<WorkGroup> groups = works.getWorkGroup();
if (groups != null) {
for (WorkGroup group : groups) {
List<WorkSummary> summaryList = group.getWorkSummary();
if (summaryList != null) {
for (WorkSummary summary : summaryList) {
setSourceName(summary);
}
}
}
}
}
}
Aggregations