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

META-INF.resources.admin.common.kb_article_siblings.jsp Maven / Gradle / Ivy

The newest version!
<%--
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */
--%>

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

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

KBArticle[] previousAndNextKBArticles = KBArticleServiceUtil.getPreviousAndNextKBArticles(kbArticle.getKbArticleId());

KBArticle previousKBArticle = previousAndNextKBArticles[0];
KBArticle nextKBArticle = previousAndNextKBArticles[2];

if (resourceClassNameId != kbFolderClassNameId) {
	if (resourcePrimKey == kbArticle.getResourcePrimKey()) {
		previousKBArticle = null;
	}

	if (nextKBArticle != null) {
		List ancestorResourcePrimaryKeys = nextKBArticle.getAncestorResourcePrimaryKeys();

		if (!ancestorResourcePrimaryKeys.contains(resourcePrimKey)) {
			nextKBArticle = null;
		}
	}
}

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

<% PortletURL previousKBArticleURL = kbArticleURLHelper.createViewURL(previousKBArticle); %> <%= HtmlUtil.escape(previousKBArticle.getTitle()) %> <% PortletURL nextKBArticleURL = kbArticleURLHelper.createViewURL(nextKBArticle); %> <%= HtmlUtil.escape(nextKBArticle.getTitle()) %>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy