org.apache.slide.search
Class SearchImpl

java.lang.Object
  extended byorg.apache.slide.search.SearchImpl
All Implemented Interfaces:
Search

public class SearchImpl
extends java.lang.Object
implements Search

Search helper.

Version:
$Revision: 1.21 $

Constructor Summary
SearchImpl(Namespace namespace, NamespaceConfig namespaceConfig, Structure structureHelper, Content contentHelper)
          Constructor.
 
Method Summary
 SearchQuery createSearchQuery(java.lang.String grammarUri, org.jdom.Element queryElement, SlideToken token, int maxDepth)
          Creates a SearchQuery.
 SearchQuery createSearchQuery(java.lang.String grammarUri, org.jdom.Element searchRequestElement, SlideToken token, int maxDepth, PropertyProvider propertyProvider)
          Creates a SearchQuery.
 SearchQuery createSearchQuery(java.lang.String grammarUri, org.jdom.Element searchRequestElement, SlideToken token, int maxDepth, PropertyProvider propertyProvider, java.lang.String requestUri)
          Creates a SearchQuery.
 SearchQuery createSearchQuery(java.lang.String grammarUri, org.jdom.Element queryElement, SlideToken token, int maxDepth, java.lang.String requestUri)
          Creates a SearchQuery.
 SearchLanguage getLanguage(java.lang.String grammarUri)
          Retrieve a SearchLanguage identified by the grammar uri (namespace)
 SearchLanguage[] getSupportedLanguages()
          Return the allowed query languages.
 SearchQueryResult search(SlideToken token, SearchQuery query)
          Search.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchImpl

public SearchImpl(Namespace namespace,
                  NamespaceConfig namespaceConfig,
                  Structure structureHelper,
                  Content contentHelper)
Constructor.

Parameters:
namespace - Namespace
namespaceConfig - Namespace configuration
Method Detail

search

public SearchQueryResult search(SlideToken token,
                                SearchQuery query)
                         throws ServiceAccessException,
                                VetoException
Search.

Specified by:
search in interface Search
Parameters:
token - Credentials token
query - The query to execute
Returns:
the SearchQueryResult
Throws:
ServiceAccessException - DataSource access error
VetoException

getSupportedLanguages

public SearchLanguage[] getSupportedLanguages()
Return the allowed query languages.

Specified by:
getSupportedLanguages in interface Search

getLanguage

public SearchLanguage getLanguage(java.lang.String grammarUri)
                           throws BadQueryException
Retrieve a SearchLanguage identified by the grammar uri (namespace)

Specified by:
getLanguage in interface Search
Parameters:
grammarUri - identifier for the SearchLanguage
Returns:
the SearchLanguage
Throws:
BadQueryException

createSearchQuery

public SearchQuery createSearchQuery(java.lang.String grammarUri,
                                     org.jdom.Element queryElement,
                                     SlideToken token,
                                     int maxDepth)
                              throws BadQueryException
Creates a SearchQuery.

Specified by:
createSearchQuery in interface Search
Parameters:
grammarUri - identifier for the SearchLanguage
queryElement - the JDOM element containing the query
token - the SlideToken
maxDepth - may be 0, 1 or INFINIT
Returns:
the SearchQuery
Throws:
BadQueryException

createSearchQuery

public SearchQuery createSearchQuery(java.lang.String grammarUri,
                                     org.jdom.Element searchRequestElement,
                                     SlideToken token,
                                     int maxDepth,
                                     PropertyProvider propertyProvider)
                              throws BadQueryException
Creates a SearchQuery.

Specified by:
createSearchQuery in interface Search
Parameters:
grammarUri - identifier for the SearchLanguage.
searchRequestElement - the JDOM element containing the query
token - the SlideToken.
maxDepth - may be 0, 1 or INFINITY.
propertyProvider - the PropertyProvider to use (may be null).
Returns:
the SearchQuery
Throws:
BadQueryException

createSearchQuery

public SearchQuery createSearchQuery(java.lang.String grammarUri,
                                     org.jdom.Element queryElement,
                                     SlideToken token,
                                     int maxDepth,
                                     java.lang.String requestUri)
                              throws BadQueryException
Creates a SearchQuery.

Specified by:
createSearchQuery in interface Search
Parameters:
grammarUri - identifier for the SearchLanguage
queryElement - the JDOM element containing the query
token - the SlideToken
maxDepth - may be 0, 1 or INFINIT
requestUri - the URI of the request.
Returns:
the SearchQuery
Throws:
BadQueryException

createSearchQuery

public SearchQuery createSearchQuery(java.lang.String grammarUri,
                                     org.jdom.Element searchRequestElement,
                                     SlideToken token,
                                     int maxDepth,
                                     PropertyProvider propertyProvider,
                                     java.lang.String requestUri)
                              throws BadQueryException
Creates a SearchQuery.

Specified by:
createSearchQuery in interface Search
Parameters:
grammarUri - identifier for the SearchLanguage.
searchRequestElement - the JDOM element containing the query
token - the SlideToken.
maxDepth - may be 0, 1 or INFINITY.
propertyProvider - the PropertyProvider to use (may be null).
requestUri - the URI of the request.
Returns:
the SearchQuery
Throws:
BadQueryException