|
DynamicResultRenderer Examples
|
The DynamicResultRenderer enables context-dependent result rendering logic to be employed based
on user, query or result attributes. It is used in several demos:
- Used to add the dynamic extraction of Shakespeare Snippets when the page is requested
from the HTMLScraperFilter page
if http request parameter displayType=advanced is present in the URL.
<!-- ======================================================================== -->
<!-- Use DynamicResultRenderer to add the dynamic extraction of Shakespeare -->
<!-- Snippets when the page is requested from the HTMLScraperFilter page. -->
<!-- Check for displayType=advanced added to the action parameter. -->
<!-- ======================================================================== -->
<ResultRenderer
rendererClass="com.raritantechnologies.searchApp.taglibrary.DynamicResultRenderer" >
<!-- Only show this renderer if the &displayType=advanced is in the request -->
<UseRenderer>
<RequestParams>
<Param name="displayType">
<ValidValues>
<Value>advanced</Value>
</ValidValues>
</Param>
</RequestParams>
<!-- ============================================================================ -->
<!-- FormattingResultRenderer - Applies a formatting operation and then a -->
<!-- rendering operation. -->
<!-- ============================================================================ -->
<ResultRenderer class="com.raritantechnologies.searchApp.taglibrary.FormattingResultRenderer" >
. . .
</ResultRenderer>
- Used by the ResultSelector that is used to display all of the demos in the Framework Documentation application, to
display a description for those results that have description data (using ResultHasFieldMatcher):
<ResultRenderer rendererClass="com.raritantechnologies.searchApp.taglibrary.DynamicResultRenderer" >
<UseRenderer>
<ResultMatcher class="com.raritantechnologies.searchApp.resultComparators.ResultHasFieldMatcher"
isAnd="true" >
<Fields>
<Field ID="description" matchValue="true" />
</Fields>
</ResultMatcher>
<ResultRenderer rendererClass="com.raritantechnologies.quickstart.taglibrary.SimpleFieldRenderer" >
<Field ID="description" />
</ResultRenderer>
</UseRenderer>
</ResultRenderer>