gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-16 06:08:40 26 4
gpt4 key购买 nike

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

YContributor.addAffiliationRef介绍

暂无

代码示例

代码示例来源: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

private static void putAuthor(YElement element, String author, List<String> refs) {
  author = author.replaceAll(" +\\.", ".");
  YName name = new YName().setType(YConstants.NM_CANONICAL).setText(author);
  YContributor contributor = new YContributor().setRole(YConstants.CR_AUTHOR).addName(name);
  for (String ref : refs) {
    if (ref.equals("*") || ref.equals("†")) {
      // Currently nothing is done
    } else {
      String id = Enhancers.affiliationIdFromIndex(ref);
      if (element.getAffiliation(id) != null) {
        contributor.addAffiliationRef(id);
      }
    }
  }
  element.addContributor(contributor);
}

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

.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){
  cont.addAffiliationRef(a);
           .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){
  cont.addAffiliationRef(a);

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

ycont.addAffiliationRef((String) o);
if (StringUtils.isNotBlank(inName.getName())) {
  if (nameAffID.containsKey(inName.getName())) {
    ycont.addAffiliationRef(nameAffID.get(inName.getName()));
  } else {
    String affid = affPref + num;
    article.addAffiliation(aff);
    nameAffID.put(inName.getName(), affid);
    ycont.addAffiliationRef(affid);

代码示例来源: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.synat/synat-portal-core

private YContributor initYContributor(ResourceContributor input, String yRole) {
  YContributor contributor = new YContributor();
  contributor.addName(new YName(UserProfileUtils.createFullName(input.getForenames(), input.getSurname())).setType(NameTypes.NM_CANONICAL));
  contributor.addName(new YName(input.getForenames()).setType(NameTypes.NM_FORENAMES));
  contributor.addName(new YName(input.getSurname()).setType(NameTypes.NM_SURNAME));
  contributor.setRole(yRole);
  if (StringUtils.isNotBlank(input.getOrigApprovedId())) {
    BwmetaContributorUtils.setContributorIdentity(contributor, input.getOrigApprovedId());
  }
  if (input.getContributorId() == null) {
    throw new IllegalArgumentException();
  }
  BwmetaContributorUtils.setContributorId(contributor, input.getContributorId());
  
  if(input.getAffiliationIds() != null){
    for (String affId : input.getAffiliationIds()) {
      if(StringUtils.isNotBlank(affId)){
        contributor.addAffiliationRef(affId);
      }
    }
  }
  return contributor;
}

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

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