<% /** * 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. */ %> <% int total = manualEntries.length; searchContainer.setTotal(total); List results = ListUtil.fromArray(manualEntries); int end = (manualEntries.length < searchContainer.getEnd()) ? manualEntries.length : searchContainer.getEnd(); results = results.subList(searchContainer.getStart(), end); searchContainer.setResults(results); request.setAttribute("view.jsp-results", results); for (int assetIndex = 0; assetIndex < results.size(); assetIndex++) { String assetEntry = (String)results.get(assetIndex); Document assetDoc = SAXReaderUtil.read(assetEntry); Element root = assetDoc.getRootElement(); long assetId = GetterUtil.getLong(root.element("asset-id").getText()); TagsAsset asset = null; try { asset = TagsAssetLocalServiceUtil.getAsset(assetId); } catch (NoSuchAssetException nsae) { continue; } String className = PortalUtil.getClassName(asset.getClassNameId()); long classPK = asset.getClassPK(); String title = asset.getTitle(); String summary = StringPool.BLANK; String viewURL = StringPool.BLANK; String viewURLMessage = StringPool.BLANK; String editURL = StringPool.BLANK; boolean show = true; request.setAttribute("view.jsp-assetIndex", new Integer(assetIndex)); request.setAttribute("view.jsp-asset", asset); request.setAttribute("view.jsp-title", title); request.setAttribute("view.jsp-summary", summary); request.setAttribute("view.jsp-viewURL", viewURL); request.setAttribute("view.jsp-viewURLMessage", viewURLMessage); request.setAttribute("view.jsp-className", className); request.setAttribute("view.jsp-classPK", new Long(classPK)); request.setAttribute("view.jsp-show", new Boolean(show)); try { %> <%@ include file="/html/portlet/asset_publisher/view_display.jspf" %> <% } catch (Exception e) { _log.error(e.getMessage()); } } %>