gpt4 book ai didi

pl.edu.icm.yadda.model.source.YModelSource.getElementById()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 00:22:31 27 4
gpt4 key购买 nike

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

YModelSource.getElementById介绍

暂无

代码示例

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

private YElement getElement(String elementId) {
  try {
    if (elementId != null && elementId.startsWith(FORCE_BWMETA2_OBJECT_ID)) {
      return dataSourcesFactory.getYSourceFactory(true).getYSource().getElementById(elementId);
    } else {
      return dataSourcesFactory.getYSourceFactory().getYSource().getElementById(elementId);
    }
  } catch (ModelDataSourceException e) {
    throw new SystemException(Modules.CATALOG, "Error when reading element (id: " + elementId + ")", e);
  }
}

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

private YElement loadElementFromYaddaCatalog(String id) throws RepositoryException {
  try {
    final YModelSource ySource = dataSourcesFactory.getYSourceFactory().getYSource();
    final YElement elementById = ySource.getElementById(id);
    return elementById;
  } catch (ModelDataSourceException e) {
    throw new RepositoryException();
  }
}

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

+ "]");
try {
  YElement element = dataSourcefactory.getYCatalogDataSource().getElementById(collectionId);
  if (element!=null) {
    final List<YName> names = element.getNames();

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

private ElementAncestors<YElement> setJournalIdsInOrigSequence(ElementAncestors<YElement> yElemAncest) throws ModelDataSourceException {
  Ancestor journal = yElemAncest.getAncestors().getAncestorAtLevel(YaddaIdConstants.ID_LEVEL_JOURNAL_JOURNAL);
  if (journal != null) {
    YElement journalYElem= dataSourcesFactory.getYCatalogDataSource().getElementById(journal.getExtid());
    // Keep ids original order, it decides on citation styling @see YElemToCSLItemConverter
    LinkedHashMap<String, String> idsSorted = new LinkedHashMap<>();
    for (YId yId : journalYElem.getIds()) {
      idsSorted.put(yId.getScheme(), yId.getValue());
    }
    journal.setAdditionalIdentifiers(idsSorted);
  }
  return yElemAncest;
}

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

private void createAllAncestorsInHierarchy(final String hierarchyId, final YElement element,
    final List<YElement> ancestors, Set<String> visitedElements) {
  visitedElements.add(element.getId());
  final YStructure structure = element.getStructure(hierarchyId);
  if (structure == null) {
    return;
  }
  final YAncestor ancestor = getFirstNotVisitedAncestor(structure, visitedElements);
  if (ancestor != null) {
    try {
      final String ancestorExtId = ancestor.getIdentity();
      final YElement ancestorElement = dataSourcesFactory.getYSourceFactory().getYSource()
          .getElementById(ancestorExtId);
      if (ancestorElement == null) {
        log.error("doesn't find source for ancestor; elementId = " + element.getId());
        return;
      }
      if (notInLevelToSkip(ancestor)) {
        ancestors.add(ancestorElement);
      }
      createAllAncestorsInHierarchy(hierarchyId, ancestorElement, ancestors, visitedElements);
    } catch (final ModelDataSourceException e) {
      log.error(e.toString());
    }
  }
  return;
}

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

contentElement = dataSourcefactory.getYSourceFactory(true).getYSource().getElementById(id);
} else {
 contentElement = dataSourcefactory.getYCatalogDataSource().getElementById(id);

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