|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.rql.map.RQLMapQueryParser
Converts an RTI RQLMap format to a format that can be executed by a Search Source. The RQLMapQueryParser uses
an RQLMapTopicBuilder to convert the RQLMap into a
TopicSet which is then
translated to a query string by an ITopicRenderer.
An RQLMap is an ordered set of name=value pairs that expresses an advanced query using prefix notation:
Example: (Title contains 'Java' OR Author contains 'Eckel)
AND ( Publish_Date > 9/1/1990 AND Publish_Date < 12/31/1999)
_NAME_1 = 'Optional topic name'
_BOOL_OP_1 = AND // BOOL_OP operate across fields
_BOOL_OP_2 = OR // Possible values are AND, OR, NOT, NEAR/n/Ordered, PHRASE, RANGE
_FIELD_1 = Title
_VALUE_1 = Java
_FIELD_2 = Author
_VALUE_2 = Eckel
_END_OP_2 = BOOL_OP_2
_BOOL_OP_3 = RANGE
_FIELD_OP_1 = GT // possible values are LT, LTE, GT, GTE, EQ, ANY, ALL, NOT
_FIELD_3 = Publish_Date
_VALUE_3 = 9/1/1990
_FIELD_OP_2 = LT
_FIELD_4 = Publish_Date
_VALUE_4 = 12/31/1999
_END_OP_3 = BOOL_OP_3
_END_OP_1 = BOOL_OP_1
Default behavior: find all "_FIELD_[x] and matching _VALUE_[x] and collapse to single fields.
XML Configuration Template:
<QueryParser class="com.raritantechnologies.rql.map.RQLMapQueryParser"
outputField="[ field that gets parsed RQL map ]" >
<TopicRenderer class="[ class of com.raritantechnologies.rql.topic.ITopicRenderer ]" >
</TopicRenderer>
</QueryParser>
| Constructor Summary | |
RQLMapQueryParser()
|
|
RQLMapQueryParser(java.lang.String topicField,
ITopicRenderer topicRenderer)
|
|
| 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. |
void |
setLanguage(java.lang.String language)
|
void |
setSessionID(java.lang.String id)
Allows QueryParser object to access the sessionData. |
void |
setTopicRenderer(ITopicRenderer topicRenderer)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RQLMapQueryParser()
public RQLMapQueryParser(java.lang.String topicField,
ITopicRenderer topicRenderer)
| 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 IQueryParserpublic void setLanguage(java.lang.String language)
setLanguage in interface IQueryParser
public java.lang.String createQuery(OrderedMap params,
java.lang.String language,
ILoginInfo userInfo)
throws QueryParseException,
UnsupportedLanguageException
createQuery in interface IQueryParserQueryParseException
UnsupportedLanguageExceptionpublic java.util.List getErrors()
getErrors in interface IQueryParserpublic void setSessionID(java.lang.String id)
setSessionID in interface IQueryParserpublic void initialize(org.w3c.dom.Element elem)
IConfigurable
initialize in interface IQueryParserpublic void setTopicRenderer(ITopicRenderer topicRenderer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||