Class Name

atg.service.collections.filter.droplet.CollectionFilter

Components

/atg/commerce/collections/filter/droplet
/InventoryFilterDroplet
/atg/commerce/collections/filter/droplet
/ProductFilterDroplet
/atg/commerce/collections/filter/droplet
/ExcludeItemInCartFilterDroplet

The CollectionFilter servlet beans use collection filtering components to reduce objects in a collection. Each servlet bean works with a different collection filtering component.

The primary discussion of this class resides in Appendix B: ATG Servlet Beans of the ATG Page Developer's Guide. For details about collection filtering components and caching, see the Filtering Collections chapter in the ATG Personalization Programming Guide.

Note that the filter input parameter has a different default value for each component of class CollectionFilter:

  • InventoryFilterDroplet uses /atg/registry/CollectionFilters/InventoryFilter

  • ExcludeItemInCartFilterDroplet uses /atg/registry/CollectionFilters/ExcludeItemInCartFilter

  • ProductFilterDroplet uses /atg/registry/CollectionFilters/ProductFilter

Example

In this example, ProductFilterDroplet causes the filters (InventoryFilter and StartEndDateFiler)specified in the ProductFilter to apply their filtering mechanisms to a collection of products. The resultant collection of products that are in stock and active are displayed.

<dspel:droplet name="/atg/commerce/catalog/CategoryLookup">
   <dspel:param name="Id" param="catId"/>
   <dspel:oparam name="output">

   <%
    String collIdentifierKey = request.getParameter("catId") + "-childprd";
   %>
      <dspel:droplet name="/atg/collections/filter/droplet/ProductFilterDroplet">
         <dsp:param name="collection" param="item.childproducts/>
         <dsp:param name="collectionIdentifierKey" value="<%=collIdentifierKey
          %>"/>

         <dspel:oparam name="output">
             Featured Plants:
             <p><dsp:droplet name="/atg/dynamo/droplet/ForEach">
                   <dsp:param name="array" param="filteredCollection"/>

                   <dsp:oparam name="output">
                      <dspel:valueof param="element"/>
                   </dspel:oparam>
                </dsp:droplet>
         </dspel:oparam>

         <dspel:oparam name="empty">
            There are currently no outdoor plants
         </dspel:oparam>
      </dspel:droplet>
   </dspel:oparam>
</dspel:droplet>
 
loading table of contents...