gpt4 book ai didi

pl.edu.icm.model.bwmeta.y.YContributor.addAttribute()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 07:36:40 27 4
gpt4 key购买 nike

本文整理了Java中pl.edu.icm.model.bwmeta.y.YContributor.addAttribute()方法的一些代码示例,展示了YContributor.addAttribute()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YContributor.addAttribute()方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YContributor
类名称:YContributor
方法名:addAttribute

YContributor.addAttribute介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

public ArticleBuilder setAuthors(Map<Integer, PersonInfoViewObject> personsMap) {
  List<YContributor> contributors = new ArrayList<>();
  for (Map.Entry<Integer, PersonInfoViewObject> entry : personsMap.entrySet()) {
    PersonInfoViewObject personViewObject = entry.getValue();
    YContributor author = new YContributor(YConstants.CR_AUTHOR, false);
    author.setNames(extractPersonYNames(personViewObject));
    final List<String> affiliationNames = personViewObject.getAffiliations();
    Boolean isCorrespondingAuthor = personViewObject.getCorrespondingAuthor();
    boolean addCorrespondenceAff = isCorrespondingAuthor != null ? isCorrespondingAuthor : false;
    if (CollectionUtils.isNotEmpty(affiliationNames)) {
      for (String affiliationName : affiliationNames) {
        if (StringUtils.isNotBlank(affiliationName)) {
          final String affiliationId = UUID.randomUUID().toString();
          YAffiliation affiliation = new YAffiliation(affiliationId, affiliationName);
          author.addAffiliationRef(affiliationId);
          article.addAffiliation(affiliation);
          if (addCorrespondenceAff) {
            author.addAttribute(CommonAttributeTypes.AT_CORRESPONDENCE, affiliationName);
            addCorrespondenceAff = false;
          }
        }
      }
    }
    author.addAttribute(extractEmailAttributes(personViewObject));
    contributors.add(author);
  }
  article.setContributors(contributors);
  return this;
}

代码示例来源:origin: pl.edu.icm.synat/synat-process-common

contributor.addAttribute(CommonAttributeTypes.AT_CONTACT_EMAIL, newEmail);
modify = true;

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

if (fingerprint.length() > 1) { // e.g. "-" is filtered
  YAttribute attribute = new YAttribute(YConstants.AT_ZBL_AUTHOR_FINGERPRINT, fingerprint);
  ycontributor.addAttribute(attribute);
  updated = true;

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

@Override
  public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
    PublisherInfo pi = pm.getPublisherInfo();
    if (pi != null) {
      String nam = pi.getPublisherName() != null ? pi.getPublisherName().getvalue() : null;
      if (StringUtils.isNotBlank(nam)) {
        YContributor cont = new YContributor(ContributorRoles.CR_PUBLISHER, true);
        cont.addName(new YName(nam));
        PublisherLoc location = pi.getPublisherLoc();
        if (location != null) {
          if (StringUtils.isNotBlank(location.getvalue())) {
            cont.addAttribute(CommonAttributeTypes.AT_ADDRESS_STREET, location.getvalue());
          }
        }
        element.addContributor(cont);
      }
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

public void convertContributors(BibEntry source, YElement yElement) {
  List<YContributor> yContributors = new ArrayList();
  //authors
  List<YContributor> yAuthors = parseBibEntryPersons(source.getAllFieldValues(BibEntry.FIELD_AUTHOR), YConstants.CR_AUTHOR);
  //editors
  List<YContributor> yEditors = parseBibEntryPersons(source.getAllFieldValues(BibEntry.FIELD_EDITOR), YConstants.CR_EDITOR);
  yContributors.addAll(yAuthors);
  yContributors.addAll(yEditors);
  //publisher
  if (source.getFirstFieldValue(BibEntry.FIELD_ADDRESS) != null
      && source.getFirstFieldValue(BibEntry.FIELD_PUBLISHER) != null) {
    String publisher = source.getFirstFieldValue(BibEntry.FIELD_PUBLISHER);
    String address = source.getFirstFieldValue(BibEntry.FIELD_ADDRESS);
    YContributor yPublisher = new YContributor();
    yPublisher.setRole(YConstants.CR_PUBLISHER);
    yPublisher.addName(new YName().setType(YConstants.NM_CANONICAL).setText(publisher));
    yPublisher.addAttribute(YConstants.AT_ADDRESS_CITY, address);
    yContributors.add(yPublisher);
  }
  yElement.setContributors(yContributors);
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

public void updateElementPublisher(org.jdom.Element jmeta, YElement journal) {
  YName pname = y.canonicalName(YLanguage.Undetermined,
      JDOMHelper.getTextTrim(JDOMHelper.optDescendant(jmeta, "publisher", "publisher-name")));
  String loc = JDOMHelper.getTextTrim(JDOMHelper.optDescendant(jmeta, "publisher", "publisher-loc"));
  journal.addContributor(new YContributor(ContributorRoles.CR_PUBLISHER, true).addName(pname).addAttribute(NlmToYConstants.AT_PUBLISHER_LOCATION, loc));
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

.addName(y.name(YLanguage.NoLinguisticContent, surname, NameTypes.NM_SURNAME))
           .addName(y.name(YLanguage.NoLinguisticContent, forenames, NameTypes.NM_FORENAMES))
           .addAttribute(CommonAttributeTypes.AT_CONTACT_EMAIL, JDOMHelper.toNull(JDOMHelper.getTextTrim(JDOMHelper.optDescendant(c, "email"))))
           .addAffiliationRef(aref);
for (String a:aRefs){
           .addName(y.name(YLanguage.NoLinguisticContent, surname, NameTypes.NM_SURNAME))
           .addName(y.name(YLanguage.NoLinguisticContent, forenames, NameTypes.NM_FORENAMES))
           .addAttribute(CommonAttributeTypes.AT_CONTACT_EMAIL, JDOMHelper.toNull(JDOMHelper.getTextTrim(JDOMHelper.optDescendant(c, "email"))))
           .addAffiliationRef(aref);
for (String a:aRefs){

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

nc.addAttribute(a);

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

nc.addAttribute(a);

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

cont.addAttribute(CommonAttributeTypes.AT_CONTACT_EMAIL, toNull(getTextTrim(optDescendant(c, "email")))).addAffiliationRef(aref)).addAffiliation(y.affiliation(aref, address));
} else {
  YContributor cont= new YContributor(ContributorRoles.CR_OTHER, false).addName(y.canonicalName(YLanguage.NoLinguisticContent, (defName).trim()));
      cont.addAttribute(CommonAttributeTypes.AT_CONTACT_EMAIL, toNull(getTextTrim(optDescendant(c, "email")))).addAffiliationRef(aref)).addAffiliation(y.affiliation(aref, address));

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

&& sname.equals(zblc.getOneName("surname").getText())) {
for (YAttribute a : zblc.getAttributes(YConstants.AT_ZBL_AUTHOR_FINGERPRINT)) {
  nc.addAttribute(a);

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

if (contributorRoles.contains(ctValue)) {
  article.addContributor(
      new YContributor(ctValue, false).addName(y.canonicalName(YLanguage.NoLinguisticContent, canonicalName)).addName(y.name(YLanguage.NoLinguisticContent, surname, NM_SURNAME)).addName(y.name(YLanguage.NoLinguisticContent, forenames, NM_FORENAMES)).addAttribute(AT_CONTACT_EMAIL, toNull(getTextTrim(optDescendant(c, "email")))).addAffiliationRef(aref)).addAffiliation(y.affiliation(aref, address));
} else {
  article.addContributor(
      new YContributor(YConstants.CR_OTHER, false).addName(y.canonicalName(YLanguage.NoLinguisticContent, canonicalName)).addName(y.name(YLanguage.NoLinguisticContent, surname, NM_SURNAME)).addName(y.name(YLanguage.NoLinguisticContent, forenames, NM_FORENAMES)).addAttribute(AT_CONTACT_EMAIL, toNull(getTextTrim(optDescendant(c, "email")))).addAffiliationRef(aref)).addAffiliation(y.affiliation(aref, address));

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

private static void buildPersonContributor(YContributor cont, Object name) {
  PersonName pn = (PersonName) name;
  for (Object o : pn.getGivenNamesOrFamilyNamePrefixOrFamilyName()) {
    if (o instanceof GivenNames) {
      YName nam = new YName();
      nam.setType(NameTypes.NM_FORENAMES);
      nam.setText(((GivenNames) o).getvalue());
      cont.addName(nam);
    } else if (o instanceof FamilyName) {
      YName nam = new YName();
      nam.setType(NameTypes.NM_SURNAME);
      nam.setText(((FamilyName) o).getvalue());
      cont.addName(nam);
    } else if (o instanceof FamilyNamePrefix) {
      cont.addAttribute(WileyComponentConstants.WILEY_ATT_FAMILY_NAME_PREFIX, ((FamilyNamePrefix) o).getvalue().trim());
    }
  }
  if (pn.getNameSuffix() != null) {
    YName nam = new YName();
    nam.setType(NameTypes.NM_SUFFIX);
    nam.setText(pn.getNameSuffix().getvalue());
    cont.addName(nam);
  }
  cont.setInstitution(false);
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com