gpt4 book ai didi

pl.edu.icm.model.bwmeta.YContributor类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 13:08:15 30 4
gpt4 key购买 nike

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

YContributor介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.synat/synat-content-impl

private boolean isYElementPutable(final YElement yElement) {
  final List<YContributor> authorNodeList = yElement.getContributors();
  for (int i = 0; i < authorNodeList.size(); i++) {
    final YContributor currentNode = authorNodeList.get(i);
    if (currentNode != null && currentNode.isPerson() && AUTHOR.equals(currentNode.getRole())) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

private YContributor toYModel(Contributor contributor) {
  YContributor result = new YContributor();
  
  result.setRole(CR_AUTHOR);
  result.addName( name(NM_FORENAMES, contributor.getFirstName()) );
  result.addName( name(NM_SURNAME, contributor.getLastName()) );
  
  for (Integer index : contributor.getAffiliationIndices()) {
    result.addAffiliationRef(toYAffiliationReference(index));
  }
  
  return result;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

private boolean hasAttribute(YContributor yContrib, String attrType) {
  return StringUtils.isNotEmpty( yContrib.getOneAttributeSimpleValue(attrType));
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

private void fixContributor(YContributor contributor) {
  // if firstnames is empty, try to read from custom attribute
  if (! hasName(contributor,NM_FORENAMES) && hasAttribute(contributor, CUSTOM_ATTR_F_NAME)) {             
    contributor.addName(name(contributor.getOneAttributeSimpleValue(CUSTOM_ATTR_F_NAME), NM_FORENAMES));
  }
  
  // if surname is empty, try to read from custom attribute
  if (!hasName(contributor,NM_SURNAME)) {
    String surname = "";
    
    if (hasAttribute(contributor, CUSTOM_ATTR_S_NAME)) {
      surname = contributor.getOneAttributeSimpleValue(CUSTOM_ATTR_S_NAME);
    } else {
      String name = BWMetaUtil.getCanonicalName(contributor);
      if (StringUtils.isNotBlank(name)) {
        surname = name;
      }
    }
    
    contributor.addName(name(surname, NM_SURNAME));
  }
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

Journal convert(YElement yJournal) {
  Preconditions.checkArgument(yJournal.getStructure(EXT_HIERARCHY_JOURNAL)!= null);
  Preconditions.checkArgument(yJournal.getStructure(EXT_HIERARCHY_JOURNAL).getCurrent().getLevel().equals(EXT_LEVEL_JOURNAL_JOURNAL));
  
  Journal result = new Journal(yJournal.getId());
  setTitleAndIssns(yJournal, result);
  result.setPbnId(yJournal.getId(IdSchemes.PBN_ID));
  //publisher
  if (yJournal.getContributors() != null) {
    for (YContributor contrib : yJournal.getContributors()) {
      if (CR_PUBLISHER.equals(contrib.getRole())) {
        result.setPublisherName(BWMetaUtil.getCanonicalName(contrib));
      }
    }
  }
  // approved flag
  String attribute = getAttribute(PciBwmetaConstants.ATTR_APPROVED, yJournal);
  if (StringUtils.isNotEmpty(attribute)) {
    result.setApproved(Boolean.parseBoolean(attribute));
  }
  
  return result;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

YElement toYModel(Journal journal) {
  YElement yElement = super.toYModel(journal, journal.getTitle());
  
  addIdIfNotBlank(yElement, journal.getIssn(), EXT_SCHEME_ISSN);
  addIdIfNotBlank(yElement, journal.getEissn(), EXT_SCHEME_EISSN);
  addIdIfNotBlank(yElement, journal.getPbnId(), IdSchemes.PBN_ID);
  //publisher
  if (StringUtils.isNotBlank(journal.getPublisherName())) {
    YContributor yContributor = new YContributor(CR_PUBLISHER, true);
    
    yContributor.addName(new YName(YLanguage.Undetermined, journal.getPublisherName(), NM_CANONICAL));
    
    yElement.addContributor(yContributor);
  }
  //structure
  YCurrent yCurrent = new YCurrent(EXT_LEVEL_JOURNAL_JOURNAL);
  yElement.getStructure(EXT_HIERARCHY_JOURNAL).setCurrent(yCurrent);
  //approved flag
  addAttributeIfTrue(yElement, PciBwmetaConstants.ATTR_APPROVED, journal.isApproved());
  
  return yElement;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

private boolean hasName(YContributor yContrib, String nameType) {
  return (yContrib.getOneName(nameType) != null &&
      StringUtils.isNotEmpty(yContrib.getOneName(nameType).getText())); 
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

private List<YContributor> getContributors(YElement element) {
  List<YContributor> result = Lists.newArrayList();
  
  if (element.getContributors() != null) {
    for (YContributor contributor : element.getContributors()) {
      if (contributor.isInstitution()) {
        continue;
      }
      
      result.add(contributor);
    }
  }
  
  return result;
}

代码示例来源:origin: pl.edu.icm.polindex/polindex-core

private void convert(YContributor contributor, Article article, InstitutionBuilder builder) {
  Preconditions.checkArgument(contributor != null);
  
  String firstName = getName(contributor, NM_FORENAMES);
  String lastName = getName(contributor, NM_SURNAME);
  
  if (StringUtils.isBlank(firstName) && StringUtils.isBlank(lastName)) {
    logger.warn("Contributor without first and last name (article id: " + article.getId() + ")");
  }
  
  Contributor converted = new Contributor(firstName, lastName);
  
  if (contributor.getAffiliationRefs() != null) {
    for (String ref : contributor.getAffiliationRefs()) {
      builder.addAffiliationReference(ref, converted);
    }
  }
  
  article.addContributor(converted);
}

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