private CONTRIBUTOR_TYPE detectContributorType(final YContributor cont) { CONTRIBUTOR_TYPE type = CONTRIBUTOR_TYPE.UNKNOWN; if (cont.isPerson()) { type = CONTRIBUTOR_TYPE.PERSON; } else if (cont.isInstitution()) { type = CONTRIBUTOR_TYPE.INSTITUTION; } return type; }
private static CONTRIBUTOR_TYPE detectContributorType(final YContributor cont) { CONTRIBUTOR_TYPE type = CONTRIBUTOR_TYPE.UNKNOWN; if (cont.isPerson()) { type = CONTRIBUTOR_TYPE.PERSON; } else if (cont.isInstitution()) { type = CONTRIBUTOR_TYPE.INSTITUTION; } return type; }
public List<PersonInfo> getPersonsInfo(AbstractElementInfo<?> abstractElementInfo, String personRole) { List<PersonInfo> persons = new ArrayList<>(); for (YContributor contributor : abstractElementInfo.getContributors()) { if (personRole.equals(contributor.getRole()) && contributor.isPerson()) { Set<String> affiliationNames = affiliationExtractor.getAffiliationNamesFor(contributor, abstractElementInfo); PersonInfo personInfo = transformToPersonInfo(contributor, affiliationNames); persons.add(personInfo); } } return persons; }
if (contributor.isPerson()) { String contributorName = YModelUtils.getDefaultContributor(contributor); StringBuilder affiliationList = new StringBuilder();
private static void appendContributor(YContributor c, StringBuilder au) { if (!c.isPerson()) { //not person return; } if (!c.getRole().equals(YConstants.CR_AUTHOR) && !c.getRole().equals("person")) { //not an author return; } List<YName> names = c.getNames(); List<YName> forenames = filterNamesOfType(names, YConstants.NM_FORENAMES); List<YName> surenames = filterNamesOfType(names, YConstants.NM_SURNAME); String bestForenames = YElementsParsingToolbox.selectBestName(forenames); String bestSurename = YElementsParsingToolbox.selectBestName(surenames); if (bestSurename == null && bestForenames == null) { return; } au.append(bestSurename==null?"-":bestSurename); au.append(YElementToZentralBlattConverter.SUGGESTED_MULTIVALUE_FIELD_SEPARATOR2); au.append(bestForenames==null?"-":bestForenames); au.append(YElementToZentralBlattConverter.SUGGESTED_MULTIVALUE_FIELD_SEPARATOR); }
id = identity; } else { id = (contributor.isPerson()) ? BwmetaContributorUtils.buildContributorId(documentId, contributor) : null; personPortalRole = PersonPortalRole.PERSON;