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

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

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

YName.setType介绍

暂无

代码示例

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

YContentFile buildYContentFile() {
  YContentFile yContentFile = new YContentFile(String.valueOf(id), FileTypes.FT_FULL_TEXT,
      format, Lists.newArrayList(location));
  YName yName = new YName(name);
  yName.setType(NameTypes.NM_FILE_NAME);
  yContentFile.addName(yName);
  return yContentFile;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

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);
        }
      }
    }
  }
}

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

nam += firstnames;
YName ynam = new YName(firstnames);
ynam.setType(NameTypes.NM_FORENAMES);
c.addName(ynam);
ynam.setType(NameTypes.NM_SURNAME);
c.addName(ynam);

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

protected List<YContributor> parseBibEntryPersons(List<String> persons, String role) {
  List<YContributor> yContributorList = new ArrayList<YContributor>();
  for (String person : persons) {
    YContributor yContributor = new YContributor();
    yContributor.setPerson(true);
    yContributor.setRole(role);
    yContributor.addName(new YName().setType(YConstants.NM_CANONICAL).setText(person));
    String[] split = person.split(", ");
    if (split.length > 0) {
      yContributor.addName(new YName().setType(YConstants.NM_SURNAME).setText(split[0]));
    }
    if (split.length > 1) {
      yContributor.addName(new YName().setType(YConstants.NM_FORENAMES).setText(split[1]));
    }
    if (split.length > 2) {
      yContributor.addName(new YName().setType(YConstants.NM_SUFFIX).setText(split[2]));
    }
    yContributorList.add(yContributor);
  }
  return yContributorList;
}

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

tit.setType(NameTypes.NM_ABBREVIATION);
journal.addName(tit);

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

@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
  String partNumber = element.getStructures().get(0).getCurrent().getPosition();
  if(StringUtils.isNotBlank(partNumber)){
    String id = ancestors.get(ancestors.size() - 1).getId() + "-p-" + partNumber;
    id = WileyUtils.processId(id);
    element.setId(id);
  }
  if (element.getNames().size() == 1) {
    YName name = YModelUtils.fetchDefaultName(element);
    if(StringUtils.equals(NameTypes.NM_ALTERNATIVE, name.getType()) && StringUtils.isNotBlank(partNumber)){
      name.setText(BaseYModelUtils.buildRichText(name.getText() + StringUtils.SPACE + partNumber));
    }
    name.setType(NameTypes.NM_CANONICAL);
  }
}

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

@Deprecated
public static YPerson resolveYPerson(PersonData personData) {
  YPerson person = new YPerson();
  person.setId(personData.getId());
  person.addName(new YName(personData.getName()).setType(NameTypes.NM_CANONICAL));
  return person;
}

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

canonical.setType(YConstants.NM_CANONICAL);
ycontributor.addName(canonical);
updated = true;
surname.setType(YConstants.NM_SURNAME);
ycontributor.addName(surname);
updated = true;
forenames.setType(YConstants.NM_FORENAMES);
ycontributor.addName(forenames);
updated = true;

代码示例来源: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.yadda/yadda-analysis-impl

private static void putEditor(YElement element, String editor) {
  YName name = new YName().setType(YConstants.NM_CANONICAL).setText(editor);
  YContributor contributor = new YContributor().setRole(YConstants.CR_EDITOR).addName(name);
  element.addContributor(contributor);
}

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

代码示例来源: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.synat/synat-business-services-impl

name.setType(NameTypes.NM_FILE_NAME);
name.setText(prepareFileName(element, format));
ocrContent.addName(name);

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

YContributor ycont = new YContributor();
if (StringUtils.isNotBlank(aut.getForenames())) {
  ycont.addName(new YName().setText(aut.getForenames()).setType(NameTypes.NM_FORENAMES));
  ycont.addName(new YName().setText(aut.getSurname()).setType(NameTypes.NM_SURNAME));

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

private YElement buildBookElementFromSeries(ProceedingsSeriesMetadata proceedingsSeriesMetadata, YElement parent, CrossrefIdGenerator generator) {
  YElement bookElement = new YElement();
  bookElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
  bookElement.getNames().add(new YName(proceedingsSeriesMetadata.getProceedingsTitle()));
  bookElement.getDates().addAll(convertDates(proceedingsSeriesMetadata.getPublicationDates()));
  bookElement.getIds().addAll(convertIsbns(proceedingsSeriesMetadata.getIsbns()));
  if (StringUtils.isNotBlank(proceedingsSeriesMetadata.getProceedingsSubject())) {
    YName subject = new YName(proceedingsSeriesMetadata.getProceedingsSubject());
    subject.setType(NameTypes.NM_SUBTITLE);
    bookElement.addName(subject);
  }
  if (proceedingsSeriesMetadata.getDoiData() != null) {
    bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, proceedingsSeriesMetadata.getDoiData().getDoi()));
  }
  String id = generator.generateBookId(bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
      bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_EISBN),
      getDefaultName(bookElement));
  bookElement.setId(id);
  return bookElement;
}

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

private YElement buildJournalElement(JournalMetadata journalMetadata, CrossrefIdGenerator generator) {
  YElement element = new YElement();
  YStructure structure = buildStructureFromParent(null, HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL);
  element.addStructure(structure);
  YLanguage language = YLanguage.byCode(journalMetadata.getLanguage());
  element.getLanguages().add(language);
  element.getIds().addAll(convertIssns(journalMetadata.getIssns()));
  if (StringUtils.isNotBlank(journalMetadata.getCoden())) {
    element.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_CODEN, journalMetadata.getCoden()));
  }
  for (String fullTitle : journalMetadata.getFullTitles()) {
    element.addName(new YName(fullTitle));
  }
  for (String abbrevTitle : journalMetadata.getAbbrevTitles()) {
    YName abbrev = new YName(abbrevTitle);
    abbrev.setType(NameTypes.NM_ABBREVIATION);
    element.addName(abbrev);
  }
  if (journalMetadata.getDoiData() != null) {
    String doi = journalMetadata.getDoiData().getDoi();
    element.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, doi));
  }
  String issn = element.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISSN);
  String journalId = generator.generateJournalId(issn, element.getOneName().getText());
  element.setId(journalId);
  return element;
}

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

private YElement buildBookElementFromProceedings(ProceedingsMetadata proceedingsMetadata, YElement conferenceEventElement, YElement seriesElement,
    CrossrefIdGenerator generator) {
  YElement bookElement = new YElement();
  if (seriesElement == null) {
    YRelation proceedingsRelation = new YRelation(RelationTypes.RL_PROCEEDINGS_OF, new YId(StringUtils.EMPTY, conferenceEventElement.getId()));
    bookElement.getRelations().add(proceedingsRelation);
    bookElement.addStructure(buildStructureFromParent(null, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
  } else {
    bookElement.addStructure(buildStructureFromParent(seriesElement, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK,
        HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
  }
  bookElement.getNames().add(new YName(proceedingsMetadata.getProceedingsTitle()));
  bookElement.getDates().addAll(convertDates(proceedingsMetadata.getPublicationDates()));
  bookElement.getIds().addAll(convertIsbns(proceedingsMetadata.getIsbns()));
  bookElement.getIds().addAll(convertIssns(proceedingsMetadata.getIssns()));
  if (StringUtils.isNotBlank(proceedingsMetadata.getProceedingsSubject())) {
    YName subject = new YName(proceedingsMetadata.getProceedingsSubject());
    subject.setType(NameTypes.NM_SUBTITLE);
    bookElement.addName(subject);
  }
  if (proceedingsMetadata.getDoiData() != null) {
    bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, proceedingsMetadata.getDoiData().getDoi()));
  }
  String id = generator.generateBookId(bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
      bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_EISBN),
      getDefaultName(bookElement));
  bookElement.setId(id);
  return bookElement;
}

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

if (StringUtils.isNotBlank(eventMetadata.getConferenceAcronym())) {
  YName acronym = new YName(eventMetadata.getConferenceAcronym());
  acronym.setType(NameTypes.NM_ABBREVIATION);
  element.addName(acronym);

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

.setText(xmc.getArticle().getJournal().getPubDate().getYear())
.setLanguage(YLanguage.NoLinguisticContent)
.setType(NameTypes.NM_CANONICAL));

相关文章