use of org.orcid.pojo.DupicateResearcher in project ORCID-Source by ORCID.
the class RegistrationController method getDupicateResearcher.
@RequestMapping(value = "/dupicateResearcher.json", method = RequestMethod.GET)
@ResponseBody
public List<DupicateResearcher> getDupicateResearcher(@RequestParam("givenNames") String givenNames, @RequestParam("familyNames") String familyNames) {
List<DupicateResearcher> drList = new ArrayList<DupicateResearcher>();
List<OrcidProfile> potentialDuplicates = findPotentialDuplicatesByFirstNameLastName(givenNames, familyNames);
for (OrcidProfile op : potentialDuplicates) {
DupicateResearcher dr = new DupicateResearcher();
if (op.getOrcidBio() != null) {
if (op.getOrcidBio().getContactDetails() != null) {
if (op.getOrcidBio().getContactDetails().retrievePrimaryEmail() != null) {
dr.setEmail(op.getOrcidBio().getContactDetails().retrievePrimaryEmail().getValue());
}
}
FamilyName familyName = op.getOrcidBio().getPersonalDetails().getFamilyName();
if (familyName != null) {
dr.setFamilyNames(familyName.getContent());
}
dr.setGivenNames(op.getOrcidBio().getPersonalDetails().getGivenNames().getContent());
dr.setInstitution(null);
}
OrcidIdentifier orcidIdentifier = op.getOrcidIdentifier();
// check for null just in case.
if (orcidIdentifier != null) {
dr.setOrcid(orcidIdentifier.getPath());
}
drList.add(dr);
}
return drList;
}
Aggregations