private static String legacyPersonAttribute(final YContributor contributor, final String legacyAttribute) { final AbstractA<?> person = contributor.getOneAttribute(AT_CONTRIBUTOR_PERSON); String result = attributeValue(person, legacyAttribute); // ContributorUtil does it but standard transformers do not // this is problem - e.g. a lot of psjd articles have legacy attribute // directly // under contributor, not under person attribute of contributor if (StringUtils.isEmpty(result)) { result = attributeValue(contributor, legacyAttribute); } return StringUtils.defaultString(result); }
private String getContributorFirstName(final YContributor cont) { if (cont.getOneName(YConstants.NM_FORENAMES) != null) { return cont.getOneName(YConstants.NM_FORENAMES).getText(); } final YAttribute person = cont.getOneAttribute(YConstants.AT_CONTRIBUTOR_PERSON); if (person != null) { return person.getOneAttributeSimpleValue(YConstants.AT_CONTRIBUTOR_PERSON_FIRSTNAME); } else { return cont.getOneAttributeSimpleValue(YConstants.AT_CONTRIBUTOR_PERSON_FIRSTNAME); } }
private String getContributorLastName(final YContributor cont) { if (cont.getOneName(YConstants.NM_SURNAME) != null) { return cont.getOneName(YConstants.NM_SURNAME).getText(); } final YAttribute person = cont.getOneAttribute(YConstants.AT_CONTRIBUTOR_PERSON); if (person != null) { return person.getOneAttributeSimpleValue(YConstants.AT_CONTRIBUTOR_PERSON_LASTNAME); } else { return cont.getOneAttributeSimpleValue(YConstants.AT_CONTRIBUTOR_PERSON_LASTNAME); } }
protected List<String> resolveAddresses(final YContributor contributor, final IFilteringContext filteringContext) { final List<String> addresses = new LinkedList<String>(); if (contributor.isInstitution()) { final YAttribute institution = contributor.getOneAttribute(YConstants.AT_INSTITUTION); if (institution != null) { for (final YAttribute address : institution.getAttributes(YConstants.AT_INSTITUTION_ADDRESS)) { addresses.add(detailsFilter.filter(address.getValue(), InputType.RICH_TEXT, filteringContext)); } } } return addresses; }
/** * Creates PublisherData using YElement * * @param yElement * metadata element used to create object */ public PublisherData createPublisherData(YContributor contributor) { PublisherData pd = new PublisherData(); populateBaseProperties(contributor, pd); if (contributor.getOneAttribute(CommonAttributeTypes.AT_CONTACT_URL) != null) { pd.setUrl(contributor.getOneAttribute(CommonAttributeTypes.AT_CONTACT_URL).getValue()); } final String email = contributor.getOneAttributeSimpleValue(CommonAttributeTypes.AT_CONTACT_EMAIL); if (StringUtils.isNotBlank(email)) { pd.setEmail(email); } return pd; }
bibEntry.setField(BibEntry.FIELD_PUBLISHER, yPublisherList.get(0).getOneName(YConstants.NM_CANONICAL).getText()); if (yPublisherList.get(0).getOneAttribute(YConstants.AT_ADDRESS_CITY) != null) { String address = yPublisherList.get(0).getOneAttribute(YConstants.AT_ADDRESS_CITY).getValue(); bibEntry.setField(BibEntry.FIELD_ADDRESS, address);
public EditorialOfficeInfo getEditorialOfficeInfo(AbstractElementInfo<?> abstractElementInfo) { List<YContributor> contributors = abstractElementInfo.getContributors(); if (contributors != null) { for (YContributor contributor : contributors) { if (contributor.isInstitution() && ContributorConstants.ROLE_EDITORIAL_OFFICE.equals(contributor.getRole())) { YAttribute institution = contributor.getOneAttribute(YConstants.AT_INSTITUTION); if (institution != null) { String email = elementAttributesExtractor.getInstitutionEmail(institution); String www = elementAttributesExtractor.getInstitutionWWW(institution); return new EditorialOfficeInfo(email, www); } } } } return null; }
String foreNames = YModelUtils.getNameByType(cont, NameTypes.NM_FORENAMES); canonical.add(foreNames); YAttribute fmPrefix = cont.getOneAttribute(WileyComponentConstants.WILEY_ATT_FAMILY_NAME_PREFIX); if (fmPrefix != null) { canonical.add(fmPrefix.getValue());