|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.searchApp.queryFilters.PatternQueryParser
Uses a String pattern template to parse one or more query (or user) fields into a query string.
XML Configuration Template:
<QueryParser class="com.raritantechnologies.searchApp.queryFilters.PatternQueryParser"
outputField="[ name of field to get parsed query ]" >
<!-- Optional field filters that apply a filter to a query or user value prior to inserting the -->
<!-- value into the template -->
<FieldFilters>
<Filter ID="[ query or user field ]"
class="[ class of com.raritantechnologies.utils.filter.IStringFilter ]" >
</Filter>
</FieldFilters>
<!-- ========================================================= -->
<!-- String template that result field values will be inserted -->
<!-- into. If this is HTML or XML, the template block should be -->
<!-- wrapped in a <!CDATA[ ]]> section. -->
<!-- ========================================================= -->
<Template>
Display string with {fieldname} sections that will be replaced with input query parameter values
{USER:param} sections will have user parameters where param can be NAME|PASSWORD|ALTNAME:[loginName]|ALTPASS:[loginName]
or an attribute
inserted by the PatternResultRenderer.
</Template>
</QueryParser>
| Constructor Summary | |
PatternQueryParser()
|
|
| Method Summary | |
java.lang.String |
createQuery(OrderedMap params,
java.lang.String language,
ILoginInfo userInfo)
|
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 params,
ILoginInfo userInfo)
|
OrderedMap |
parse(OrderedMap params,
java.lang.String language,
ILoginInfo userInfo)
Translate using the input parameters if this is how the query is passed. |
static java.lang.String |
resolvePattern(OrderedMap params,
ILoginInfo userInfo,
java.lang.String queryTemplate,
java.util.HashMap fieldFilterMap,
java.lang.String startBrace,
java.lang.String endBrace)
|
void |
setLanguage(java.lang.String language)
|
void |
setSessionID(java.lang.String sessionID)
Allows QueryParser object to access the sessionData. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PatternQueryParser()
| Method Detail |
public OrderedMap parse(OrderedMap params,
java.lang.String language,
ILoginInfo userInfo)
throws QueryParseException,
UnsupportedLanguageException
IQueryParser
parse in interface IQueryParserparams - An ordered map containing the query parameterslanguage - String representing the target language (e.g. VQL)
QueryParseException
UnsupportedLanguageException
public OrderedMap parse(OrderedMap params,
ILoginInfo userInfo)
parse 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 static java.lang.String resolvePattern(OrderedMap params,
ILoginInfo userInfo,
java.lang.String queryTemplate,
java.util.HashMap fieldFilterMap,
java.lang.String startBrace,
java.lang.String endBrace)
public void setLanguage(java.lang.String language)
setLanguage in interface IQueryParserpublic java.util.List getErrors()
IQueryParser
getErrors in interface IQueryParserpublic void setSessionID(java.lang.String sessionID)
IQueryParser
setSessionID in interface IQueryParserpublic void initialize(org.w3c.dom.Element elem)
IConfigurable
initialize in interface IQueryParser
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||