
META-INF.resources.blogs.view.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="/blogs/init.jsp" %>
<%
String mvcRenderCommandName = ParamUtil.getString(request, "mvcRenderCommandName");
long assetCategoryId = ParamUtil.getLong(request, "categoryId");
String assetTagName = ParamUtil.getString(request, "tag");
PortletURL portletURL = renderResponse.createRenderURL();
portletURL.setParameter("mvcRenderCommandName", "/blogs/view");
%>
<%
int pageDelta = GetterUtil.getInteger(blogsPortletInstanceConfiguration.pageDelta());
SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, pageDelta, currentURLObj, null, null);
searchContainer.setDelta(pageDelta);
searchContainer.setDeltaConfigurable(false);
int total = 0;
List results = null;
int notPublishedEntriesCount = BlogsEntryServiceUtil.getGroupUserEntriesCount(scopeGroupId, themeDisplay.getUserId(), new int[] {WorkflowConstants.STATUS_DRAFT, WorkflowConstants.STATUS_PENDING, WorkflowConstants.STATUS_SCHEDULED});
if ((assetCategoryId != 0) || Validator.isNotNull(assetTagName)) {
SearchContainerResults searchContainerResults = BlogsUtil.getSearchContainerResults(searchContainer);
searchContainer.setTotal(searchContainerResults.getTotal());
results = searchContainerResults.getResults();
}
else if (mvcRenderCommandName.equals("/blogs/view_not_published_entries")) {
total = notPublishedEntriesCount;
searchContainer.setTotal(total);
results = BlogsEntryServiceUtil.getGroupUserEntries(scopeGroupId, themeDisplay.getUserId(), new int[] {WorkflowConstants.STATUS_DRAFT, WorkflowConstants.STATUS_PENDING, WorkflowConstants.STATUS_SCHEDULED}, searchContainer.getStart(), searchContainer.getEnd(), new EntryModifiedDateComparator());
searchContainer.setResults(results);
}
else {
int status = WorkflowConstants.STATUS_APPROVED;
total = BlogsEntryServiceUtil.getGroupEntriesCount(scopeGroupId, status);
searchContainer.setTotal(total);
results = BlogsEntryServiceUtil.getGroupEntries(scopeGroupId, status, searchContainer.getStart(), searchContainer.getEnd());
}
searchContainer.setResults(results);
%>
<%@ include file="/blogs/view_entries.jspf" %>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy