use of org.orcid.jaxb.model.common_rc2.Url in project ORCID-Source by ORCID.
the class Utils method getPersonExternalIdentifier.
public static PersonExternalIdentifier getPersonExternalIdentifier() {
PersonExternalIdentifier newExtId = new PersonExternalIdentifier();
newExtId.setType("new-common-name");
newExtId.setValue("new-reference");
newExtId.setUrl(new Url("http://newUrl.com"));
newExtId.setVisibility(Visibility.LIMITED);
return newExtId;
}
use of org.orcid.jaxb.model.common_rc2.Url in project ORCID-Source by ORCID.
the class Utils method getWork.
public static Work getWork(String title) {
Work work = new Work();
WorkTitle workTitle = new WorkTitle();
workTitle.setTitle(new Title(title));
work.setWorkTitle(workTitle);
work.setWorkType(WorkType.BOOK);
work.setVisibility(Visibility.PUBLIC);
ExternalIDs extIds = new ExternalIDs();
ExternalID extId = new ExternalID();
extId.setRelationship(Relationship.PART_OF);
extId.setType(WorkExternalIdentifierType.AGR.value());
extId.setValue("ext-id-" + System.currentTimeMillis());
extId.setUrl(new Url("http://thisIsANewUrl.com"));
extIds.getExternalIdentifier().add(extId);
work.setWorkExternalIdentifiers(extIds);
return work;
}
use of org.orcid.jaxb.model.common_rc2.Url in project ORCID-Source by ORCID.
the class Utils method getFunding.
public static Funding getFunding() {
Funding newFunding = new Funding();
FundingTitle title = new FundingTitle();
title.setTitle(new Title("Public Funding # 2"));
newFunding.setTitle(title);
newFunding.setType(FundingType.AWARD);
ExternalID fExtId = new ExternalID();
fExtId.setRelationship(Relationship.PART_OF);
fExtId.setType(FundingExternalIdentifierType.GRANT_NUMBER.value());
fExtId.setUrl(new Url("http://fundingExtId.com"));
fExtId.setValue("new-funding-ext-id");
ExternalIDs fExtIds = new ExternalIDs();
fExtIds.getExternalIdentifier().add(fExtId);
newFunding.setExternalIdentifiers(fExtIds);
newFunding.setOrganization(getOrganization());
return newFunding;
}
use of org.orcid.jaxb.model.common_rc2.Url in project ORCID-Source by ORCID.
the class Utils method getPeerReview.
public static PeerReview getPeerReview() {
PeerReview peerReview = new PeerReview();
ExternalIDs weis = new ExternalIDs();
ExternalID wei1 = new ExternalID();
wei1.setRelationship(Relationship.PART_OF);
wei1.setUrl(new Url("http://myUrl.com"));
wei1.setValue("work-external-identifier-id");
wei1.setType(WorkExternalIdentifierType.DOI.value());
weis.getExternalIdentifier().add(wei1);
peerReview.setExternalIdentifiers(weis);
peerReview.setGroupId("issn:0000003");
peerReview.setOrganization(getOrganization());
peerReview.setRole(Role.CHAIR);
peerReview.setSubjectContainerName(new Title("subject-container-name"));
peerReview.setSubjectExternalIdentifier(wei1);
WorkTitle workTitle = new WorkTitle();
workTitle.setTitle(new Title("work-title"));
peerReview.setSubjectName(workTitle);
peerReview.setSubjectType(WorkType.DATA_SET);
peerReview.setType(PeerReviewType.EVALUATION);
return peerReview;
}
use of org.orcid.jaxb.model.common_rc2.Url in project ORCID-Source by ORCID.
the class WorkForm method toWork.
public Work toWork() {
Work work = new Work();
// Set work id
if (!PojoUtil.isEmpty(this.getPutCode())) {
work.setPutCode(Long.valueOf(this.getPutCode().getValue()));
}
// Set language
if (!PojoUtil.isEmpty(this.getLanguageCode())) {
work.setLanguageCode(this.getLanguageCode().getValue());
}
// Set type
if (!PojoUtil.isEmpty(this.getWorkType())) {
work.setWorkType(WorkType.fromValue(this.getWorkType().getValue()));
}
org.orcid.jaxb.model.record_v2.WorkTitle workTitle = new org.orcid.jaxb.model.record_v2.WorkTitle();
// Set title
if (!PojoUtil.isEmpty(this.getTitle())) {
workTitle.setTitle(new org.orcid.jaxb.model.common_v2.Title(this.getTitle().getValue()));
}
// Set translated title
if (this.getTranslatedTitle() != null && !PojoUtil.isEmpty(this.getTranslatedTitle().getContent())) {
org.orcid.jaxb.model.common_v2.TranslatedTitle translatedTitle = new org.orcid.jaxb.model.common_v2.TranslatedTitle();
translatedTitle.setContent(this.getTranslatedTitle().getContent());
translatedTitle.setLanguageCode(this.getTranslatedTitle().getLanguageCode());
workTitle.setTranslatedTitle(translatedTitle);
}
// Set subtitle
if (!PojoUtil.isEmpty(this.getSubtitle())) {
org.orcid.jaxb.model.common_v2.Subtitle subtitle = new org.orcid.jaxb.model.common_v2.Subtitle();
subtitle.setContent(this.getSubtitle().getValue());
workTitle.setSubtitle(subtitle);
}
work.setWorkTitle(workTitle);
// Set journal title
if (!PojoUtil.isEmpty(this.getJournalTitle())) {
work.setJournalTitle(new org.orcid.jaxb.model.common_v2.Title(this.getJournalTitle().getValue()));
}
// Set description
if (!PojoUtil.isEmpty(this.getShortDescription())) {
work.setShortDescription(this.getShortDescription().getValue());
}
// Set url
if (!PojoUtil.isEmpty(this.getUrl())) {
work.setUrl(new Url(this.getUrl().getValue()));
} else {
work.setUrl(new Url());
}
// Set visibility
if (this.getVisibility() != null) {
work.setVisibility(this.getVisibility());
}
// Set country
if (!PojoUtil.isEmpty(this.getCountryCode())) {
work.setCountry(new org.orcid.jaxb.model.common_v2.Country(org.orcid.jaxb.model.common_v2.Iso3166Country.fromValue(this.getCountryCode().getValue())));
}
// Set publication date
if (this.getPublicationDate() != null) {
Integer yearInteger = PojoUtil.isEmpty(this.getPublicationDate().getYear()) ? null : Integer.valueOf(this.getPublicationDate().getYear());
Integer monthInteger = PojoUtil.isEmpty(this.getPublicationDate().getMonth()) ? null : Integer.valueOf(this.getPublicationDate().getMonth());
Integer dayInteger = PojoUtil.isEmpty(this.getPublicationDate().getDay()) ? null : Integer.valueOf(this.getPublicationDate().getDay());
org.orcid.jaxb.model.common_v2.Year year = null;
org.orcid.jaxb.model.common_v2.Month month = null;
org.orcid.jaxb.model.common_v2.Day day = null;
if (yearInteger != null) {
year = new org.orcid.jaxb.model.common_v2.Year(yearInteger);
}
if (monthInteger != null) {
month = new org.orcid.jaxb.model.common_v2.Month(monthInteger);
}
if (dayInteger != null) {
day = new org.orcid.jaxb.model.common_v2.Day(dayInteger);
}
work.setPublicationDate(new org.orcid.jaxb.model.common_v2.PublicationDate(year, month, day));
}
// Set citation
if (this.getCitation() != null) {
org.orcid.jaxb.model.record_v2.Citation citation = new org.orcid.jaxb.model.record_v2.Citation();
if (!PojoUtil.isEmpty(this.getCitation().getCitation())) {
citation.setCitation(this.getCitation().getCitation().getValue());
}
if (!PojoUtil.isEmpty(this.getCitation().getCitationType())) {
citation.setWorkCitationType(CitationType.fromValue(this.getCitation().getCitationType().getValue()));
}
work.setWorkCitation(citation);
}
// Set contributors
populateContributors(this, work);
// Set external identifiers
populateExternalIdentifiers(this, work);
// Set created date
if (!PojoUtil.isEmpty(this.getCreatedDate())) {
CreatedDate createdDate = new CreatedDate();
createdDate.setValue(DateUtils.convertToXMLGregorianCalendar(this.getCreatedDate().toJavaDate()));
work.setCreatedDate(createdDate);
}
// Set last modified
if (!PojoUtil.isEmpty(this.getLastModified())) {
org.orcid.jaxb.model.common_v2.LastModifiedDate lastModified = new org.orcid.jaxb.model.common_v2.LastModifiedDate();
lastModified.setValue(DateUtils.convertToXMLGregorianCalendar(this.getLastModified().toJavaDate()));
work.setLastModifiedDate(lastModified);
}
if (!PojoUtil.isEmpty(this.getSource())) {
org.orcid.jaxb.model.common_v2.Source source = new org.orcid.jaxb.model.common_v2.Source();
if (OrcidStringUtils.isClientId(this.getSource())) {
source.setSourceClientId(new SourceClientId(this.getSource()));
} else {
source.setSourceOrcid(new SourceOrcid(this.getSource()));
}
work.setSource(source);
}
return work;
}
Aggregations