META-INF.resources.admin.info_panel.jsp Maven / Gradle / Ivy
<%--
/**
* 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/init.jsp" %>
<%
long kbFolderClassNameId = PortalUtil.getClassNameId(KBFolderConstants.getClassName());
long parentResourceClassNameId = ParamUtil.getLong(request, "parentResourceClassNameId", kbFolderClassNameId);
long parentResourcePrimKey = ParamUtil.getLong(request, "parentResourcePrimKey", KBFolderConstants.DEFAULT_PARENT_FOLDER_ID);
List kbFolders = (List)request.getAttribute(KBWebKeys.KNOWLEDGE_BASE_KB_FOLDERS);
List kbArticles = (List)request.getAttribute(KBWebKeys.KNOWLEDGE_BASE_KB_ARTICLES);
if (ListUtil.isEmpty(kbFolders) && ListUtil.isEmpty(kbArticles)) {
if (parentResourceClassNameId == kbFolderClassNameId) {
kbFolders = new ArrayList();
if (parentResourcePrimKey != KBFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
kbFolders.add(KBFolderServiceUtil.getKBFolder(parentResourcePrimKey));
}
else {
kbFolders.add(null);
}
}
else {
kbArticles = new ArrayList();
kbArticles.add(KBArticleServiceUtil.getLatestKBArticle(parentResourcePrimKey, WorkflowConstants.STATUS_ANY));
}
}
%>
<%
KBFolder kbFolder = kbFolders.get(0);
request.setAttribute("info_panel.jsp-kbFolder", kbFolder);
%>
<%
KBAdminNavigationDisplayContext kbAdminNavigationDisplayContext = new KBAdminNavigationDisplayContext(request, renderRequest, renderResponse, trashHelper);
%>
<%
KBArticle kbArticle = kbArticles.get(0);
request.setAttribute("info_panel.jsp-kbArticle", kbArticle);
%>
<%
KBAdminNavigationDisplayContext kbAdminNavigationDisplayContext = new KBAdminNavigationDisplayContext(request, renderRequest, renderResponse, trashHelper);
%>