JSP code snippet: Catalog attachments display

This JSP code snippet displays product attachments on the pages in which you include this snippet.

The CatalogAttachmentAssetsDisplay.jspf file is available under the following directory:

  • WC_installdir/samples/Snippets/web/Catalog\Attachments
  • WebSphere Commerce Developer WCDE_installdir\samples\Snippets\web\Catalog\Attachments

Prerequisites

  1. This snippet requires that you to pass the snippet an Attachment data bean.

Usage

  1. Add the following lines to the JSP file to which you want to add this snippet:
    
    <c:set var="maxNumDisp" value ="
    maxNumDisp"/>
    <c:set var="maxItemsInRow" value ="
    maxItemsInRow"/>
    <c:set var="showName" value="
    showName" /> 
    <c:set var="showShortDescription" value="
    showShortDescription" />
    <c:set var="AttachmentDataBeans"
    value="${product.attachmentsByUsage}" />
    <%@ include
    file="../Attachments/CatalogAttachmentAssetsDisplay.jspf" %>
    
    Where the parmeters are:
    maxNumDisp
    This parameter sets the maximum number of product attachments to display in a page.
    maxItemsInRow
    This parameter sets the maximum number of product attachments to display in a row. If this parameter is not set or is less than 0, then the default value of 1 is used.
    showName
    This parameter determines whether the product attachment's name displays on the page. If this parameter is not set, then the default value of true will be used and the product attachment's name will be displayed.
    showShortDescription
    This parameter determines whether the product attachment's short description displays on the page. If this parameter is not set, then the default value of true will be used and the product attachment's short name will be displayed.