Search in sources :

Example 31 with LastModifiedDate

use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.

the class Api3_0_Dev1LastModifiedDatesHelper 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);
    }
}
Also used : LastModifiedDate(org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate) ResearcherUrl(org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)

Example 32 with LastModifiedDate

use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.

the class Api3_0_Dev1LastModifiedDatesHelper 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);
    }
}
Also used : LastModifiedDate(org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate) GroupableActivity(org.orcid.jaxb.model.v3.dev1.record.GroupableActivity)

Example 33 with LastModifiedDate

use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.

the class Api3_0_Dev1LastModifiedDatesHelper method calculateLastModified.

public static void calculateLastModified(Keywords keywords) {
    if (keywords != null && keywords.getKeywords() != null && !keywords.getKeywords().isEmpty()) {
        LastModifiedDate latest = null;
        for (Keyword keyword : keywords.getKeywords()) {
            if (keyword.getLastModifiedDate() != null && keyword.getLastModifiedDate().after(latest)) {
                latest = keyword.getLastModifiedDate();
            }
        }
        keywords.setLastModifiedDate(latest);
    }
}
Also used : LastModifiedDate(org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate) Keyword(org.orcid.jaxb.model.v3.dev1.record.Keyword)

Example 34 with LastModifiedDate

use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.

the class Api3_0_Dev1LastModifiedDatesHelper 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);
    }
}
Also used : LastModifiedDate(org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate) Address(org.orcid.jaxb.model.v3.dev1.record.Address)

Example 35 with LastModifiedDate

use of org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate in project ORCID-Source by ORCID.

the class Api3_0_Dev1LastModifiedDatesHelper 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);
    }
}
Also used : LastModifiedDate(org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate) GroupIdRecord(org.orcid.jaxb.model.v3.dev1.groupid.GroupIdRecord)

Aggregations

LastModifiedDate (org.orcid.jaxb.model.v3.dev1.common.LastModifiedDate)45 Test (org.junit.Test)18 DBUnitTest (org.orcid.test.DBUnitTest)17 Response (javax.ws.rs.core.Response)15 CreatedDate (org.orcid.jaxb.model.v3.dev1.common.CreatedDate)8 DisambiguatedOrganization (org.orcid.jaxb.model.v3.dev1.common.DisambiguatedOrganization)7 Url (org.orcid.jaxb.model.v3.dev1.common.Url)5 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)5 ArrayList (java.util.ArrayList)4 OtherName (org.orcid.jaxb.model.v3.dev1.record.OtherName)4 FuzzyDate (org.orcid.jaxb.model.v3.dev1.common.FuzzyDate)3 PublicationDate (org.orcid.jaxb.model.v3.dev1.common.PublicationDate)3 Title (org.orcid.jaxb.model.v3.dev1.common.Title)3 Biography (org.orcid.jaxb.model.v3.dev1.record.Biography)3 Name (org.orcid.jaxb.model.v3.dev1.record.Name)3 WorkGroup (org.orcid.jaxb.model.v3.dev1.record.summary.WorkGroup)3 WorkSummary (org.orcid.jaxb.model.v3.dev1.record.summary.WorkSummary)3 Works (org.orcid.jaxb.model.v3.dev1.record.summary.Works)3 Date (java.util.Date)2 CreditName (org.orcid.jaxb.model.v3.dev1.common.CreditName)2