private Work getWorkFromSummary(WorkSummary summary) { Work work = new Work(); work.setWorkTitle(summary.getTitle()); work.setWorkType(summary.getType()); work.setPublicationDate(summary.getPublicationDate()); work.setWorkExternalIdentifiers(summary.getExternalIdentifiers()); work.setVisibility(summary.getVisibility()); work.setSource(getUpdatedSource(summary.getSource())); return work; }
@Override public int compareTo(GroupableActivity activity) { Long index = Long.valueOf(this.getDisplayIndex() == null ? "0" : this.getDisplayIndex()); Long otherIndex = Long.valueOf(activity.getDisplayIndex() == null ? "0" : activity.getDisplayIndex()); if (index == null) { if (otherIndex == null) { return 0; } else { return -1; } } else { if (otherIndex == null) { return 1; } else if (index instanceof Comparable) { // Return opposite, since higher index goes first return index.compareTo(otherIndex) * -1; } else { return 0; } } } }
/** * From database to model object */ @Override public void mapBtoA(MinimizedWorkEntity b, WorkSummary a, MappingContext context) { a.setType(getWorkType(b.getWorkType())); }
@Override public String generateBibtexReferenceList(String orcid) { ActivitiesSummary summary = activitiesManager.getActivitiesSummary(orcid); List<String> citations = new ArrayList<String>(); if (summary.getWorks()!=null){ for (WorkGroup group : summary.getWorks().getWorkGroup()){ WorkSummary workSummary = group.getWorkSummary().get(0); Work work = workManager.getWork(orcid, workSummary.getPutCode()); String bibtex = generateBibtex(orcid,work); if (bibtex != null) citations.add(bibtex); } } return Joiner.on(",\n").join(citations); }
/** * From model object to database object */ @Override public void mapAtoB(WorkSummary a, MinimizedWorkEntity b, MappingContext context) { //Starting with 3.0_rc2 dissertation will be migrated to dissertation-thesis if(WorkType.DISSERTATION.equals(a.getType())) { b.setWorkType(org.orcid.jaxb.model.common.WorkType.DISSERTATION_THESIS.name()); } else { b.setWorkType(a.getType().name()); } }
if (justPublic && !work.getVisibility().equals(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC)) {
for (WorkGroup wg : r.getActivitiesSummary().getWorks().getWorkGroup()) { SchemaOrgWork sw = new SchemaOrgWork(); if (wg.getWorkSummary().get(0) != null && wg.getWorkSummary().get(0).getTitle() != null && wg.getWorkSummary().get(0).getTitle().getTitle() != null) sw.name = wg.getWorkSummary().get(0).getTitle().getTitle().getContent();
List<WorkSummary> summaries = work.getWorkSummary(); for (WorkSummary summary : summaries) { activities.put(summary.getPutCode(), summary);
/** * From model object to database object */ @Override public void mapAtoB(WorkSummary a, WorkEntity b, MappingContext context) { //Starting with 3.0_rc2 dissertation will be migrated to dissertation-thesis if(WorkType.DISSERTATION.equals(a.getType())) { b.setWorkType(org.orcid.jaxb.model.common.WorkType.DISSERTATION_THESIS.name()); } else { b.setWorkType(a.getType().name()); } }
/** * From database to model object */ @Override public void mapBtoA(WorkEntity b, WorkSummary a, MappingContext context) { a.setType(getWorkType(b.getWorkType())); }