|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.rql.topic.TopicQueryParser
QueryParser that uses a TopicSet as a intermediate
query model. Converts a topicID to a query string
using one or more ITopicRenderers mapped to a "language" setting.
<QueryParser class="com.raritantechnologies.rql.topic.TopicQueryParser"
topicIDField="[ parameter field to get topicID for the output ]"
topicName="[ name of topic that will be extracted from the TopicSet (if a TopicSetBuilder is used ) ]"
parsedQueryField="[ parameter field to put parsed query (output) ]" >
<!-- Option 1: Use an ITopicSetBuilder to create the TopicSet from the input query map -->
<TopicSetBuilder class="[ class of com.raritantechnologies.rql.topic.ITopicSetBuilder ]" >
<!-- configuration parameters for TopicSetBuilder -->
</TopicSetBuilder>
<!-- Option 2: Use an ITopicParser to convert a incoming query to a TopicSet -->
<TopicParser class="[ class of com.raritantechnologies.rql.topic.ITopicParser ]"
inputField="[ field that contains the incoming query to be translated ]" >
</TopicParser>
<!-- One or more com.raritantechnologies.rq1.topic.ITopicRenderer elements. The first will be the default if none has the default="true" attribute -->
<TopicRenderer language="[ language for this renderer ]"
class="[ class or com.raritantechnologies.rql.topic.ITopicRenderer ]"
default="[true|false(default)" >
</TopicRenderer>
<!-- etc. . . -->
</QueryParser>
| Constructor Summary | |
TopicQueryParser()
|
|
| 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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TopicQueryParser()
| 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()
IQueryParser
getErrors in interface IQueryParserpublic void setSessionID(java.lang.String id)
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 | |||||||||