use of org.orcid.pojo.GivenNames in project ORCID-Source by ORCID.
the class OrcidJaxbCopyManagerTest method getBio.
private OrcidBio getBio(String sufix, Visibility visibility, int max) {
OrcidBio orcidBio = new OrcidBio();
Biography bio = new Biography(sufix + "My Biography", visibility);
orcidBio.setBiography(bio);
ContactDetails contactDetails = new ContactDetails();
Address address = new Address();
Country country = new Country(visibility.equals(Visibility.PRIVATE) ? Iso3166Country.US : Iso3166Country.CR);
country.setVisibility(visibility);
address.setCountry(country);
contactDetails.setAddress(address);
List<Email> emails = new ArrayList<Email>();
for (int i = 0; i < max; i++) {
Email email = new Email();
email.setValue(sufix + "Email" + i);
if (i == 0) {
email.setPrimary(true);
}
email.setVisibility(visibility);
emails.add(email);
}
contactDetails.setEmail(emails);
orcidBio.setContactDetails(contactDetails);
ExternalIdentifiers extIds = new ExternalIdentifiers();
extIds.setVisibility(visibility);
for (int i = 0; i < max; i++) {
ExternalIdentifier extId = new ExternalIdentifier();
extId.setExternalIdCommonName(new ExternalIdCommonName(sufix + "CommonName" + i));
extId.setExternalIdReference(new ExternalIdReference(sufix + "Reference" + i));
extIds.getExternalIdentifier().add(extId);
}
orcidBio.setExternalIdentifiers(extIds);
Keywords keywords = new Keywords();
keywords.setVisibility(visibility);
for (int i = 0; i < max; i++) {
Keyword k = new Keyword();
k.setContent(sufix + "Keyword" + i);
keywords.getKeyword().add(k);
}
orcidBio.setKeywords(keywords);
PersonalDetails personalDetails = new PersonalDetails();
CreditName creditName = new CreditName(sufix + "Credit name");
creditName.setVisibility(visibility);
personalDetails.setCreditName(creditName);
FamilyName familyName = new FamilyName(sufix + "Family");
personalDetails.setFamilyName(familyName);
GivenNames givenNames = new GivenNames();
givenNames.setContent(sufix + "Given");
personalDetails.setGivenNames(givenNames);
OtherNames other = new OtherNames();
other.setVisibility(visibility);
for (int i = 0; i < max; i++) {
other.addOtherName(sufix + "Other" + i, null);
}
personalDetails.setOtherNames(other);
orcidBio.setPersonalDetails(personalDetails);
ResearcherUrls researcherUrls = new ResearcherUrls();
researcherUrls.setVisibility(visibility);
for (int i = 0; i < max; i++) {
ResearcherUrl rUrl = new ResearcherUrl();
rUrl.setUrl(new Url("http://www.rurl.com/" + sufix + "/" + i));
rUrl.setUrlName(new UrlName(sufix + "Url" + i));
researcherUrls.getResearcherUrl().add(rUrl);
}
orcidBio.setResearcherUrls(researcherUrls);
return orcidBio;
}
Aggregations