use of org.orcid.jaxb.model.message.OtherName in project ORCID-Source by ORCID.
the class Text method toOtherName.
public OtherName toOtherName() {
OtherName n = new OtherName();
n.setContent(this.value);
return n;
}
use of org.orcid.jaxb.model.message.OtherName in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method orcidProfileLimitedVisiblityCreditNameAndOtherNames.
private OrcidProfile orcidProfileLimitedVisiblityCreditNameAndOtherNames() {
OrcidProfile limitedOrcid = getStandardOrcid();
// hide other names fields
limitedOrcid.getOrcidBio().getPersonalDetails().getGivenNames().setVisibility(Visibility.LIMITED);
limitedOrcid.getOrcidBio().getPersonalDetails().getFamilyName().setVisibility(Visibility.LIMITED);
for (OtherName name : limitedOrcid.getOrcidBio().getPersonalDetails().getOtherNames().getOtherName()) name.setVisibility(Visibility.LIMITED);
limitedOrcid.getOrcidBio().getPersonalDetails().getOtherNames().setVisibility(Visibility.LIMITED);
limitedOrcid.getOrcidBio().getPersonalDetails().getCreditName().setVisibility(Visibility.LIMITED);
limitedOrcid.getOrcidBio().getPersonalDetails().getOtherNames().setVisibility(Visibility.LIMITED);
return limitedOrcid;
}
use of org.orcid.jaxb.model.message.OtherName in project ORCID-Source by ORCID.
the class OrcidIndexManagerImplTest method getStandardOrcid.
private OrcidProfile getStandardOrcid() {
OrcidProfile orcidProfile = new OrcidProfile();
orcidProfile.setOrcidIdentifier("1234");
OrcidBio orcidBio = new OrcidBio();
ContactDetails contactDetails = new ContactDetails();
Email email = new Email("email");
email.setVisibility(Visibility.PUBLIC);
contactDetails.addOrReplacePrimaryEmail(email);
orcidBio.setContactDetails(contactDetails);
Keywords bioKeywords = new Keywords();
bioKeywords.getKeyword().add(new Keyword("Pavement Studies", Visibility.PUBLIC));
bioKeywords.getKeyword().add(new Keyword("Advanced Tea Making", Visibility.PUBLIC));
bioKeywords.setVisibility(Visibility.PUBLIC);
orcidBio.setKeywords(bioKeywords);
PersonalDetails personalDetails = new PersonalDetails();
CreditName creditName = new CreditName("credit name");
creditName.setVisibility(Visibility.PUBLIC);
personalDetails.setCreditName(creditName);
FamilyName familyName = new FamilyName("familyName");
familyName.setVisibility(Visibility.PUBLIC);
personalDetails.setFamilyName(familyName);
OtherNames otherNames = new OtherNames();
otherNames.setVisibility(Visibility.PUBLIC);
otherNames.getOtherName().add(new OtherName("Other 1", Visibility.PUBLIC));
otherNames.getOtherName().add(new OtherName("Other 2", Visibility.PUBLIC));
personalDetails.setOtherNames(otherNames);
GivenNames givenNames = new GivenNames("givenNames");
givenNames.setVisibility(Visibility.PUBLIC);
personalDetails.setGivenNames(givenNames);
orcidBio.setPersonalDetails(personalDetails);
ExternalIdentifiers externalIdentifiers = new ExternalIdentifiers();
externalIdentifiers.setVisibility(Visibility.PUBLIC);
orcidBio.setExternalIdentifiers(externalIdentifiers);
ExternalIdentifier externalIdentifier1 = createExternalIdentifier("45678", "defghi");
externalIdentifiers.getExternalIdentifier().add(externalIdentifier1);
ExternalIdentifier externalIdentifier2 = createExternalIdentifier("54321", "abc123");
externalIdentifiers.getExternalIdentifier().add(externalIdentifier2);
OrcidActivities orcidActivities = new OrcidActivities();
orcidProfile.setOrcidActivities(orcidActivities);
Affiliations affiliations = new Affiliations();
orcidActivities.setAffiliations(affiliations);
FundingList fundings = new FundingList();
orcidActivities.setFundings(fundings);
OrcidWorks orcidWorks = new OrcidWorks();
OrcidWork orcidWork1 = new OrcidWork();
orcidWork1.setVisibility(Visibility.PUBLIC);
OrcidWork orcidWork2 = new OrcidWork();
orcidWork2.setVisibility(Visibility.PUBLIC);
OrcidWork orcidWork3 = new OrcidWork();
orcidWork3.setVisibility(Visibility.LIMITED);
WorkTitle workTitle1 = new WorkTitle();
Title title1 = new Title("Work title 1");
workTitle1.setTitle(title1);
workTitle1.setSubtitle(null);
orcidWork1.setWorkTitle(workTitle1);
WorkExternalIdentifier wei = new WorkExternalIdentifier();
wei.setWorkExternalIdentifierId(new WorkExternalIdentifierId("work1-pmid"));
wei.setWorkExternalIdentifierType(WorkExternalIdentifierType.PMID);
orcidWork1.setWorkExternalIdentifiers(new WorkExternalIdentifiers(Arrays.asList(wei)));
WorkTitle workTitle2 = new WorkTitle();
Title title2 = new Title("Work title 2");
workTitle2.setSubtitle(null);
workTitle2.setTitle(title2);
orcidWork2.setWorkTitle(workTitle2);
WorkTitle workTitle3 = new WorkTitle();
Title title3 = new Title("Work Title 3");
workTitle3.setSubtitle(null);
workTitle3.setTitle(title3);
orcidWork3.setWorkTitle(workTitle3);
orcidWorks.setOrcidWork(new ArrayList<OrcidWork>(Arrays.asList(new OrcidWork[] { orcidWork1, orcidWork2, orcidWork3 })));
orcidProfile.setOrcidWorks(orcidWorks);
orcidProfile.setOrcidBio(orcidBio);
return orcidProfile;
}
use of org.orcid.jaxb.model.message.OtherName in project ORCID-Source by ORCID.
the class OrcidSearchManagerImplTest method getOrcidProfileAllIndexFieldsPopulated.
private OrcidProfile getOrcidProfileAllIndexFieldsPopulated() {
OrcidProfile orcidProfile = new OrcidProfile();
orcidProfile.setOrcidIdentifier("5678");
OrcidBio orcidBio = new OrcidBio();
PersonalDetails personalDetails = new PersonalDetails();
personalDetails.setFamilyName(new FamilyName("Logan"));
personalDetails.setGivenNames(new GivenNames("Donald Edward"));
personalDetails.setCreditName(new CreditName("Stanley Higgins"));
OtherNames otherNames = new OtherNames();
otherNames.getOtherName().add(new OtherName("Edward Bass", null));
otherNames.getOtherName().add(new OtherName("Gareth Dove", null));
personalDetails.setOtherNames(otherNames);
orcidBio.setPersonalDetails(personalDetails);
orcidProfile.setOrcidBio(orcidBio);
OrcidActivities orcidActivities = new OrcidActivities();
orcidProfile.setOrcidActivities(orcidActivities);
Affiliations affiliations = new Affiliations();
orcidActivities.setAffiliations(affiliations);
OrcidWorks orcidWorks = new OrcidWorks();
orcidProfile.setOrcidWorks(orcidWorks);
OrcidWork orcidWork1 = new OrcidWork();
OrcidWork orcidWork2 = new OrcidWork();
assignWorkIdentifers(orcidWork1, orcidWork2);
orcidWorks.getOrcidWork().add(orcidWork1);
orcidWorks.getOrcidWork().add(orcidWork2);
orcidProfile.setOrcidWorks(orcidWorks);
FundingList orcidFundings = new FundingList();
orcidProfile.setFundings(orcidFundings);
Funding funding1 = new Funding();
funding1.setVisibility(Visibility.PUBLIC);
FundingTitle title = new FundingTitle();
title.setTitle(new Title("grant1"));
funding1.setTitle(title);
funding1.setDescription("Grant 1 - a short description");
funding1.setPutCode("grant 1 - put-code");
Funding funding2 = new Funding();
funding2.setVisibility(Visibility.PUBLIC);
FundingTitle title2 = new FundingTitle();
title2.setTitle(new Title("grant2"));
funding2.setTitle(title2);
funding2.setDescription("Grant 2 - a short description");
funding2.setPutCode("grant 2 - put-code");
orcidFundings.getFundings().add(funding1);
orcidFundings.getFundings().add(funding2);
return orcidProfile;
}
use of org.orcid.jaxb.model.message.OtherName in project ORCID-Source by ORCID.
the class OrcidProfileManagerImplTest method setBio.
private void setBio(OrcidProfile profile, Visibility defaultVisibility) {
OrcidBio bio = new OrcidBio();
Biography biography = new Biography("This is my biography");
if (defaultVisibility != null) {
biography.setVisibility(defaultVisibility);
}
bio.setBiography(biography);
ContactDetails contactDetails = new ContactDetails();
Address address = new Address();
address.setCountry(new Country(Iso3166Country.US));
if (defaultVisibility != null) {
address.getCountry().setVisibility(defaultVisibility);
}
contactDetails.setAddress(address);
List<Email> emails = new ArrayList<Email>();
Email email = new Email();
email.setPrimary(true);
email.setValue(System.currentTimeMillis() + "@test.orcid.org");
emails.add(email);
contactDetails.setEmail(emails);
bio.setContactDetails(contactDetails);
ExternalIdentifiers extIds = new ExternalIdentifiers();
ExternalIdentifier extId = new ExternalIdentifier();
extId.setExternalIdCommonName(new ExternalIdCommonName("common-name"));
extId.setExternalIdReference(new ExternalIdReference("ext-id-reference"));
extId.setExternalIdUrl(new ExternalIdUrl("http://orcid.org/ext-id"));
extIds.getExternalIdentifier().add(extId);
if (defaultVisibility != null) {
extIds.setVisibility(defaultVisibility);
}
bio.setExternalIdentifiers(extIds);
Keywords keywords = new Keywords();
Keyword keyword = new Keyword();
keyword.setContent("k1");
keywords.getKeyword().add(keyword);
if (defaultVisibility != null) {
keywords.setVisibility(defaultVisibility);
}
bio.setKeywords(keywords);
PersonalDetails personalDetails = new PersonalDetails();
personalDetails.setCreditName(new CreditName("credit-name"));
personalDetails.setGivenNames(new GivenNames("given-names"));
personalDetails.setFamilyName(new FamilyName("family-name"));
OtherNames otherNames = new OtherNames();
OtherName otherName = new OtherName();
otherName.setContent("o1");
otherNames.getOtherName().add(otherName);
if (defaultVisibility != null) {
otherNames.setVisibility(defaultVisibility);
}
personalDetails.setOtherNames(otherNames);
bio.setPersonalDetails(personalDetails);
ResearcherUrls researcherUrls = new ResearcherUrls();
ResearcherUrl researcherUrl = new ResearcherUrl();
researcherUrl.setUrl(new Url("http://orcid.org/researcher-url-1"));
researcherUrl.setUrlName(new UrlName("url-name-1"));
researcherUrls.getResearcherUrl().add(researcherUrl);
if (defaultVisibility != null) {
researcherUrls.setVisibility(defaultVisibility);
}
bio.setResearcherUrls(researcherUrls);
profile.setOrcidBio(bio);
}
Aggregations