META-INF.resources.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="/init.jsp" %>
<%
List folders = (List)request.getAttribute(JournalWebKeys.JOURNAL_FOLDERS);
List articles = (List)request.getAttribute(JournalWebKeys.JOURNAL_ARTICLES);
if (ListUtil.isEmpty(folders) && ListUtil.isEmpty(articles)) {
long folderId = GetterUtil.getLong((String)request.getAttribute("view.jsp-folderId"), ParamUtil.getLong(request, "folderId"));
folders = new ArrayList();
JournalFolder folder = (JournalFolder)request.getAttribute("view.jsp-folder");
if (folder != null) {
folders.add(folder);
}
else if (folderId != JournalFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
folders.add(JournalFolderLocalServiceUtil.fetchFolder(folderId));
}
else {
folders.add(null);
}
}
%>
<%
JournalFolder folder = folders.get(0);
request.setAttribute("info_panel.jsp-folder", folder);
%>
<%
JournalArticle article = articles.get(0);
request.setAttribute("info_panel.jsp-entry", article);
%>