use of org.orcid.jaxb.model.common_rc4.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_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_rc4.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_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_rc4.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(GroupsContainer groupsContainerV2) {
if (groupsContainerV2.retrieveGroups() != null && !groupsContainerV2.retrieveGroups().isEmpty()) {
List<? extends Group> groupsRc1 = new ArrayList<>(groupsContainerV2.retrieveGroups());
List<org.orcid.jaxb.model.record_v2.Group> groupsV2 = new ArrayList<>(groupsContainerV2.retrieveGroups());
if (groupsRc1.get(0).getActivities() != null && !groupsRc1.get(0).getActivities().isEmpty()) {
LastModifiedDate latest = null;
for (Group group : groupsV2) {
calculateLastModified(group);
if (group.getLastModifiedDate() != null && group.getLastModifiedDate().after(latest)) {
latest = group.getLastModifiedDate();
}
}
groupsContainerV2.setLastModifiedDate(latest);
}
}
}
use of org.orcid.jaxb.model.common_rc4.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(Emails emails) {
if (emails != null && emails.getEmails() != null && !emails.getEmails().isEmpty()) {
LastModifiedDate latest = null;
for (Email email : emails.getEmails()) {
if (email.getLastModifiedDate() != null && email.getLastModifiedDate().after(latest)) {
latest = email.getLastModifiedDate();
}
}
emails.setLastModifiedDate(latest);
}
}
use of org.orcid.jaxb.model.common_rc4.LastModifiedDate in project ORCID-Source by ORCID.
the class WorkFormTest method getWork.
private Work getWork() {
Work work = new Work();
work.setCountry(new Country(Iso3166Country.US));
work.setJournalTitle(new Title("Journal title"));
work.setLanguageCode("en");
work.setPutCode(Long.valueOf("1"));
work.setShortDescription("Short description");
work.setSource(new org.orcid.jaxb.model.common_v2.Source("0000-0000-0000-0000"));
work.setUrl(new Url("http://myurl.com"));
work.setVisibility(org.orcid.jaxb.model.common_v2.Visibility.PUBLIC);
org.orcid.jaxb.model.record_v2.Citation citation = new org.orcid.jaxb.model.record_v2.Citation();
citation.setCitation("Citation");
citation.setWorkCitationType(CitationType.FORMATTED_UNSPECIFIED);
work.setWorkCitation(citation);
WorkTitle title = new WorkTitle();
title.setTitle(new Title("Title"));
title.setTranslatedTitle(new org.orcid.jaxb.model.common_v2.TranslatedTitle("Translated Title", "es"));
title.setSubtitle(new Subtitle("Subtitle"));
work.setWorkTitle(title);
work.setWorkType(WorkType.ARTISTIC_PERFORMANCE);
Date date = new Date();
date.setDay("1");
date.setMonth("1");
date.setYear("2015");
GregorianCalendar calendar = date.toCalendar();
work.setCreatedDate(new CreatedDate(datatypeFactory.newXMLGregorianCalendar(calendar)));
date = new Date();
date.setDay("2");
date.setMonth("2");
date.setYear("2015");
calendar = date.toCalendar();
work.setLastModifiedDate(new LastModifiedDate(datatypeFactory.newXMLGregorianCalendar(calendar)));
work.setPublicationDate(new PublicationDate(new Year(2015), new Month(3), new Day(3)));
org.orcid.jaxb.model.record_v2.WorkContributors contributors = new org.orcid.jaxb.model.record_v2.WorkContributors();
org.orcid.jaxb.model.common_v2.Contributor contributor = new org.orcid.jaxb.model.common_v2.Contributor();
org.orcid.jaxb.model.common_v2.ContributorAttributes attributes = new org.orcid.jaxb.model.common_v2.ContributorAttributes();
attributes.setContributorRole(org.orcid.jaxb.model.common_v2.ContributorRole.CO_INVENTOR);
attributes.setContributorSequence(org.orcid.jaxb.model.record_v2.SequenceType.FIRST);
contributor.setContributorAttributes(attributes);
contributor.setContributorEmail(null);
ContributorOrcid contributorOrcid = new ContributorOrcid("Contributor orcid");
contributorOrcid.setUri("Contributor uri");
contributor.setContributorOrcid(contributorOrcid);
CreditName creditName = new CreditName("Contributor credit name");
contributor.setCreditName(creditName);
contributors.getContributor().add(contributor);
work.setWorkContributors(contributors);
ExternalIDs externalIdentifiers = new ExternalIDs();
ExternalID extId = new ExternalID();
extId.setValue("External Identifier ID");
extId.setType(org.orcid.jaxb.model.message.WorkExternalIdentifierType.ASIN.value());
extId.setRelationship(Relationship.SELF);
externalIdentifiers.getExternalIdentifier().add(extId);
work.setWorkExternalIdentifiers(externalIdentifiers);
return work;
}
Aggregations