use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class ContributorUtilsTest method getWorkContributorWithoutOrcid.
private WorkContributors getWorkContributorWithoutOrcid() {
Contributor contributor = new Contributor();
contributor.setContributorEmail(new ContributorEmail("never@show.this"));
contributor.setCreditName(new CreditName("original credit name"));
return new WorkContributors(Arrays.asList(contributor));
}
use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class ActivityUtilsTest method getEmptyWork.
private Work getEmptyWork() {
Work w = new Work();
// Title
WorkTitle title = new WorkTitle();
title.setTitle(new Title(""));
title.setSubtitle(new Subtitle(""));
title.setTranslatedTitle(new TranslatedTitle(""));
w.setWorkTitle(title);
// Citation
w.setWorkCitation(new Citation());
WorkContributors wc = new WorkContributors();
// Contributors
Contributor c = new Contributor();
c.setCreditName(new CreditName(""));
wc.getContributor().add(c);
w.setWorkContributors(wc);
return w;
}
use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class Contributor method toFundingContributor.
public FundingContributor toFundingContributor() {
FundingContributor c = new FundingContributor();
if (this.getContributorRole() != null || this.getContributorSequence() != null) {
FundingContributorAttributes ca = new FundingContributorAttributes();
if (!PojoUtil.isEmpty(this.getContributorRole()))
ca.setContributorRole(FundingContributorRole.fromValue(this.getContributorRole().getValue()));
c.setContributorAttributes(ca);
}
if (this.getEmail() != null)
c.setContributorEmail(new ContributorEmail(this.getEmail().getValue()));
if (this.getOrcid() != null) {
ContributorOrcid contributorOrcid = new ContributorOrcid(this.getOrcid().getValue());
if (this.getUri() != null) {
String uriString = this.getUri().getValue();
if (StringUtils.isNotBlank(uriString)) {
try {
URI uri = new URI(uriString);
contributorOrcid.setHost(uri.getHost());
} catch (URISyntaxException e) {
throw new RuntimeException("Problem parsing contributor orcid uri", e);
}
}
}
contributorOrcid.setUri(this.getUri().getValue());
c.setContributorOrcid(contributorOrcid);
}
if (this.getCreditName() != null) {
CreditName cn = new CreditName(this.getCreditName().getValue());
c.setCreditName(cn);
}
return c;
}
use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class Contributor method valueOf.
public static Contributor valueOf(org.orcid.jaxb.model.v3.dev1.common.Contributor contributor) {
Contributor c = new Contributor();
if (contributor != null) {
if (contributor.getContributorAttributes() != null) {
contributor.getContributorAttributes();
if (contributor.getContributorAttributes().getContributorRole() != null)
c.setContributorRole(Text.valueOf(contributor.getContributorAttributes().getContributorRole().value()));
if (contributor.getContributorAttributes().getContributorSequence() != null)
c.setContributorSequence(Text.valueOf(contributor.getContributorAttributes().getContributorSequence().value()));
}
if (contributor.getContributorOrcid() != null) {
c.setOrcid(Text.valueOf(contributor.getContributorOrcid().getPath()));
c.setUri(Text.valueOf(contributor.getContributorOrcid().getUri()));
}
// Set default values that must be overwritten by the controller
if (contributor.getCreditName() != null) {
c.setCreditName(Text.valueOf(contributor.getCreditName().getContent()));
}
}
return c;
}
use of org.orcid.jaxb.model.v3.dev1.common.Contributor in project ORCID-Source by ORCID.
the class Contributor method valueOf.
@Deprecated
public static Contributor valueOf(org.orcid.jaxb.model.message.FundingContributor contributor) {
Contributor c = new Contributor();
if (contributor != null) {
if (contributor.getContributorAttributes() != null) {
contributor.getContributorAttributes();
if (contributor.getContributorAttributes().getContributorRole() != null)
c.setContributorRole(Text.valueOf(contributor.getContributorAttributes().getContributorRole().value()));
}
if (contributor.getContributorEmail() != null)
c.setEmail(Text.valueOf(contributor.getContributorEmail().getValue()));
if (contributor.getContributorOrcid() != null) {
c.setOrcid(Text.valueOf(contributor.getContributorOrcid().getPath()));
c.setUri(Text.valueOf(contributor.getContributorOrcid().getUri()));
}
if (contributor.getCreditName() != null) {
c.setCreditName(Text.valueOf(contributor.getCreditName().getContent()));
}
}
return c;
}
Aggregations