Renders a collection of repository items that belong to the specified RuleBasedRepositoryItemGroup.

Class Name

atg.targeting.RuleBasedRepositoryItemGroupFilter

Component

/atg/targeting/RuleBasedRepositoryItemGroupFilter

Required Input Parameters

inputItems

A collection of repository items to filter.

repositoryItemGroup

A rule-based group of repository items.

Output Parameters

filteredItems

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

Open Parameters

output

The list of filtered repository items.

Usage Notes

RuleBasedRepositoryItemGroupFilter takes a collection (either an array or a List) of repository items. The servlet 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.

To use RuleBasedRepositoryItemGroupFilter, you must 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.

Example

The following 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>
 
loading table of contents...