本文整理了Java中pl.edu.icm.model.bwmeta.y.YStructure.getCurrent()
方法的一些代码示例,展示了YStructure.getCurrent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YStructure.getCurrent()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YStructure
类名称:YStructure
方法名:getCurrent
暂无
代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api
private static <T> T getProcessedDefaultStructure(YElement element, Function<YStructure, T> processor) {
for (final String hierarhyId : ALLOWED_HIERARCHY_ID) {
YStructure yStructure = element.getStructure(hierarhyId);
if (yStructure != null && yStructure.getCurrent() != null && yStructure.getCurrent().getLevel() != null) {
return processor.apply(yStructure);
}
}
return null;
}
代码示例来源: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.synat/synat-portal-core
private YCurrent getCurrentLevel(YElement element, String hierarchy) {
YStructure structure = element.getStructure(hierarchy);
return structure.getCurrent();
}
代码示例来源: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-sdk-sample-services
private boolean isArticle(YElement element) {
YStructure structure = element.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
if (structure == null) {
return false;
}
return HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ARTICLE.equals(structure.getCurrent().getLevel());
}
代码示例来源: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-business-services-api
public static String getType(YElement yElement) {
String level = getProcessedDefaultStructure(yElement, s -> s.getCurrent().getLevel());
return StringUtils.isBlank(level) ? "unknownLevel" : level;
}
代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api
public static ElementType resolveTypeFromStructure(List<YStructure> structures) {
for (final YStructure yStructure : structures) {
final ElementType type = resolveTypeFromLevel(yStructure.getCurrent().getLevel());
if (type != null) {
return type;
}
}
return null;
}
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
public String getPosition(YElement yElement){
YStructure structure = yElement.getStructure(YaddaIdConstants.ID_HIERARACHY_JOURNAL);
YCurrent current = structure.getCurrent();
return current.getPosition();
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-polindex
/**
* Returns YCurrent object representing level of element in journal
* hierarchy. Method never returns null - if journal hierarchy level is not
* specified, empty YCurrent object is returned.
*/
public static YCurrent yCurrentInJournalHierarchy(final YElement element) {
YCurrent result = null;
final YStructure struct = element.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
if (struct != null) {
result = struct.getCurrent();
}
return result == null ? new YCurrent() : result;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-cli
static boolean isArticle(YElement el) {
if (el.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL)!=null) {
YStructure struct=el.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
if (struct.getCurrent().getLevel().equalsIgnoreCase(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ARTICLE)) {
return true;
}
}
return false;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
public static String articlePosition(YElement element) {
String position = null;
YStructure anc = element.getStructure(YaddaIdConstants.ID_HIERARACHY_JOURNAL);
if (anc != null) {
YCurrent cAnc = anc.getCurrent();
if (cAnc != null && !StringUtils.isEmpty(cAnc.getPosition()))
position = cAnc.getPosition();
}
return position;
}
代码示例来源:origin: pl.edu.icm.synat/synat-sdk-sample-services
private boolean isYearInYear(YElement element) {
YStructure structure = element.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
if (structure != null) {
if (HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR.equals(structure.getCurrent().getLevel())) {
YAncestor ancestor = structure.getAncestor(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR);
return ancestor != null;
}
}
return false;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
public void exposeContentDetails(YElement yElement, Model model) {
model.addAttribute(HAS_CONTENT_RENDERABLE_PARTS, resourceDisplayUtils.hasRenderableParts(yElement));
if (yElement.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_BOOK) != null
&& yElement.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_BOOK).getCurrent() != null) {
model.addAttribute(
HAS_CONTENT_CHAPTERS_PARTS,
relatedDisplayUtils.verifyIfIsSomeoneAncestor(yElement.getId(), yElement.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_BOOK)
.getCurrent().getLevel()));
} else {
model.addAttribute(HAS_CONTENT_CHAPTERS_PARTS, false);
}
}
代码示例来源: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.synat/synat-importer-direct
protected String getLevel(YElement element) {
if(element == null){
return null;
}
YStructure structure = element.getStructure(getSupportedHierarchyId());
if (structure == null) {
return null;
}
return structure.getCurrent().getLevel();
}
代码示例来源: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-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);
}
}
内容来源于网络,如有侵权,请联系作者删除!