
META-INF.resources.admin.info_panel.jsp Maven / Gradle / Ivy
<%--
/**
* 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="/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);
%>
<%
KBArticle kbArticle = kbArticles.get(0);
request.setAttribute("info_panel.jsp-kbArticle", kbArticle);
%>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy