com.raritantechnologies.searchApp.queryFilters
Class DynamicQueryProcessorFilter

java.lang.Object
  extended bycom.raritantechnologies.searchApp.QueryProcessorFilter
      extended bycom.raritantechnologies.searchApp.queryFilters.DynamicQueryProcessorFilter
All Implemented Interfaces:
IQueryProcessor

public class DynamicQueryProcessorFilter
extends QueryProcessorFilter

Enables switching between Search sources based on request or user parameters.

XML Configuration Template:
   <SourceType name="[ name of QueryMapFilter source]"
                  type="QueryProcessorFilterSource"
                  sourceFactoryClass = "com.raritantechnologies.searchApp.QueryProcessorFilterFactory"
                  filterClass  = "com.raritantechnologies.searchApp.queryFilters.DynamicQueryProcessorFilter"
                  defaultSource="[ optional name of default SearchSource ]"
                  useSourceMap="[true|false(default) - if true source names should be sourceMap names ]"
                  sourceMapType="[ optional type of SourceMap to determine search source(s) ]"
                  federatedSearchClass="[ optional class name of Federated search source ]" >

      <UseSource name="[ input Source (or SourceMap ) name ]" isAnd="[true(default)|false]" >
        <RequestParams>
          <!-- One or more Param tags: -->
          <Param ID="[ request param ]" matchValue="[ NULL|NOT_NULL|ANY|a value]" mapTo="[ name of output request ]"/>

          <!-- Alternatively can use an IComparator -->
          <Param ID="[ request param ]" mapTo="[ name of output request ]" >
            <Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >

            </Comparator>
          </Param>
        </RequestParams>

        <UserParams>
          <!-- One or more Param tags: -->
          <Param ID="[ user param ]" matchValue="[ NULL|NOT_NULL|ANY|a value]" />

          <!-- Alternatively can use an IComparator -->
          <Param ID="[ user param ]"  >
            <Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >

            </Comparator>
          </Param>
        </UserParams>

        <!-- Optional parameters that will be added to the query if this source is selected -->
        <FixedParam name="[ name of parameter ]" value="[ value of parameter ]" />
      </UseSource>

    </SourceType>
 


Field Summary
 
Fields inherited from class com.raritantechnologies.searchApp.QueryProcessorFilter
theQueryProcessor
 
Constructor Summary
DynamicQueryProcessorFilter()
           
 
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.
 IQueryProcessor getQueryProcessor()
           
 void initialize(org.w3c.dom.Element elem)
          subclasses should override this to initialize themselves.
 
Methods inherited from class com.raritantechnologies.searchApp.QueryProcessorFilter
doExecuteQuery, filterResultSet, getQueryProcessor, getRealSources, setNextFilter, setQueryProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicQueryProcessorFilter

public DynamicQueryProcessorFilter()
Method Detail

getQueryProcessor

public IQueryProcessor getQueryProcessor()
Overrides:
getQueryProcessor in class QueryProcessorFilter

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

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from class: QueryProcessorFilter
subclasses should override this to initialize themselves.

Overrides:
initialize in class QueryProcessorFilter