com.raritantechnologies.searchApp
Interface IQueryParser

All Superinterfaces:
IConfigurable
All Known Implementing Classes:
BooleanQueryParser, ClassifierQueryParser, CopyQueryFieldParser, DynamicQueryParser, FQLQueryParser, LookupQueryParser, OpenSearchQueryParser, PatternQueryParser, PhraseQueryParser, QueryMapFilter, QueryResultSetReaderParser, RQLMapQueryParser, RulesQueryParser, SelectResultTypeQueryParser, SequentialQueryParser, SystemObjectQueryParser, TopicQueryParser, XMLQueryParser, XPathQueryParser, XQueryParser

public interface IQueryParser
extends IConfigurable

Query Parser Interface: Allows a common language to be parsed into the native tongue of a SearchSource.

Query Parser has a type - based on the input form which passes the parameters to the processor. Has a protocol (implementation) based on what data source it is searching. The data source is represented by an associated SearchSource object that maintains connection/configuration information.

IQueryParsers are associated with a SearchSource object. The SearchSource defines the specific characteristics of a data source such as a web site, Verity collection or SQL-compliant database. IQueryParser contains the code needed to parse a query in any language into the source-specific information that is needed for the search source's IQueryProcessors executeQuery() method. The sourceLanguage attribute specifies from which language you are translating from.


Developed by Raritan Technologies .

Author:
Kepler Gelotte

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.
 

Method Detail

parse

public OrderedMap parse(OrderedMap params,
                        java.lang.String language,
                        ILoginInfo userInfo)
                 throws QueryParseException,
                        UnsupportedLanguageException
Translate using the input parameters if this is how the query is passed.

Parameters:
params - An ordered map containing the query parameters
language - String representing the target language (e.g. VQL)
Throws:
QueryParseException
UnsupportedLanguageException

parse

public OrderedMap parse(OrderedMap params,
                        ILoginInfo userInfo)

setLanguage

public void setLanguage(java.lang.String language)

createQuery

public java.lang.String createQuery(OrderedMap params,
                                    java.lang.String language,
                                    ILoginInfo userInfo)
                             throws QueryParseException,
                                    UnsupportedLanguageException
Throws:
QueryParseException
UnsupportedLanguageException

getErrors

public java.util.List getErrors()
Returns the errors that occurred during the translate() step.

Returns:
the list of error(s) (if any) that occurred.

setSessionID

public void setSessionID(java.lang.String id)
Allows QueryParser object to access the sessionData.


initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable