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

x33g5p2x  于2022-02-05 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(104)

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

YElement.setContributors介绍

暂无

代码示例

代码示例来源: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.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);
}

相关文章