use of org.orcid.jaxb.model.common_rc2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(PersonExternalIdentifiers extIds) {
if (extIds != null && extIds.getExternalIdentifiers() != null && !extIds.getExternalIdentifiers().isEmpty()) {
LastModifiedDate latest = null;
for (PersonExternalIdentifier extId : extIds.getExternalIdentifiers()) {
if (extId.getLastModifiedDate() != null && extId.getLastModifiedDate().after(latest)) {
latest = extId.getLastModifiedDate();
}
}
extIds.setLastModifiedDate(latest);
}
}
use of org.orcid.jaxb.model.common_rc2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(GroupIdRecords groupIdRecords) {
if (groupIdRecords != null && groupIdRecords.getGroupIdRecord() != null && !groupIdRecords.getGroupIdRecord().isEmpty()) {
LastModifiedDate latest = null;
for (GroupIdRecord groupid : groupIdRecords.getGroupIdRecord()) {
if (groupid.getLastModifiedDate() != null && groupid.getLastModifiedDate().after(latest)) {
latest = groupid.getLastModifiedDate();
}
}
groupIdRecords.setLastModifiedDate(latest);
}
}
use of org.orcid.jaxb.model.common_rc2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_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_rc2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(GroupsContainer groupsContainerRc3) {
if (groupsContainerRc3.retrieveGroups() != null && !groupsContainerRc3.retrieveGroups().isEmpty()) {
List<? extends Group> groupsRc1 = new ArrayList<>(groupsContainerRc3.retrieveGroups());
List<org.orcid.jaxb.model.record_rc3.Group> groupsRc3 = new ArrayList<>(groupsContainerRc3.retrieveGroups());
if (groupsRc1.get(0).getActivities() != null && !groupsRc1.get(0).getActivities().isEmpty()) {
LastModifiedDate latest = null;
for (Group group : groupsRc3) {
calculateLastModified(group);
if (group.getLastModifiedDate() != null && group.getLastModifiedDate().after(latest)) {
latest = group.getLastModifiedDate();
}
}
groupsContainerRc3.setLastModifiedDate(latest);
}
}
}
use of org.orcid.jaxb.model.common_rc2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_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