<%-- 
/**
  * Copyright (c) 2004 Red Hat, 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 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.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  * USA
  *
  * Component of: Red Hat Application Server
  * 
  * Initial Developers: Aizaz Ahmed
  *                     Vivek Lakshmanan
  *                     Andrew Overholt
  *                     Matthew Wringe
  *
  */
--%>
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>

<%@ page contentType="text/html"
         import="olstore.entity.*"
         import="olstore.session.helper.ItemHelperLocalHome"
         import="olstore.util.WebUtils"
	     import="olstore.framework.EJBHomeFactory"
%>


<div class="itemThumbView">
<div class="spacer" ></div>
<%
    EJBHomeFactory factory=EJBHomeFactory.getInstance();
    ItemHelperLocalHome itemHelper = (ItemHelperLocalHome) factory.getLocalHome(EJBHomeFactory.ITEM_HELPER);
    ItemLocal item = (ItemLocal) request.getAttribute( "itemToDisplay" );

    PictureLocal pic = itemHelper.create().getPicture ( item );

    pageContext.setAttribute("pic", pic, PageContext.REQUEST_SCOPE);
    pageContext.setAttribute ("itemQS",item, PageContext.REQUEST_SCOPE);
%>




<logic:notEmpty name="pic" scope="request">
	<html:link action="/views/Item.do" paramName="itemQS" paramProperty="itemId" paramId="itemId">
	<html:img page="<%="/"+ pic.getLocation()%>"
	 title="<%=pic.getText()%>"
	 alt="<%=pic.getText()%>"/>
	</html:link>



    <html:link action="/views/Item.do" paramName="itemQS" paramProperty="itemId" paramId="itemId">
        <p> <bean:write name="itemQS" property="name"/> </p>
    </html:link>
    <p class="priceCenter">$<%=WebUtils.costDisplay(item.getPrice())%></p>
    <div class="spacer"></div>
</div>
</logic:notEmpty>
