All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.display.view_navigation.jsp Maven / Gradle / Ivy

There is a newer version: 5.0.146
Show newest version
<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
--%>

<%@ include file="/display/init.jsp" %>

<%
KBArticle kbArticle = (KBArticle)request.getAttribute(KBWebKeys.KNOWLEDGE_BASE_KB_ARTICLE);

KBNavigationDisplayContext kbNavigationDisplayContext = (KBNavigationDisplayContext)request.getAttribute(KBWebKeys.KNOWLEDGE_BASE_KB_NAVIGATION_DISPLAY_CONTEXT);

List ancestorResourcePrimaryKeys = kbNavigationDisplayContext.getAncestorResourcePrimaryKeys();

long rootResourcePrimKey = kbNavigationDisplayContext.getRootResourcePrimKey();

String pageTitle = kbNavigationDisplayContext.getPageTitle();

if (Validator.isNotNull(pageTitle)) {
	PortalUtil.setPageTitle(pageTitle, request);
}

KBArticleURLHelper kbArticleURLHelper = new KBArticleURLHelper(renderRequest, renderResponse, templatePath);
%>

<% List kbArticles = KBArticleServiceUtil.getKBArticles(themeDisplay.getScopeGroupId(), rootResourcePrimKey, WorkflowConstants.STATUS_APPROVED, QueryUtil.ALL_POS, QueryUtil.ALL_POS, new KBArticlePriorityComparator(true)); for (KBArticle curKBArticle : kbArticles) { PortletURL viewURL = kbArticleURLHelper.createViewURL(curKBArticle); %>
  • <% boolean kbArticleExpanded = false; if ((ancestorResourcePrimaryKeys.size() > 0) && (curKBArticle.getResourcePrimKey() == ancestorResourcePrimaryKeys.get(0))) { kbArticleExpanded = true; } String kbArticleClass = StringPool.BLANK; if (curKBArticle.getResourcePrimKey() == kbArticle.getResourcePrimKey()) { kbArticleClass = "kbarticle-selected"; } else if (kbArticleExpanded) { kbArticleClass = "kbarticle-expanded"; } %> <%= HtmlUtil.escape(curKBArticle.getTitle()) %> <% List childKBArticles = KBArticleServiceUtil.getKBArticles(themeDisplay.getScopeGroupId(), curKBArticle.getResourcePrimKey(), WorkflowConstants.STATUS_APPROVED, QueryUtil.ALL_POS, QueryUtil.ALL_POS, new KBArticlePriorityComparator(true)); for (KBArticle childKBArticle : childKBArticles) { PortletURL viewChildURL = kbArticleURLHelper.createViewURL(childKBArticle); %>
    • <% boolean childKBArticleExpanded = false; if ((ancestorResourcePrimaryKeys.size() > 1) && (childKBArticle.getResourcePrimKey() == ancestorResourcePrimaryKeys.get(1))) { childKBArticleExpanded = true; } String childKBArticleClass = StringPool.BLANK; if (childKBArticle.getResourcePrimKey() == kbArticle.getResourcePrimKey()) { childKBArticleClass = "kbarticle-selected"; } else if (childKBArticleExpanded) { childKBArticleClass = "kbarticle-expanded"; } %> <%= HtmlUtil.escape(childKBArticle.getTitle()) %> <% List allDescendantKBArticles = KBArticleServiceUtil.getAllDescendantKBArticles(childKBArticle.getResourcePrimKey(), WorkflowConstants.STATUS_APPROVED, new KBArticlePriorityComparator(true)); for (KBArticle descendantKBArticle : allDescendantKBArticles) { PortletURL viewCurKBArticleURL = kbArticleURLHelper.createViewURL(descendantKBArticle); %> <% } %>
    <% } %>
<% } %>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy