ClassName

atg.targeting.RuleBasedRepositoryItemGroupFilter

Component

/atg/targeting/RuleBasedRepositoryItemGroupFilter

You can give this servlet bean a collection (either an array or a List) of repository items. The bean then renders a collection of repository items of the same type as the input collection but containing only the items that belong to a specific RuleBasedRepositoryItemGroup.

Input Parameters

inputItems
A collection of repository items to filter.

repositoryItemGroup
A rule-based group of repository items.

Output Parameter

filteredItems
A collection of repository items which are a subset of the inputItems.

Open Parameter

output
The list of filtered repository items.

Example

This example displays an array of items that are filtered based on a given set of rules:

<dsp:importbean bean="/FilterRulesCreator"/>
<dsp:importbean bean="/Filterer"/>
<dsp:importbean bean="/atg/dynamo/droplet/ForEach"/>

<dsp:droplet name="Filterer">
  <dsp:param name="inputItems" param="anArrayOfRepositoryItems"/>
  <dsp:param bean="/FilterRulesCreator.repositoryItemGroup"
  name="repositoryItemGroup"/>
  <dsp:oparam name="output">
    <dsp:droplet name="ForEach">
      <dsp:param name="array" param="filteredItems"/>
      <%-- other code to display repository item properties --%>
    </dsp:droplet>
  </dsp:oparam>
</dsp:droplet>

To use the RuleBasedRepositoryItemGroupFilter servlet bean, you have to create a set of rules to filter the repository items and a form handler that enables users to choose the items they want to filter. For more information on creating these pieces, see the Pioneer Cycling PartsFilterFormHandler.java file and the filtering.jsp file in the ATG platform distribution.

For more information on how the Pioneer Cycling Reference Application uses the RuleBasedRepositoryItemGroup servlet bean, see the SearchingandFilteringtheCatalog section of the DisplayingandAccessingtheProductCatalog chapter in the ATG Consumer Commerce Reference Application Guide.

 
loading table of contents...