use of org.orcid.jaxb.model.v3.dev1.record.OtherName 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.OtherName in project ORCID-Source by ORCID.
the class JpaJaxbOtherNameAdapterImpl method toOtherNameList.
@Override
public OtherNames toOtherNameList(Collection<OtherNameEntity> entities) {
if (entities == null) {
return null;
}
List<OtherName> otherNameList = mapperFacade.mapAsList(entities, OtherName.class);
OtherNames otherNames = new OtherNames();
otherNames.setOtherNames(otherNameList);
return otherNames;
}
use of org.orcid.jaxb.model.v3.dev1.record.OtherName in project ORCID-Source by ORCID.
the class JpaJaxbOtherNameAdapterImpl method toMinimizedOtherNameList.
@Override
public OtherNames toMinimizedOtherNameList(Collection<OtherNameEntity> entities) {
if (entities == null) {
return null;
}
List<OtherName> otherNameList = mapperFacade.mapAsList(entities, OtherName.class);
for (OtherName otherName : otherNameList) {
otherName.setCreatedDate(null);
otherName.setSource(null);
}
OtherNames otherNames = new OtherNames();
otherNames.setOtherNames(otherNameList);
return otherNames;
}
use of org.orcid.jaxb.model.v3.dev1.record.OtherName in project ORCID-Source by ORCID.
the class MapperFacadeFactory method getOtherNameMapperFacade.
public MapperFacade getOtherNameMapperFacade() {
MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
ClassMapBuilder<OtherName, OtherNameEntity> otherNameClassMap = mapperFactory.classMap(OtherName.class, OtherNameEntity.class);
addV3DateFields(otherNameClassMap);
registerSourceConverters(mapperFactory, otherNameClassMap);
otherNameClassMap.field("putCode", "id");
otherNameClassMap.field("content", "displayName");
otherNameClassMap.field("path", "profile.orcid");
otherNameClassMap.fieldBToA("displayIndex", "displayIndex");
otherNameClassMap.byDefault();
otherNameClassMap.register();
return mapperFactory.getMapperFacade();
}
use of org.orcid.jaxb.model.v3.dev1.record.OtherName in project ORCID-Source by ORCID.
the class OrcidSecurityManagerTestBase method createOtherName.
protected OtherName createOtherName(Visibility v, String sourceId) {
OtherName otherName = new OtherName();
otherName.setContent("other-name-" + System.currentTimeMillis());
otherName.setVisibility(v);
setSource(otherName, sourceId);
return otherName;
}
Aggregations