use of org.orcid.jaxb.model.record_rc4.ExternalIDs 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.record_rc4.ExternalIDs 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.record_rc4.ExternalIDs 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.record_rc4.ExternalIDs in project ORCID-Source by ORCID.
the class WorkForm method populateExternalIdentifiers.
private static void populateExternalIdentifiers(WorkForm workForm, Work work) {
ExternalIDs workExternalIds = new ExternalIDs();
if (workForm.getWorkExternalIdentifiers() != null && !workForm.getWorkExternalIdentifiers().isEmpty()) {
for (WorkExternalIdentifier wfExtId : workForm.getWorkExternalIdentifiers()) {
ExternalID wExtId = new ExternalID();
if (!PojoUtil.isEmpty(wfExtId.getWorkExternalIdentifierId())) {
wExtId.setValue(wfExtId.getWorkExternalIdentifierId().getValue());
}
if (!PojoUtil.isEmpty(wfExtId.getWorkExternalIdentifierType())) {
wExtId.setType(wfExtId.getWorkExternalIdentifierType().getValue());
}
if (!PojoUtil.isEmpty(wfExtId.getRelationship())) {
wExtId.setRelationship(Relationship.fromValue(wfExtId.getRelationship().getValue()));
}
if (!PojoUtil.isEmpty(wfExtId.getUrl())) {
wExtId.setUrl(new org.orcid.jaxb.model.common_v2.Url(wfExtId.getUrl().getValue()));
}
workExternalIds.getExternalIdentifier().add(wExtId);
}
}
work.setWorkExternalIdentifiers(workExternalIds);
}
use of org.orcid.jaxb.model.record_rc4.ExternalIDs in project ORCID-Source by ORCID.
the class PeerReviewForm method toPeerReview.
public PeerReview toPeerReview() {
PeerReview peerReview = new PeerReview();
// Put Code
if (!PojoUtil.isEmpty(putCode)) {
peerReview.setPutCode(Long.valueOf(putCode.getValue()));
}
// Visibility
if (visibility != null) {
peerReview.setVisibility(visibility);
}
// Completion date
if (completionDate != null) {
peerReview.setCompletionDate(new FuzzyDate(completionDate.toFuzzyDate()));
}
// External identifiers
if (externalIdentifiers != null && !externalIdentifiers.isEmpty()) {
peerReview.setExternalIdentifiers(new ExternalIDs());
for (WorkExternalIdentifier extId : externalIdentifiers) {
peerReview.getExternalIdentifiers().getExternalIdentifier().add(extId.toRecordWorkExternalIdentifier());
}
}
// Set Organization
Organization organization = new Organization();
OrganizationAddress organizationAddress = new OrganizationAddress();
organization.setAddress(organizationAddress);
if (!PojoUtil.isEmpty(orgName)) {
organization.setName(orgName.getValue());
}
if (!PojoUtil.isEmpty(city)) {
organizationAddress.setCity(city.getValue());
}
if (!PojoUtil.isEmpty(region)) {
organizationAddress.setRegion(region.getValue());
}
if (!PojoUtil.isEmpty(country)) {
organizationAddress.setCountry(Iso3166Country.fromValue(country.getValue()));
}
if (!PojoUtil.isEmpty(disambiguatedOrganizationSourceId)) {
organization.setDisambiguatedOrganization(new DisambiguatedOrganization());
organization.getDisambiguatedOrganization().setDisambiguatedOrganizationIdentifier(disambiguatedOrganizationSourceId.getValue());
organization.getDisambiguatedOrganization().setDisambiguationSource(disambiguationSource.getValue());
}
peerReview.setOrganization(organization);
// Role
if (!PojoUtil.isEmpty(role)) {
peerReview.setRole(Role.fromValue(role.getValue()));
}
// Type
if (!PojoUtil.isEmpty(type)) {
peerReview.setType(PeerReviewType.fromValue(type.getValue()));
}
// Url
if (!PojoUtil.isEmpty(url)) {
peerReview.setUrl(new Url(url.getValue()));
}
// Group id
if (!PojoUtil.isEmpty(groupId)) {
peerReview.setGroupId(groupId.getValue());
}
// Subject external id
if (!PojoUtil.isEmpty(subjectExternalIdentifier)) {
ExternalID subjectExtId = new ExternalID();
if (!PojoUtil.isEmpty(subjectExternalIdentifier.getRelationship())) {
subjectExtId.setRelationship(Relationship.fromValue(subjectExternalIdentifier.getRelationship().getValue()));
}
if (!PojoUtil.isEmpty(subjectExternalIdentifier.getUrl())) {
subjectExtId.setUrl(new Url(subjectExternalIdentifier.getUrl().getValue()));
}
if (!PojoUtil.isEmpty(subjectExternalIdentifier.getWorkExternalIdentifierId())) {
subjectExtId.setValue(subjectExternalIdentifier.getWorkExternalIdentifierId().getValue());
}
if (!PojoUtil.isEmpty(subjectExternalIdentifier.getWorkExternalIdentifierType())) {
subjectExtId.setType(subjectExternalIdentifier.getWorkExternalIdentifierType().getValue());
}
peerReview.setSubjectExternalIdentifier(subjectExtId);
}
// Subject container name
if (!PojoUtil.isEmpty(subjectContainerName)) {
Title containerName = new Title(subjectContainerName.getValue());
peerReview.setSubjectContainerName(containerName);
}
// Subject type
if (!PojoUtil.isEmpty(subjectType)) {
peerReview.setSubjectType(WorkType.fromValue(subjectType.getValue()));
}
// Subject name and subject translated name
if (!PojoUtil.isEmpty(subjectName) || !PojoUtil.isEmpty(translatedSubjectName)) {
WorkTitle workTitle = new WorkTitle();
if (!PojoUtil.isEmpty(subjectName)) {
workTitle.setTitle(new Title(subjectName.getValue()));
}
if (translatedSubjectName != null) {
org.orcid.jaxb.model.common_v2.TranslatedTitle tTitle = new org.orcid.jaxb.model.common_v2.TranslatedTitle();
if (!PojoUtil.isEmpty(translatedSubjectName.getContent())) {
tTitle.setContent(translatedSubjectName.getContent());
}
if (!PojoUtil.isEmpty(translatedSubjectName.getLanguageCode())) {
tTitle.setLanguageCode(translatedSubjectName.getLanguageCode());
}
workTitle.setTranslatedTitle(tTitle);
}
peerReview.setSubjectName(workTitle);
}
//Subject url
if (!PojoUtil.isEmpty(subjectUrl)) {
peerReview.setSubjectUrl(new Url(subjectUrl.getValue()));
}
return peerReview;
}
Aggregations