gpt4 book ai didi

pl.edu.icm.yadda.model.source.YModelSource类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 23:58:31 27 4
gpt4 key购买 nike

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

YModelSource介绍

暂无

代码示例

代码示例来源: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/yaddaweb-lite-core

public Ancestors getAncestorsFor(String elementId) throws ModelDataSourceException{
  ElementAncestors<YElement> ea = getYSource().getElementWithAncestors(elementId);
  
  return ea!=null ? ea.getAncestors() : null;
}

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

try {
  final EnrichedObject<ElementComplete<YElement>> enrichedElementComplete = ySource
      .getEnrichedElementComplete(elementExtId);
  String[] tagList = null;
  if (enrichedElementComplete != null) {

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

final YInstitution institution = dataSourcefactory.getYCatalogDataSource().getInstitutionById(element.getContributorId());
if (institution != null) {
  final YDescription oneDescription = institution.getOneDescription(YConstants.DS_ABSTRACT);

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

public List<YClassification> getAllClassification() throws ServiceException, ModelDataSourceException {
    PagingResponse<ObjectInfo> pr = typeBrowseService.browseType(
        null,
        ElementInfoFieldData.NO_FIELDS,
        DeskLightTypes.TYPE_CATEGORY_CLASS, 0);

    List<YClassification> all = new ArrayList<>();
    for (ObjectInfo oi : pr.getPage()) {

      YExportable exportable =dataSourcesFactory.getYCatalogDataSource().getExportableById(oi.getExtId());
      if(exportable instanceof YClassification) {
        YClassification classification =  (YClassification) exportable;
        all.add(classification);
      }
    }

    return all;
  }
}

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

protected void fetchPersonality(final YContributor contributor, final ViewContributor viewContributor,
    final IFilteringContext filteringContext) {
  if (!contributor.isInstitution() || contributor.getIdentity() == null || contributor.getIdentity().isEmpty()) {
    return;
  }
  try {
    final YInstitution inst = dataSourcesFactory.getYCatalogDataSource()
        .getInstitutionById(contributor.getIdentity());
    if (inst != null) {
      final String addr = inst.getOneAttributeSimpleValue(YConstants.AT_CONTACT_LOCATION);
      viewContributor.setPublisherId(contributor.getIdentity());
      viewContributor.getAddresses().add(detailsFilter.filter(addr, InputType.RICH_TEXT, filteringContext));
      viewContributor.getContacts()
          .addAll(CommonBuilderUtils.resolveContacts(inst, filteringContext, detailsFilter));
    }
  } catch (final Exception e) {
    throw new SystemException(Modules.DETAILS, "Error fetching intitution: " + contributor.getIdentity(), 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

private ElementAncestors<YElement> getYElementWithAncestors(String id) {
  try {
    ElementAncestors<YElement> yElemAncest = dataSourcesFactory.getYCatalogDataSource().getElementWithAncestors(id);
    return setJournalIdsInOrigSequence(yElemAncest);
  } catch (ModelDataSourceException e) {
    throw new SystemException(Modules.CATALOG, "Error while fetching YElement from catalog");
  }
}

代码示例来源: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.repowebeditor/repository-web-editor-core

@Override
public ElementAncestors<YElement> getElementWithAncestors(String id) throws RepositoryException {
  try {
    final YModelSource ySource = dataSourcesFactory.getYSourceFactory().getYSource();
    final ElementAncestors<YElement> elementWithAncestors = ySource.getElementWithAncestors(id);
    return elementWithAncestors;
  } catch (ModelDataSourceException e) {
    throw new RepositoryException();
  }
}

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

@Override
protected CatalogInformationEnhancedObject<YExportable> readElement() {
  try {
    final CatalogInformationEnhancedObject<YExportable> result = dataSourcesFactory
        .getYModelGenericDataSource().getEnhancedObjectById(id);
    updateReferencesFromMetadata(result);
    
    if (result.getObject() instanceof YElement) {
      ElementAncestors<YElement> elementWithAncestors = dataSourcesFactory.getYCatalogDataSource()
          .getElementWithAncestors(id);
      parameters.put(DetailsConstants.VIEW_PARAM_ANCESTORS, elementWithAncestors.getAncestors());
    }
    
    return result;
  } catch (final Exception ex) {
    log.error("Error getting data from catalog! id=" + id);
    throw new SystemException(Modules.CATALOG, "Error getting data from catalog!", ex);
  }
}

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