| Main | Javadoc | Example |
|
|
The ResultMatcherFilter is a GatewayProcessorFilter that uses an IResultMatcher to filter results before further processing.
In this example, the ResultMatcherFilter is used as part of a BrowseList build to create the browse list of Framework Modules from a TreeSearchSource that uses the same XML source used to create the explorer tree User Interface control seen to the left (see the SAXTreeBuilder demo for details.)
The ResultMatcherFilter is used to select only those nodes that have the attribute module="true" set. This enables the BrowseListOutputProcessor to create Browse list entries for Framework modules only and not for category nodes such as "User Interface Elements".
The BrowseResultsElementRenderer demo uses the browse list generated using this filter.
<CollectionGateway name="FrameworkTreeSource" class="com.raritantechnologies.verity.collection.QueryProcessorGateway" pageSize="50" > <QueryList> <Query> <Field ID="sortBy" value="name" /> <Field ID="sortDir" value="asc" /> </Query> </QueryList> <Sources> <Source name="FrameworkTreeSource" /> </Sources> </CollectionGateway> <GatewayOutputProcessor class="com.raritantechnologies.searchApp.resultComparators.ResultMatcherFilter" > <Comparator class="com.raritantechnologies.searchApp.resultComparators.ResultFieldMatcher" > <Fields> <Field ID="module" matchValue="true" /> </Fields> </Comparator> <OutputProcessor class="com.raritantechnologies.searchApp.browse.BrowseListOutputProcessor" resultField="name" browseField="name" searchSourceName="FrameworkTreeSource" newBrowseList="true" oneCountPerRecord="true" > <BrowseListWriter class="com.raritantechnologies.searchApp.browse.FileBrowseListWriter" directoryPath="C:/Program Files/Apache Group/Tomcat 4.1/webapps/FrameworkDocumentation/data/BrowseLists" /> </OutputProcessor> </GatewayOutputProcessor> <!-- ========================================================================= --> <!-- Tree Search Source --> <!-- ========================================================================= --> <SourceType name="FrameworkTreeSource" type="TreeSearchSource" sourceFactoryClass="com.raritantechnologies.utils.tree.TreeSearchSource" queryProcessor="com.raritantechnologies.utils.tree.TreeSearchSource" blankQueryReturnsAll="true" > <TreeBuilder class="com.raritantechnologies.utils.tree.SAXTreeBuilder" fileName="C:/Program Files/Apache Group/Tomcat 4.1/webapps/FrameworkDocumentation/WEB-INF/conf/RaritanFrameworkTree.xml" treeName="FrameworkTreeSource" > <TreeNode nodeTag="ConfigurableType" nameAttribute="name" > <AttributeMap input="module" output="module" /> </TreeNode> </TreeBuilder> </SourceType> </BrowseListBuild>