info.magnolia.cms.core.search
Interface QueryManager

All Known Implementing Classes:
QueryManagerImpl

public interface QueryManager

Equivalent to QueryManager but using Content objects. Date: Apr 4, 2005 Time: 11:00:02 AM

Author:
Sameer Charles

Method Summary
 Query createQuery(String statement, String language)
          Description inherited from javax.jcr.query.QueryManager#createQuery(String, String)
Creates a new query by specifying the query statement itself and the language in which the query is stated.
 Query getQuery(javax.jcr.Node node)
          Description inherited from javax.jcr.query.QueryManager#getQuery(javax.jcr.Node)
Retrieves an existing persistent query.
 String[] getSupportedQueryLanguages()
          Description inherited from javax.jcr.query.QueryManager#getSupportedQueryLanguages()
Returns an array of strings representing all query languages supported by this repository.
 

Method Detail

createQuery

Query createQuery(String statement,
                  String language)
                  throws javax.jcr.query.InvalidQueryException,
                         javax.jcr.RepositoryException
Description inherited from javax.jcr.query.QueryManager#createQuery(String, String)
Creates a new query by specifying the query statement itself and the language in which the query is stated. If the query statement is syntactically invalid, given the language specified, an InvalidQueryException is thrown. The language must be a string from among those returned by QueryManager.getSupportedQueryLanguages(); if it is not, then an InvalidQueryException is thrown.

Returns:
A Query object.
Throws:
javax.jcr.query.InvalidQueryException - if statement is invalid or language is unsupported.
javax.jcr.RepositoryException - if another error occurs

getQuery

Query getQuery(javax.jcr.Node node)
               throws javax.jcr.query.InvalidQueryException,
                      javax.jcr.RepositoryException
Description inherited from javax.jcr.query.QueryManager#getQuery(javax.jcr.Node)
Retrieves an existing persistent query. If node is not a valid persisted query (that is, a node of type nt:query), an InvalidQueryException is thrown.

Persistent queries are created by first using QueryManager.createQuery to create a Query object and then calling Query.save to persist the query to a location in the workspace.

Parameters:
node - a persisted query (that is, a node of type nt:query).
Returns:
a Query object.
Throws:
javax.jcr.query.InvalidQueryException - If node is not a valid persisted query (that is, a node of type nt:query).
javax.jcr.RepositoryException - if another error occurs

getSupportedQueryLanguages

String[] getSupportedQueryLanguages()
                                    throws javax.jcr.RepositoryException
Description inherited from javax.jcr.query.QueryManager#getSupportedQueryLanguages()
Returns an array of strings representing all query languages supported by this repository. In level 1 this set must include the string represented by the constant Query.XPATH. If SQL is supported it must additionally include the string represented by the constant Query.SQL. An implementation may also support other languages as well. See Query.

Returns:
An string array.
Throws:
javax.jcr.RepositoryException - if an error occurs.


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.