use of org.orcid.jaxb.model.record_rc3.Activity in project ORCID-Source by ORCID.
the class Api2_0_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(ActivitiesContainer actContainerV2) {
if (actContainerV2 != null) {
Collection<? extends Activity> activities = actContainerV2.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();
}
}
actContainerV2.setLastModifiedDate(new LastModifiedDate(latest));
}
}
}
use of org.orcid.jaxb.model.record_rc3.Activity in project ORCID-Source by ORCID.
the class Api2_0_rc3_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);
}
}
Aggregations