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

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

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

YStructure.setAncestors介绍

暂无

代码示例

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

private YAncestor setNonIssueAncestorsAndGetExisitingIssue(String issueId, YStructure journal) {
  YAncestor existingIssue = null;
  List<YAncestor> nonIssueAncestors = new ArrayList<>();
  for(YAncestor ancestor : journal.getAncestors()) {
    boolean isNotIssue = !ancestor.getLevel().equals(YConstants.EXT_LEVEL_JOURNAL_ISSUE);
    boolean isCurrentIssue = ancestor.getIdentity().equals(issueId);
    if(isNotIssue) {
      nonIssueAncestors.add(ancestor);
    } else if(isCurrentIssue) {
      existingIssue = ancestor;
    } else {
      // ignore/remove non current issues
    }
  }
  journal.setAncestors(nonIssueAncestors);
  return existingIssue;
}

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

yJournal.getStructure(YConstants.EXT_HIERARCHY_JOURNAL).setAncestors(
    null);
yVolume.getStructure(YConstants.EXT_HIERARCHY_JOURNAL).setAncestors(al);
yIssue.getStructure(YConstants.EXT_HIERARCHY_JOURNAL).setAncestors(al);
yArticle.getStructure(YConstants.EXT_HIERARCHY_JOURNAL).setAncestors(al);

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

yJournal.getStructure(EXT_HIERARCHY_JOURNAL).setAncestors(null);
yVolume.getStructure(EXT_HIERARCHY_JOURNAL).setAncestors(al);
yIssue.getStructure(EXT_HIERARCHY_JOURNAL).setAncestors(al);
yArticle.getStructure(EXT_HIERARCHY_JOURNAL).setAncestors(al);

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

private void appendStructure(ResourceData resource, YElement yElement) {
  final String hierarchy = ResourceDataConstants.MAP_TYPE_TO_HIERARCHY.get(resource.getType());
  final String current = ResourceDataConstants.MAP_TYPE_TO_CURRENT.get(resource.getType());
  YStructure structure = new YStructure(hierarchy);
  final AncestorData pages = extractAncestorFromHierarchyData(resource, ResourceDataConstants.ANCESTOR_LEVEL_NAME_PAGES);
  
  final String position = pages == null ? StringUtils.EMPTY : StringUtils.defaultString(pages.getName());
  structure.setCurrent(new YCurrent(current).setPosition(position));
  final Collection<YAncestor> ancestors = mapHierarchyToAncestors(resource.getType(), resource.getHierarchy());
  if (CollectionUtils.isNotEmpty(ancestors)) {
    structure.setAncestors(ancestors);
  }
  yElement.addStructure(structure);
}

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

/**
 * Creates an element in the hierarchy.
 *
 * @param level hierarchy for the element
 * @param level level for the element in the hierarchy
 * @param name name to use as the canonical name of the element
 * @param parent parent for the element in the hierarchy
 * @param id eudml id
 * @return the created element
 */
public YElement element(String hierarchy, String level, YName name, YElement parent, String id) {
  YStructure ps = parent==null ? null : parent.getStructure(hierarchy);
  YStructure struct = new YStructure(hierarchy).setCurrent(new YCurrent(level));
  List<String> issns = parent==null ? null : parent.getIds(IdSchemaIds.EXT_SCHEME_ISSN);
  String issn = (issns==null || issns.isEmpty()) ? null : issns.get(0);
  if (ps != null) {
    YAncestor ancestor = new YAncestor(ps.getCurrent().getLevel(), parent.getId()).addName(parent.getDefaultName());
    if (StringUtils.isNotEmpty(issn)) {
      ancestor.addId(new YId(IdSchemaIds.EXT_SCHEME_ISSN, issn));
    }
    struct.setAncestors(ps.getAncestors()).addAncestor(ancestor);
  }
  return new YElement(id).addName(name).addStructure(struct);
}

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

yearEl.addName(new YName(year));
struct1=new YStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
struct1.setAncestors(struct.getAncestors());
struct1.setCurrent(new YCurrent(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR));
yearEl.addStructure(struct1);
vEl.addName(new YName(volume.toString().trim()));
struct1=new YStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
struct1.setAncestors(struct.getAncestors());
struct1.setCurrent(new YCurrent(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME));
vEl.addStructure(struct1);
iEl.addName(new YName(issue.toString().trim()));
struct1=new YStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
struct1.setAncestors(struct.getAncestors());
struct1.setCurrent(new YCurrent(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ISSUE));
iEl.addStructure(struct1);

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

ancestor.addId(yISSN);
struct.setAncestors(ps.getAncestors()).addAncestor(ancestor);

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

/**
 * Creates an element in the hierarchy specified by the <code>hierarchy</code> property.
 *
 * @param level level for the element in the hierarchy
 * @param name name to use as the canonical name of the element
 * @param parent parent for the element in the hierarchy
 * @return the created element
 */
public YElement element(String level, YName name, YElement parent) {
  YStructure ps = parent.getStructure(getHierarchy());
  YStructure struct = new YStructure(getHierarchy()).setCurrent(new YCurrent(level));
  if (ps != null)
    struct
      .setAncestors(ps.getAncestors())
      .addAncestor(
        new YAncestor(ps.getCurrent().getLevel(), parent.getId())
          .addName(parent.getDefaultName()));

  return new YElement(
      generateId(EXT_PREFIX_ELEMENT, parent, name))
    .addName(name)
    .addStructure(struct);
}

相关文章