<% /** * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ %> <% long[] entryIds = TagsEntryLocalServiceUtil.getEntryIds(scopeGroupId, entries); long[] notEntryIds = TagsEntryLocalServiceUtil.getEntryIds(scopeGroupId, notEntries); if (allowEmptyResults && (entryIds.length == 0) && (notEntryIds.length == 0)) { entryIds = new long[] {-1}; } int total = 0; Date now = new Date(); if (!groupByClass) { total = TagsAssetLocalServiceUtil.getAssetsCount(scopeGroupId, classNameIds, entryIds, notEntryIds, andOperator, excludeZeroViewCount, now, now); searchContainer.setTotal(total); List results = TagsAssetLocalServiceUtil.getAssets(scopeGroupId, classNameIds, entryIds, notEntryIds, andOperator, orderByColumn1, orderByColumn2, orderByType1, orderByType2, excludeZeroViewCount, now, now, searchContainer.getStart(), searchContainer.getEnd()); searchContainer.setResults(results); request.setAttribute("view.jsp-results", results); %> <%@ include file="/html/portlet/asset_publisher/view_dynamic_list_asset.jspf" %> <% } else { for (int groupAssetIndex = 0; groupAssetIndex < _ASSET_TYPES.length; groupAssetIndex++) { long[] groupClassNameIds = {PortalUtil.getClassNameId(_ASSET_TYPES[groupAssetIndex])}; int groupTotal = TagsAssetLocalServiceUtil.getAssetsCount(scopeGroupId, groupClassNameIds, entryIds, notEntryIds, andOperator, excludeZeroViewCount, now, now); total += groupTotal; searchContainer.setTotal(groupTotal); List results = TagsAssetLocalServiceUtil.getAssets(scopeGroupId, groupClassNameIds, entryIds, notEntryIds, andOperator, orderByColumn1, orderByColumn2, orderByType1, orderByType2, excludeZeroViewCount, now, now, searchContainer.getStart(), searchContainer.getEnd()); searchContainer.setResults(results); request.setAttribute("view.jsp-results", results); if (results.size() > 0) { %>

<%@ include file="/html/portlet/asset_publisher/view_dynamic_list_asset.jspf" %> <% } } } if (total == 0) { if (!showPortletWithNoResults) { renderRequest.setAttribute(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY, Boolean.TRUE); } %> <% } %> <%! private static final String[] _ASSET_TYPES = {BlogsEntry.class.getName(), BookmarksEntry.class.getName(), IGImage.class.getName(), DLFileEntry.class.getName(), MBMessage.class.getName(), WikiPage.class.getName()}; private static final String[] _ASSET_TITLES = {"blogs", "bookmarks", "images", "documents", "threads", "wiki-pages"}; %>