use of org.orcid.jaxb.model.common_rc3.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(ActivitiesSummary activitiesSummary) {
if (activitiesSummary != null) {
calculateLastModified(activitiesSummary.getEducations());
calculateLastModified(activitiesSummary.getEmployments());
calculateLastModified(activitiesSummary.getFundings());
calculateLastModified(activitiesSummary.getPeerReviews());
calculateLastModified(activitiesSummary.getWorks());
LastModifiedDate l1 = activitiesSummary.getEducations() == null ? null : activitiesSummary.getEducations().getLastModifiedDate();
LastModifiedDate l2 = activitiesSummary.getEmployments() == null ? null : activitiesSummary.getEmployments().getLastModifiedDate();
LastModifiedDate l3 = activitiesSummary.getFundings() == null ? null : activitiesSummary.getFundings().getLastModifiedDate();
LastModifiedDate l4 = activitiesSummary.getPeerReviews() == null ? null : activitiesSummary.getPeerReviews().getLastModifiedDate();
LastModifiedDate l5 = activitiesSummary.getWorks() == null ? null : activitiesSummary.getWorks().getLastModifiedDate();
LastModifiedDate globalLatest = calculateLatest(l1, l2, l3, l4, l5);
activitiesSummary.setLastModifiedDate(globalLatest);
}
}
use of org.orcid.jaxb.model.common_rc3.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(ActivitiesContainer actContainerRc3) {
Collection<? extends Activity> activities = actContainerRc3.retrieveActivities();
if (activities != null && !activities.isEmpty()) {
Iterator<? extends Activity> activitiesIterator = activities.iterator();
XMLGregorianCalendar latest = activitiesIterator.next().getLastModifiedDate().getValue();
while (activitiesIterator.hasNext()) {
Activity activity = activitiesIterator.next();
if (latest.compare(activity.getLastModifiedDate().getValue()) == -1) {
latest = activity.getLastModifiedDate().getValue();
}
}
actContainerRc3.setLastModifiedDate(new LastModifiedDate(latest));
}
}
use of org.orcid.jaxb.model.common_rc3.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(OtherNames otherNames) {
if (otherNames != null && otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) {
LastModifiedDate latest = null;
for (OtherName otherName : otherNames.getOtherNames()) {
if (otherName.getLastModifiedDate() != null && otherName.getLastModifiedDate().after(latest)) {
latest = otherName.getLastModifiedDate();
}
}
otherNames.setLastModifiedDate(latest);
}
}
use of org.orcid.jaxb.model.common_rc3.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(Group group) {
Collection<? extends GroupableActivity> activities = group.getActivities();
if (activities != null && !activities.isEmpty()) {
Iterator<? extends GroupableActivity> activitiesIterator = activities.iterator();
LastModifiedDate latest = null;
while (activitiesIterator.hasNext()) {
GroupableActivity activity = activitiesIterator.next();
if (activity.getLastModifiedDate() != null && activity.getLastModifiedDate().after(latest)) {
latest = activity.getLastModifiedDate();
}
}
group.setLastModifiedDate(latest);
}
}
use of org.orcid.jaxb.model.common_rc3.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(Person person) {
if (person != null) {
calculateLastModified(person.getAddresses());
calculateLastModified(person.getEmails());
calculateLastModified(person.getExternalIdentifiers());
calculateLastModified(person.getKeywords());
calculateLastModified(person.getOtherNames());
calculateLastModified(person.getResearcherUrls());
LastModifiedDate l1 = person.getAddresses() == null ? null : person.getAddresses().getLastModifiedDate();
LastModifiedDate l2 = person.getEmails() == null ? null : person.getEmails().getLastModifiedDate();
LastModifiedDate l3 = person.getExternalIdentifiers() == null ? null : person.getExternalIdentifiers().getLastModifiedDate();
LastModifiedDate l4 = person.getKeywords() == null ? null : person.getKeywords().getLastModifiedDate();
LastModifiedDate l5 = person.getOtherNames() == null ? null : person.getOtherNames().getLastModifiedDate();
LastModifiedDate l6 = person.getResearcherUrls() == null ? null : person.getResearcherUrls().getLastModifiedDate();
LastModifiedDate globalLatest = calculateLatest(l1, l2, l3, l4, l5, l6);
person.setLastModifiedDate(globalLatest);
}
}
Aggregations