use of org.orcid.jaxb.model.record_v2.PersonalDetails in project ORCID-Source by ORCID.
the class PersonalDetailsManagerReadOnlyImpl method getPersonalDetails.
@Override
public PersonalDetails getPersonalDetails(String orcid) {
Date lastModified = getLastModifiedDate(orcid);
long lastModifiedTime = lastModified.getTime();
PersonalDetails personalDetails = new PersonalDetails();
Name name = recordNameManager.getRecordName(orcid);
if (name != null) {
personalDetails.setName(name);
}
Biography bio = biographyManager.getBiography(orcid);
if (bio != null) {
personalDetails.setBiography(bio);
}
OtherNames otherNames = otherNameManager.getOtherNames(orcid);
OtherNames filteredOtherNames = new OtherNames();
personalDetails.setOtherNames(filteredOtherNames);
if (otherNames != null && otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) {
// Lets copy the list so we don't modify the cached collection
List<OtherName> filteredList = new ArrayList<OtherName>(otherNames.getOtherNames());
filteredOtherNames.setOtherNames(filteredList);
}
if (personalDetails.getLastModifiedDate() == null || personalDetails.getLastModifiedDate().getValue() == null) {
personalDetails.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(lastModified)));
}
return personalDetails;
}
Aggregations