com.raritantechnologies.searchApp.queryFilters
Class SortingQueryProcessorFilter

java.lang.Object
  extended bycom.raritantechnologies.searchApp.QueryProcessorFilter
      extended bycom.raritantechnologies.searchApp.queryFilters.SortingQueryProcessorFilter
All Implemented Interfaces:
IConfigurable, IQueryProcessor, IResultSetFilter

public class SortingQueryProcessorFilter
extends QueryProcessorFilter
implements IResultSetFilter

Resorts a result set by some result field. Useful for SearchSources such as Dialog that send records back in random order with a sort key field.

XML Configuration Template:
   <SourceType name="[ name of SortingQueryProcessorFilter source]"
             type="QueryProcessorFilterSource"
             sourceFactoryClass = "com.raritantechnologies.searchApp.QueryProcessorFilterFactory"
             filterClass  = "com.raritantechnologies.searchApp.queryFilters.SortingQueryProcessorFilter"
             inputSource  = "[ name of SearchSource that collects the results to sort ]"
             maxDocs="[ maximum number of results to sort ]"  >

     <!-- Can specify an implementation of ISorter -->
     <Sorter class="[ class of com.raritantechnologies.searchApp.ISorter ]" >

     </Sorter>

     <!-- Alternatively can specify a ResultComparator that will be used with a ResultSetSorter -->
     <ResultComparator class="[ class of com.raritantechnologies.searchApp.IResultComparator ]" >

     </ResultComparator>

   </SourceType>
 


Field Summary
 
Fields inherited from class com.raritantechnologies.searchApp.QueryProcessorFilter
theQueryProcessor
 
Fields inherited from interface com.raritantechnologies.searchApp.IResultSetFilter
TEMPLATE
 
Constructor Summary
SortingQueryProcessorFilter()
           
 
Method Summary
 IResultSet executeQuery(java.lang.Integer queryID, ISearchFieldMap searchMap, SourceLoginInfo[] sources, OrderedMap inputParameters, java.lang.Integer pageSize, java.lang.Integer startRec)
          Base implementation executes the query then starts filter chain.
 IResultSet filterResultSet(java.lang.String sessionID, IResultSet data)
          Filter the IResultSet (somehow)
 void initialize(org.w3c.dom.Element elem)
          Initialize the from XML Element.
 
Methods inherited from class com.raritantechnologies.searchApp.QueryProcessorFilter
doExecuteQuery, filterResultSet, getQueryProcessor, getQueryProcessor, getRealSources, setNextFilter, setQueryProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortingQueryProcessorFilter

public SortingQueryProcessorFilter()
Method Detail

executeQuery

public IResultSet executeQuery(java.lang.Integer queryID,
                               ISearchFieldMap searchMap,
                               SourceLoginInfo[] sources,
                               OrderedMap inputParameters,
                               java.lang.Integer pageSize,
                               java.lang.Integer startRec)
                        throws QueryProcessorException
Description copied from class: QueryProcessorFilter
Base implementation executes the query then starts filter chain.

Specified by:
executeQuery in interface IQueryProcessor
Overrides:
executeQuery in class QueryProcessorFilter
Throws:
QueryProcessorException

filterResultSet

public IResultSet filterResultSet(java.lang.String sessionID,
                                  IResultSet data)
Description copied from interface: IResultSetFilter
Filter the IResultSet (somehow)

Specified by:
filterResultSet in interface IResultSetFilter

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IResultSetFilter
Initialize the from XML Element.

Specified by:
initialize in interface IResultSetFilter
Overrides:
initialize in class QueryProcessorFilter