|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.searchApp.QueryProcessorFilter
Base class for QueryProcessor filters which are used to construct query / result processing
pipelines. A QueryProcessorFilter both extends and contains
an IQueryProcessor
which are used to execute searches against some data source. The QueryProcessor filters
can modify the query parameter
set before executing it, can modify the result set or both. Examples - query logging,
result categorizing, result tagging, secondary search or lookup operations.
<SourceType name="[filtered Source Name ]"
inputSource = "[ maps to the input source - use [Session:sourceKey] for session cached source name ]"
type="[ the real Type ]"
sourceFactoryClass="com.raritantechnologies.searchApp.QueryProcessorFilterFactory"
filterClass = "[ subclass of com.raritantechnologies.searchApp.QueryProcessorFilter ]" >
<!-- Any initialization information needed by the filterClass -->
</SourceType>
<!-- Alternatively, the QueryProcessorFilter can include a nested InputSource tag: -->
<SourceType name="filteredSource Name"
type="realType"
sourceFactoryClass="com.raritantechnologies.searchApp.QueryProcessorFilterFactory"
filterClass = "[ subclass of com.raritantechnologies.searchApp.QueryProcessorFilter ]" >
<!-- Any initialization information needed by the filterClass -->
<InputSource name="name of input source"
sourceFactoryClass="[ class of SearchSourceFactory ]"
queryProcessorClass="[ class of IQueryProcessor ]" >
</InputSource>
</SourceType>
QueryProcessorFilter implements the IQueryProcessor interface using the Proxy-pattern. This means that QueryProcessorFilters can be nested.
This figure shows some of the QueryProcessorFilters that have been implemented:
| Field Summary | |
protected IQueryProcessor |
theQueryProcessor
|
| Constructor Summary | |
QueryProcessorFilter()
|
|
QueryProcessorFilter(IQueryProcessor theQueryProcessor)
|
|
QueryProcessorFilter(IQueryProcessor theQueryProcessor,
QueryProcessorFilter nextFilter)
|
|
| Method Summary | |
protected IResultSet |
doExecuteQuery(java.lang.Integer queryID,
ISearchFieldMap searchMap,
SourceLoginInfo[] sources,
OrderedMap inputParameters,
java.lang.Integer pageSize,
java.lang.Integer startRec)
Execution of the query - finds the "real" or proxy IQueryProcessor. |
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. |
void |
filterResultSet(ILoginInfo sourceLogin,
IResultSet resultSet)
Subclasses should override this to do meaningful work. |
IQueryProcessor |
getQueryProcessor()
|
static IQueryProcessor |
getQueryProcessor(IQueryProcessor qp,
java.lang.String className)
|
protected SourceLoginInfo[] |
getRealSources(SourceLoginInfo[] sources)
|
void |
initialize(org.w3c.dom.Element initElem)
subclasses should override this to initialize themselves. |
void |
setNextFilter(QueryProcessorFilter nextFilter)
|
void |
setQueryProcessor(IQueryProcessor queryProcessor)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected IQueryProcessor theQueryProcessor
| Constructor Detail |
public QueryProcessorFilter()
public QueryProcessorFilter(IQueryProcessor theQueryProcessor)
public QueryProcessorFilter(IQueryProcessor theQueryProcessor,
QueryProcessorFilter nextFilter)
| Method Detail |
public IResultSet executeQuery(java.lang.Integer queryID,
ISearchFieldMap searchMap,
SourceLoginInfo[] sources,
OrderedMap inputParameters,
java.lang.Integer pageSize,
java.lang.Integer startRec)
throws QueryProcessorException
executeQuery in interface IQueryProcessorqueryID - Unique ID for this query. Used by front end to manage queries and
query pages. QueryProcessor may use this parameter to organize its search results, and
to organize any state information it needs to process future page requests
(future executeQuery( ) calls with the same queryID.searchMap - Provides mapping information needed to translate the inputParameters
into a search string appropriate for this type of QueryProcessor.
Mapping information is obtained by the application framework from
local configuration data.sources - The LoginInfo and SearchSource(s) to be used for this query. The SearchSource(s)
must be of the appropriate type for the QueryProcessor.inputParameters - Form inputs. Use ISearchFieldMap to translate these into
implementation and source-specific fields.pageSize - Integer specifying the number of results to include in the returned
Document.
if null - use the default page size.startRec - Integer specifying the starting record in the result set to be returned.
if null - start with the first record.
QueryProcessorException
protected IResultSet doExecuteQuery(java.lang.Integer queryID,
ISearchFieldMap searchMap,
SourceLoginInfo[] sources,
OrderedMap inputParameters,
java.lang.Integer pageSize,
java.lang.Integer startRec)
throws QueryProcessorException
QueryProcessorExceptionprotected SourceLoginInfo[] getRealSources(SourceLoginInfo[] sources)
public void filterResultSet(ILoginInfo sourceLogin,
IResultSet resultSet)
public void setQueryProcessor(IQueryProcessor queryProcessor)
public IQueryProcessor getQueryProcessor()
public void setNextFilter(QueryProcessorFilter nextFilter)
public void initialize(org.w3c.dom.Element initElem)
public static IQueryProcessor getQueryProcessor(IQueryProcessor qp,
java.lang.String className)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||