use of org.orcid.jaxb.model.common_v2.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);
}
}
use of org.orcid.jaxb.model.common_v2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(Addresses addresses) {
if (addresses != null && addresses.getAddress() != null && !addresses.getAddress().isEmpty()) {
LastModifiedDate latest = null;
for (Address address : addresses.getAddress()) {
if (address.getLastModifiedDate() != null && address.getLastModifiedDate().after(latest)) {
latest = address.getLastModifiedDate();
}
}
addresses.setLastModifiedDate(latest);
}
}
use of org.orcid.jaxb.model.common_v2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(PersonalDetails personalDetails) {
if (personalDetails != null) {
calculateLastModified(personalDetails.getOtherNames());
LastModifiedDate l1 = personalDetails.getBiography() == null ? null : personalDetails.getBiography().getLastModifiedDate();
LastModifiedDate l2 = personalDetails.getName() == null ? null : personalDetails.getName().getLastModifiedDate();
LastModifiedDate l3 = personalDetails.getOtherNames() == null ? null : personalDetails.getOtherNames().getLastModifiedDate();
LastModifiedDate globalLatest = calculateLatest(l1, l2, l3);
personalDetails.setLastModifiedDate(globalLatest);
}
}
use of org.orcid.jaxb.model.common_v2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc3_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(ResearcherUrls researcherUrls) {
if (researcherUrls != null && researcherUrls.getResearcherUrls() != null && !researcherUrls.getResearcherUrls().isEmpty()) {
LastModifiedDate latest = null;
for (ResearcherUrl researcherUrl : researcherUrls.getResearcherUrls()) {
if (researcherUrl.getLastModifiedDate() != null && researcherUrl.getLastModifiedDate().after(latest)) {
latest = researcherUrl.getLastModifiedDate();
}
}
researcherUrls.setLastModifiedDate(latest);
}
}
use of org.orcid.jaxb.model.common_v2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc2_LastModifiedDatesHelper method calculateLatest.
public static Date calculateLatest(GroupsContainer groupsContainerRc2) {
Date latestGrp = null;
if (groupsContainerRc2.retrieveGroups() != null && !groupsContainerRc2.retrieveGroups().isEmpty()) {
List<? extends Group> groupsRc1 = new ArrayList<>(groupsContainerRc2.retrieveGroups());
List<org.orcid.jaxb.model.record_rc2.Group> groupsRc2 = new ArrayList<>(groupsContainerRc2.retrieveGroups());
if (groupsRc1.get(0).getActivities() != null && !groupsRc1.get(0).getActivities().isEmpty()) {
for (int index = 0; index < groupsRc2.size(); index++) {
latestGrp = calculateLatest(groupsRc2.get(index));
}
groupsContainerRc2.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendarNoTimeZoneNoMillis(latestGrp)));
}
}
return latestGrp;
}
Aggregations