|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.searchApp.QueryProcessorFilter
com.raritantechnologies.searchApp.queryFilters.QueryMapFilter
QueryProcessorFilter that enables a
query parameter map to be filtered prior to query execution or to modify result fields after
the query is executed.
Includes operations that can change the name and/or value of a query parameter.
Can merge query fields by using the value of one input field as a name and the value of another as a value. This is useful in advanced search forms where the user selects both the field to search and its value.
Can include a IStringFilter to alter the
value of a query parameter prior to query execution.
Also enables a set of fixed parameters to be added to the query map prior to execution. Useful for scoping or narrowing a query for certain SearchSource types.
Can use an IMapFilter to perform manipulations on
the query parameter map prior to execution. This filter can be useful for putting query parameters
into a set order - for example to produce an advanced boolean query.
<SourceType name="[ name of QueryMapFilter source]"
type="QueryProcessorFilterSource"
sourceFactoryClass = "com.raritantechnologies.searchApp.QueryProcessorFilterFactory"
filterClass = "com.raritantechnologies.searchApp.queryFilters.QueryMapFilter"
inputSource = "[ name of SearchSource that the mapped query is passed to]" >
<!-- Field name Map: changes name of input field -->
<InputNameMap>
<Param ID="fieldID" />
<Param ID="fieldID" mapTo="[name in output search map]" />
<!-- Use this format to unpack a packed input parameter such as "field1=value1|field2=value2" -->
<Param ID="fieldID" fieldDelimiter="[ delimiter for packed field ]" valueDelimiter="[ separator for field/value ]" />
<!-- UseMapTo tags are used to switch mapping paths based on properties of the input parameter set -->
<Param ID="[ input parameter ID ]" mapTo="[ (optional) default mapping ]">
<!-- One or more UseMapTo Tags -->
<UseMapTo mapTo="[ alternate output name or 'NULL' to remove the parameter from the query ]"
isAnd="[ true(default) | false ]" >
<!-- One or more ValidParam Tags... -->
<ValidParam ID="param ID" value="[ value in input map or 'NULL' or 'NOT_NULL' ]" />
<!-- Alternatively, can use an IComparator to check the value of the input parameter before mapping -->
<ValidParam ID="[ param ID in input map ]" >
<Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >
</Comparator>
</ValidParam>
</UseMapTo>
<!-- Can also use an IResultMatcher to match on the entire input query at once -->
<UseMapTo mapTo="[ alternate output name or 'NULL' to remove the parameter from the query ]" >
<ResultMatcher class="[ class of com.raritantechnologies.searchApp.IResultMatcher ]" >
</ResultMatcher>
</UseMapTo>
</Param>
<-- uses one field value as search field name, another field value as the search value -->
<Param nameField="[query field with name]" valueField="field with value" >
<!-- Optional string filter that can be applied to query field's value -->
<StringFilter class="string filter class" >
</StringFilter>
</Param>
</InputNameMap>
<!-- Adds fixed parameters to query map -->
<FixedParams>
<Param ID="[new query field]" value="[its value]" />
<Param ID="[another field]" value="[its value]" />
</FixedParams>
<!-- User Params enables user login information to be used create user-specific queries -->
<!-- User parameters can be standard parameters such as NAME, PASSWORD, ALTNAME:[alternate login name ], -->
<!-- ALTPASS:[alternate login password] or an extension attribute -->
<UserParams>
<Param ID="[ User info attribute e.g. Name]" mapTo="[name in output search map]" />
<!-- Optional string filter that can be applied to the user profile value -->
<Param ID="[ user info Attribute
</UserParams>
<!-- MapFilter pluggin can make arbitrary changes to the query map -->
<MapFilter class="[ class of com.raritantechnologies.utils.filter.IMapFilter ]" >
<!-- configuration parameters for map filter -->
</MapFilter>
<!-- Result Name map: changes name of output fields in results -->
<ResultNameMap>
<Param ID="inputID" mapTo="outputID"
</ResultNameMap>
</SourceType>
| Field Summary |
| Fields inherited from class com.raritantechnologies.searchApp.QueryProcessorFilter |
theQueryProcessor |
| Constructor Summary | |
QueryMapFilter()
|
|
| Method Summary | |
java.lang.String |
createQuery(OrderedMap params,
java.lang.String language,
ILoginInfo userInfo)
|
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 loginInfo,
IResultSet resultSet)
Subclasses should override this to do meaningful work. |
java.util.List |
getErrors()
Returns the errors that occurred during the translate() step. |
void |
initialize(org.w3c.dom.Element elem)
Initializes the object from an XML tag or element. |
OrderedMap |
parse(OrderedMap inputParameters,
ILoginInfo userInfo)
|
OrderedMap |
parse(OrderedMap inputParameters,
java.lang.String language,
ILoginInfo userInfo)
Translate using the input parameters if this is how the query is passed. |
void |
setLanguage(java.lang.String language)
|
void |
setSessionID(java.lang.String id)
Allows QueryParser object to access the sessionData. |
| Methods inherited from class com.raritantechnologies.searchApp.QueryProcessorFilter |
doExecuteQuery, 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 |
public QueryMapFilter()
| 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
QueryProcessorFilter
executeQuery in interface IQueryProcessorexecuteQuery in class QueryProcessorFilterQueryProcessorException
public OrderedMap parse(OrderedMap inputParameters,
ILoginInfo userInfo)
parse in interface IQueryParser
public OrderedMap parse(OrderedMap inputParameters,
java.lang.String language,
ILoginInfo userInfo)
throws QueryParseException,
UnsupportedLanguageException
IQueryParser
parse in interface IQueryParserinputParameters - An ordered map containing the query parameterslanguage - String representing the target language (e.g. VQL)
QueryParseException
UnsupportedLanguageExceptionpublic void setLanguage(java.lang.String language)
setLanguage in interface IQueryParserpublic java.util.List getErrors()
IQueryParser
getErrors in interface IQueryParserpublic void setSessionID(java.lang.String id)
IQueryParser
setSessionID in interface IQueryParser
public java.lang.String createQuery(OrderedMap params,
java.lang.String language,
ILoginInfo userInfo)
throws QueryParseException,
UnsupportedLanguageException
createQuery in interface IQueryParserQueryParseException
UnsupportedLanguageException
public void filterResultSet(ILoginInfo loginInfo,
IResultSet resultSet)
QueryProcessorFilter
filterResultSet in class QueryProcessorFilterpublic void initialize(org.w3c.dom.Element elem)
IConfigurable
initialize in interface IQueryParserinitialize in class QueryProcessorFilter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||