本文整理了Java中pl.edu.icm.model.bwmeta.y.YCurrent.getLevel()
方法的一些代码示例,展示了YCurrent.getLevel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YCurrent.getLevel()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YCurrent
类名称:YCurrent
方法名:getLevel
暂无
代码示例来源:origin: pl.edu.icm.yadda/yadda-polindex
public static boolean isArticle(final YElement element) {
final String hierarchyLevel = yCurrentInJournalHierarchy(element).getLevel();
return HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ARTICLE.equals(hierarchyLevel);
}
代码示例来源: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.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.synat/synat-sdk-sample-services
private void fixYearInYear(DocumentRepository repository,
Document document, YElement element) {
String fixedCurrentLevel = HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME;
String newTagValue = HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL + "=" + fixedCurrentLevel;
document.addTagByKey("hierarchyLevel", newTagValue);
YStructure structure = element.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
YCurrent current = structure.getCurrent();
if (!HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR.equals(current.getLevel())) {
System.out.println("current level is = "+current.getLevel()+" expected year. Won't fix");
} else {
current.setLevel(fixedCurrentLevel);
saveDocumentWithElement(repository, document, element);
}
}
代码示例来源: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-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-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.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/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.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/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.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.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-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.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.bwmeta/bwmeta-2-foreign-transformers
protected YStructure buildStructureFromParent(YElement parent, String hierarchy, String currentLevel) {
YStructure structure = new YStructure(hierarchy);
YCurrent current = new YCurrent(currentLevel);
structure.setCurrent(current);
if (parent != null) {
YStructure parentStructure = parent.getStructure(hierarchy);
structure.getAncestors().addAll(parentStructure.getAncestors());
YAncestor ancestor = new YAncestor(parentStructure.getCurrent().getLevel(), parent.getId());
ancestor.getNames().addAll(parent.getNames());
ancestor.getIds().addAll(parent.getIds());
structure.addAncestor(ancestor);
}
return structure;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
private BookSectionDownload createBookSectionDownload(YElement element, OrganisationElementLicenseResponse response, YAncestor ancestor) {
BookSectionDownload download = new BookSectionDownload();
download.setIsbn(getId(ancestor, IdSchemaIds.EXT_SCHEME_ISBN));
download.setEisbn(getId(ancestor, IdSchemaIds.EXT_SCHEME_EISBN));
YCurrent current = getCurrentLevel(element, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK);
if(current != null){
download.setLevel(current.getLevel());
}
return download;
}
内容来源于网络,如有侵权,请联系作者删除!