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

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

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

YElement.getStructures介绍

暂无

代码示例

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

private List<YStructure> setNonJournalStructsAndGetJournalStructs(YElement article) {
  List<YStructure> journalStructures = new ArrayList<>();
  List<YStructure> nonJournalStructs = new ArrayList<>();
  for(YStructure struct : article.getStructures()) {
    if(!struct.getHierarchy().equals(YConstants.EXT_HIERARCHY_JOURNAL)) {
      nonJournalStructs.add(struct);
    } else {
      journalStructures.add(struct);
    }
  }
  article.setStructures(nonJournalStructs);
  return journalStructures;
}

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

@Deprecated
private String getPosition(YElement element) {
  String position = null;
  for(YStructure structure : element.getStructures()) {
    YCurrent current = structure.getCurrent();
    position = current.getPosition();
    if(position != null) {
      break;
    }
  }
  return position;
}

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

public static Map<String, IdentifiersData> collectIdentifiers(YElement element) {
  Map<String, IdentifiersData> data = new HashMap<>();
  for (YStructure structure : element.getStructures()) {
    for (YAncestor ancestor : structure.getAncestors()) {
      if(SUPPORTRED_LEVELS.contains(ancestor.getLevel())){
        data.putAll(collectObjectIdentifiers(ancestor, ancestor.getLevel()));
      }
    }
  }
  data.putAll(collectObjectIdentifiers(element, StringUtils.EMPTY));
  return data;
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

public Map<String, YDate> extractDates(YElement yElement) {
  Map<String, YDate> dates = processYDates(yElement.getDates());
  dates.putAll(extractDatesFromHierarchy(yElement.getStructures()));
  return dates;
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

private ThumbnailRef findThumbnailPathInAncestors(YElement element) {
  List<YStructure> yStructures = element.getStructures();
  for (YStructure yStructure : yStructures) {
    List<YAncestor> ancestors = Lists.reverse(yStructure.getAncestors());
    for (YAncestor yAncestor : ancestors) {
      ThumbnailRef thumbnailPath = findThumbnailPath(yAncestor, yAncestor.getIdentity());
      if (thumbnailPath != null) {
        return thumbnailPath;
      }
    }
  }
  return null;
}

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

List<Pair<String, String>> getHierarchyLevels(YExportable exp) {
  ArrayList<Pair<String, String>> ret = new ArrayList<Pair<String, String>>();
  if (exp instanceof YElement) {
    for (YStructure str : ((YElement) exp).getStructures()) {
      String h = str.getHierarchy();
      String l = str.getCurrent().getLevel();
      ret.add(new Pair<String, String>(l,h));
    }
  }
  return ret;
}

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

protected IViewBuilder<CatalogInformationEnhancedObject<YExportable>> resolveElement(YElement e,
    Map<String, Object> parameters) {
  
  for (YStructure level : e.getStructures()) {
    final String levelId = level.getCurrent().getLevel();
    if (elementViewBuilders.containsKey(levelId)) {
      return elementViewBuilders.get(levelId);
    }
  }
  throw new SystemException(Modules.DETAILS, "View for BWMETA1 element " + e.getId() + " not found");
}

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

protected void fillFromStructures(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  List<YStructure> structures = yElement.getStructures();
  String hierarchy = resolveHierarchy(structures);
  YStructure struct = yElement.getStructure(hierarchy);
  String yLevelStr = null;
  if (struct != null) {
    yLevelStr = struct.getCurrent() == null ? null : struct.getCurrent().getLevel();
  }
  if (yLevelStr != null) {
    int lastIndexOf = yLevelStr.lastIndexOf("_");
    String yTypeStr = yLevelStr.substring(lastIndexOf + 1);
    ret.put(E_TYPE, new ArrayList<StringWithAttributes>());
    ret.get(E_TYPE).add(new StringWithAttributes(yTypeStr));
  }
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

@Override
public String fetchCurrentStructureLevel(YElement yElement) {
  for (YStructure structure : yElement.getStructures()) {
    if (structure.getCurrent() != null) {
      return structure.getCurrent().getLevel();
    }
  }
  return null;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-external-apis

private boolean isElementShowable(OaiItem item) {
  if (item.getYobject() == null) {
    return false; // we.meta.getId().getId().startsWith("bwmeta1.element.");
  }
  for (YStructure s : item.getYobject().getStructures()) {
    if (acceptedLevels.contains(s.getCurrent().getLevel())) {
      return true;
    }
  }
  return false;
}

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

@Override
public void store(EnrichedPayload<YElement>[] data, ProcessContext ctx)
    throws Exception {

for(EnrichedPayload<YElement> enrichedP : data){
  log.info("----------------------\n" + 
      "Element Id:" + enrichedP.getObject().getId() + "\n" + 
      "Element Name:" + enrichedP.getObject().getNames().get(0) + "\n" +
      "Element Structures:" + enrichedP.getObject().getStructures() + "\n"); 
}

}

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

protected boolean isMediaLeaf(YExportable entity) {
  if (entity instanceof YElement) {
    YStructure structure = null;
    for (YStructure s : ((YElement) entity).getStructures()) {
      if (contentHierarchies.contains(s.getHierarchy())) {
        structure = s;
      }
    }
    if (structure != null && structure.getCurrent() != null) {
      String level = structure.getCurrent().getLevel();
      return YConstants.EXT_LEVEL_BOOK_BOOK.equals(level);
    }
  }
  return false;
}

代码示例来源:origin: pl.edu.icm.ceon/ceon-converters-commons

protected boolean isMediaLeaf(YExportable entity) {
  if (entity instanceof YElement) {
    YStructure structure = null;
    for (YStructure s : ((YElement) entity).getStructures()) {
      if (contentHierarchies.contains(s.getHierarchy())) {
        structure = s;
      }
    }
    if (structure != null && structure.getCurrent() != null) {
      String level = structure.getCurrent().getLevel();
      return YConstants.EXT_LEVEL_BOOK_BOOK.equals(level);
    }
  }
  return false;
}

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

private PositionExtractor getPosition(YElement element) {
  String position = null;
  List<YStructure> yStrictures = element.getStructures();
  for(YStructure structure : yStrictures){
    YCurrent current = structure.getCurrent();
    position = current.getPosition();
    if(position!=null){
      break;
    }
  }
  
  return new PositionExtractor(position);
}

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

@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
  String pos = numberingGroupToPages(pm.getNumberingGroup());
  if (pos != null) {
    element.getStructures().get(0).getCurrent().setPosition(pos);
  }
}

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

private ElementType resolveElementType(ElementMetadata elementMetadata) {
  if (elementMetadata.getContent() == null || !(elementMetadata.getContent() instanceof YElement))
    return ElementType.ARTICLE;
  YElement yElement = (YElement) elementMetadata.getContent();
  return ElementType.resolveTypeFromStructure(yElement.getStructures());
}

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

protected void fillType(HtmlMetaHeaders metadata, YElement yElement) {
  for (YStructure yStructure : yElement.getStructures()) {
    if (yStructure.getCurrent() != null) {
      if (YaddaIdConstants.ID_LEVEL_JOURNAL_ARTICLE.equals(yStructure.getCurrent().getLevel())) {
        metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_TYPE, DC_ARTICLE_TYPE);
      } else if (YaddaIdConstants.ID_LEVEL_BOOK_BOOK.equals(yStructure.getCurrent().getLevel())) {
        metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_TYPE, DC_BOOK_TYPE);
      }
    }
  }
}

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

public StructureData preparePublisher(YElement yElement) {
  for (YStructure structure : yElement.getStructures()) {
    YAncestor ancestor = structure.getAncestor(YaddaIdConstants.ID_LEVEL_JOURNAL_PUBLISHER);
    if (ancestor != null) {
      return new StructureData(ancestor.getIdentity(), YModelUtils.getDefaultName(ancestor));
    }
  }
  return new StructureData("", "");
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

/**
 * Creates obcect using YElement
 *
 * @param yElement
 *            metadata element used to create object
 */
public PublicationData createPublicationData(YElement yElement) {
  PublicationData pd = new PublicationData();
  populateCommonProperties(yElement, pd);
  boolean available = yModelPropertyExtractor.isContentAvailable(yElement);
  pd.setContentAvailaibility(available ? ContentAvaiability.AVAILABLE : ContentAvaiability.NOT_AVAILABLE);
  pd.setObjectType(ElementType.resolveTypeFromStructure(yElement.getStructures()));
  pd.setThumbnailPath(yModelPropertyExtractor.extractThumbnailPath(yElement));
  return pd;
}

相关文章