use of org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl in project ORCID-Source by ORCID.
the class PersonDetailsManagerReadOnlyImpl method getPersonDetails.
@Override
public Person getPersonDetails(String orcid) {
long lastModifiedTime = getLastModified(orcid);
Person person = new Person();
person.setName(recordNameManager.getRecordName(orcid));
person.setBiography(biographyManager.getBiography(orcid));
Addresses addresses = addressManager.getAddresses(orcid);
if (addresses.getAddress() != null) {
Addresses filteredAddresses = new Addresses();
filteredAddresses.setAddress(new ArrayList<Address>(addresses.getAddress()));
person.setAddresses(filteredAddresses);
}
PersonExternalIdentifiers extIds = externalIdentifierManager.getExternalIdentifiers(orcid);
if (extIds.getExternalIdentifiers() != null) {
PersonExternalIdentifiers filteredExtIds = new PersonExternalIdentifiers();
filteredExtIds.setExternalIdentifiers(new ArrayList<PersonExternalIdentifier>(extIds.getExternalIdentifiers()));
person.setExternalIdentifiers(filteredExtIds);
}
Keywords keywords = profileKeywordManager.getKeywords(orcid);
if (keywords.getKeywords() != null) {
Keywords filteredKeywords = new Keywords();
filteredKeywords.setKeywords(new ArrayList<Keyword>(keywords.getKeywords()));
person.setKeywords(filteredKeywords);
}
OtherNames otherNames = otherNameManager.getOtherNames(orcid);
if (otherNames.getOtherNames() != null) {
OtherNames filteredOtherNames = new OtherNames();
filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames()));
person.setOtherNames(filteredOtherNames);
}
ResearcherUrls rUrls = researcherUrlManager.getResearcherUrls(orcid);
if (rUrls.getResearcherUrls() != null) {
ResearcherUrls filteredRUrls = new ResearcherUrls();
filteredRUrls.setResearcherUrls(new ArrayList<ResearcherUrl>(rUrls.getResearcherUrls()));
person.setResearcherUrls(filteredRUrls);
}
Emails emails = emailManager.getEmails(orcid);
if (emails.getEmails() != null) {
Emails filteredEmails = new Emails();
filteredEmails.setEmails(new ArrayList<Email>(emails.getEmails()));
person.setEmails(filteredEmails);
}
return person;
}
use of org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl in project ORCID-Source by ORCID.
the class JpaJaxbResearcherUrlAdapterImpl method toResearcherUrlList.
@Override
public ResearcherUrls toResearcherUrlList(Collection<ResearcherUrlEntity> entities) {
if (entities == null) {
return null;
}
List<ResearcherUrl> researchUrlList = mapperFacade.mapAsList(entities, ResearcherUrl.class);
ResearcherUrls researchUrls = new ResearcherUrls();
researchUrls.setResearcherUrls(researchUrlList);
return researchUrls;
}
use of org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl in project ORCID-Source by ORCID.
the class MapperFacadeFactory method getResearcherUrlMapperFacade.
public MapperFacade getResearcherUrlMapperFacade() {
MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
ClassMapBuilder<ResearcherUrl, ResearcherUrlEntity> researcherUrlClassMap = mapperFactory.classMap(ResearcherUrl.class, ResearcherUrlEntity.class);
addV3DateFields(researcherUrlClassMap);
registerSourceConverters(mapperFactory, researcherUrlClassMap);
researcherUrlClassMap.field("putCode", "id");
researcherUrlClassMap.field("url.value", "url");
researcherUrlClassMap.field("urlName", "urlName");
researcherUrlClassMap.fieldBToA("displayIndex", "displayIndex");
researcherUrlClassMap.byDefault();
researcherUrlClassMap.register();
return mapperFactory.getMapperFacade();
}
use of org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl in project ORCID-Source by ORCID.
the class ResearcherUrlManagerTest method getResearcherUrl.
private ResearcherUrl getResearcherUrl() {
ResearcherUrl rUrl = new ResearcherUrl();
rUrl.setUrl(new Url("http://orcid.org"));
rUrl.setUrlName("ORCID Site");
rUrl.setVisibility(Visibility.PUBLIC);
return rUrl;
}
use of org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl in project ORCID-Source by ORCID.
the class ResearcherUrlManagerTest method testAddResearcherUrlToUnclaimedRecordPreserveResearcherUrlVisibility.
@Test
public void testAddResearcherUrlToUnclaimedRecordPreserveResearcherUrlVisibility() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
ResearcherUrl rUrl = getResearcherUrl();
rUrl = researcherUrlManager.createResearcherUrl(unclaimedOrcid, rUrl, true);
rUrl = researcherUrlManager.getResearcherUrl(unclaimedOrcid, rUrl.getPutCode());
assertNotNull(rUrl);
assertEquals(Visibility.PUBLIC, rUrl.getVisibility());
}
Aggregations