Search in sources :

Example 1 with QueryGrammerSet

use of org.apache.jackrabbit.webdav.search.QueryGrammerSet in project jackrabbit by apache.

the class SearchResourceImpl method getQueryGrammerSet.

//-------------------------------------------< SearchResource interface >---
/**
     * @see SearchResource#getQueryGrammerSet()
     */
public QueryGrammerSet getQueryGrammerSet() {
    QueryGrammerSet qgs = new QueryGrammerSet();
    try {
        QueryManager qMgr = getRepositorySession().getWorkspace().getQueryManager();
        String[] langs = qMgr.getSupportedQueryLanguages();
        for (String lang : langs) {
            // Note: Existing clients already assume that the
            // query languages returned in the DASL header are
            // not prefixed with any namespace, so we probably
            // shouldn't use an explicit namespace here.
            qgs.addQueryLanguage(lang, Namespace.EMPTY_NAMESPACE);
        }
    } catch (RepositoryException e) {
        log.debug(e.getMessage());
    }
    return qgs;
}
Also used : QueryGrammerSet(org.apache.jackrabbit.webdav.search.QueryGrammerSet) QueryManager(javax.jcr.query.QueryManager) RepositoryException(javax.jcr.RepositoryException)

Aggregations

RepositoryException (javax.jcr.RepositoryException)1 QueryManager (javax.jcr.query.QueryManager)1 QueryGrammerSet (org.apache.jackrabbit.webdav.search.QueryGrammerSet)1