<%
/**
 * Copyright (c) 2000-2011 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.
 */
%>

<%
for (int assetEntryIndex = 0; assetEntryIndex < results.size(); assetEntryIndex++) {
	AssetEntry assetEntry = (AssetEntry)results.get(assetEntryIndex);

	String className = PortalUtil.getClassName(assetEntry.getClassNameId());
	long classPK = assetEntry.getClassPK();

	AssetRendererFactory assetRendererFactory = AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(className);

	if (assetRendererFactory == null) {
		continue;
	}

	AssetRenderer assetRenderer = assetRendererFactory.getAssetRenderer(classPK);

	String title = assetEntry.getTitle();

	boolean show = true;
	boolean print = false;

	request.setAttribute("view.jsp-assetEntryIndex", new Integer(assetEntryIndex));

	request.setAttribute("view.jsp-assetEntry", assetEntry);
	request.setAttribute("view.jsp-assetRendererFactory", assetRendererFactory);
	request.setAttribute("view.jsp-assetRenderer", assetRenderer);

	request.setAttribute("view.jsp-title", title);

	request.setAttribute("view.jsp-show", new Boolean(show));
	request.setAttribute("view.jsp-print", new Boolean(print));

	try {
%>

		<%@ include file="/html/portlet/asset_publisher/view_display.jspf" %>

<%
	}
	catch (Exception e) {
		_log.error(e.getMessage());
	}
}
%>