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); } }
@SuppressWarnings("deprecation") public static void updateYRelationWithZblContributor(YRelation relye, YContributor c) { YAttribute ya = null; if (c.getOneName("canonical") != null) ya = new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR, c.getOneName("canonical").getText().toString()); if (c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).size() > 0) ya.addAttribute(YConstants.AT_ZBL_AUTHOR_FINGERPRINT, c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT) .get(0).getValue()); if (c.getOneName("forenames") != null) ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES, c.getOneName("forenames").getText() .toString()); ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME, c.getOneName("surname").getText().toString()); relye.addAttribute(ya); }
private String prepareTitle(YContributor yContr, ContributorInfo contrInfo) { String title = ""; if (doHighlight) { // values in index go through ContribInfoBuilder formatting // highlighted expected only when value from index equals value from // catalog YName highlightName = yContr.getOneName(HighlightUtils.Y_TYPE_HIGHLIGHTED); if (highlightName != null) { title = highlightName.getText(); } } if (title.length() == 0) { // get value from catalog formatted by ContribInfoBuilder title = contrInfo.getText(); } if ("_".equals(title)) { title = ""; } return title; }
public static List<PersonData> resolveElementContributors(YElement element, String type) { List<PersonData> people = new ArrayList<PersonData>(); Map<String, FilteredString> affiliations = processAffiliations(element); for (YContributor contributor : element.getContributors()) { if (type.equals(contributor.getRole()) && contributor.getOneName() != null) { people.add(parseContributor(contributor, element.getId(), affiliations)); } } return people; }
if (yContributor.getOneName(YConstants.NM_SURNAME) != null) { isSurname = true; fullName.append(yContributor.getOneName(YConstants.NM_SURNAME).getText()); if (yContributor.getOneName(YConstants.NM_FORENAMES) != null) { isForename = true; String forenames = yContributor.getOneName(YConstants.NM_FORENAMES).getText(); String[] forenameList = forenames.split(" "); if (forenameList.length > 0) { if (yContributor.getOneName(YConstants.NM_SUFFIX) != null) { if (isSurname || isForename) { fullName.append(", "); String suffix = yContributor.getOneName(YConstants.NM_SUFFIX).getText(); fullName.append(suffix);
public static List<PersonData> resolveAllElementContributors(YElement element) { List<PersonData> people = new ArrayList<PersonData>(); Map<String, FilteredString> affiliations = processAffiliations(element); for (YContributor contributor : element.getContributors()) { if (!ContributorRoles.CR_PUBLISHER.equals(contributor.getRole()) && contributor.getOneName() != null) { people.add(parseContributor(contributor, element.getId(), affiliations)); } } return people; }
private static void replaceAthorsCoauthorsField(final YElement yElement, final String[] values) { for (final String value : values) { if (value != null && value.length() > 0) { final String rawValue = unhighlight(value); for (final YContributor cont : yElement.getContributors()) { final YName name = cont.getOneName(); if (name != null && (rawValue.equals(name.getText()))) { final YName hlName = new YName(value); hlName.setType(Y_TYPE_HIGHLIGHTED); cont.getNames().add(hlName); } } } } }
public void updateArticleInBookWithBookMeta(Element bmeta, final YElement article) { YDate date = article.getDate(DateTypes.DT_PUBLISHED); if (date == null) { updater.updateElementPubdate(bmeta, article); } boolean noPublisher = true; List<YContributor> yContributorList = article.getContributors(); List<YContributor> yPublisherList = new ArrayList<YContributor>(); for (YContributor yContributor : yContributorList) { if (yContributor.getRole().equals(ContributorRoles.CR_PUBLISHER)) { yPublisherList.add(yContributor); } } if (!yPublisherList.isEmpty()) { String publisher = yPublisherList.get(0).getOneName(NameTypes.NM_CANONICAL).getText(); String location = yPublisherList.get(0).getOneAttributeSimpleValue(NlmToYConstants.AT_PUBLISHER_LOCATION); if (publisher != null && location != null) { noPublisher = false; } } if (noPublisher) { updater.updateElementPublisher(bmeta, article); } }
requestedUserId = userProfile.getId(); } catch (UserNotFoundException e) { YName yForeName = contributor.getOneName(NameTypes.NM_FORENAMES); String foreName = StringUtils.EMPTY; String surname = StringUtils.EMPTY; foreName = yForeName.getText(); } else { yForeName = contributor.getOneName(NameTypes.NM_FORENAME); foreName = yForeName == null ? name : yForeName.getText(); YName ySurname = contributor.getOneName(NameTypes.NM_SURNAME); if (ySurname != null) { surname = ySurname.getText();
bibEntry.setField(BibEntry.FIELD_PUBLISHER, yPublisherList.get(0).getOneName(YConstants.NM_CANONICAL).getText());
public ContributorInfo prepareContributorInfo(final YContributor cont, final boolean flatten) { final YName forenames = cont.getOneName(YConstants.NM_FORENAMES); final YName surname = cont.getOneName(YConstants.NM_SURNAME); final String firstName = forenames == null ? null : toText(forenames.getRichText(), flatten); final String lastName = surname == null ? null : toText(surname.getRichText(), flatten); final String text = cont.getDefaultName() == null ? null : toText(cont.getDefaultName().getRichText(), flatten); final String role = cont.getRole(); final CONTRIBUTOR_TYPE type = detectContributorType(cont); return prepareContributorInfo(firstName, lastName, text, role, type); }
if(sname!=null && zblc.getOneName("surname")!=null && sname.equals(zblc.getOneName("surname").getText())){ if(zblc.getOneName("forenames").getText().split(" ").length >fname.split(" ").length){ fname = zblc.getOneName("forenames").getText(); YName fn = new YName(fname); fn.setType("forenames");
if(sname!=null && zblc.getOneName("surname")!=null && sname.equals(zblc.getOneName("surname").getText())){ if(zblc.getOneName("forenames").getText().split(" ").length >fname.split(" ").length){ fname = zblc.getOneName("forenames").getText(); YName fn = new YName(fname); fn.setType("forenames");
if (sname != null && zblc.getOneName("surname") != null && sname.equals(zblc.getOneName("surname").getText())) { for (YAttribute a : zblc.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT)) { nc.addAttribute(a);
if(c.getOneName("canonical")!=null) ya = new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR,c.getOneName("canonical").getText().toString()); if(c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).size()>0) ya.addAttribute(YConstants.AT_ZBL_AUTHOR_FINGERPRINT , c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).get(0).getValue()); if(c.getOneName("forenames")!=null) ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES , c.getOneName("forenames").getText().toString() ); ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME , c.getOneName("surname").getText().toString() ); relye.addAttribute(ya);
if(c.getOneName("canonical")!=null) ya = new YAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR,c.getOneName("canonical").getText().toString()); if(c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).size()>0) ya.addAttribute(YConstants.AT_ZBL_AUTHOR_FINGERPRINT , c.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT).get(0).getValue()); if(c.getOneName("forenames")!=null) ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_FORENAMES , c.getOneName("forenames").getText().toString() ); ya.addAttribute(YConstants.AT_REFERENCE_PARSED_AUTHOR_SURNAME , c.getOneName("surname").getText().toString() ); relye.addAttribute(ya);
final List<YContributor> yContributors = yElement.getContributors(); for (final YContributor yContributor : yContributors) { final YName surname = yContributor.getOneName(YConstants.NM_SURNAME); final YName givennames = yContributor.getOneName(YConstants.NM_FORENAMES);
List<YContributor> yContributors = yElement.getContributors(); for (YContributor yContributor : yContributors) { YName surname = yContributor.getOneName(YConstants.NM_SURNAME); YName givennames = yContributor.getOneName(YConstants.NM_FORENAMES);