@Override public String[] getSupportedQueryLanguages() throws RepositoryException { return this.queryManager.getSupportedQueryLanguages(); }
/** * @inheritDoc */ public String[] getSupportedQueryLanguages() throws RepositoryException { return manager.getSupportedQueryLanguages(); }
@Override public String[] getSupportedQueryLanguages() throws RepositoryException { return delegate.getSupportedQueryLanguages(); } }
/** * @param language a query language. * @return <code>true</code> if <code>language</code> is supported; * <code>false</code> otherwise. * @throws RepositoryException if an error occurs. */ protected boolean isSupportedLanguage(String language) throws RepositoryException { return Arrays.asList(qm.getSupportedQueryLanguages()).contains(language); } }
/** * @return a basic XPath statement to test order by queries. Returns * <code>null</code> is XPath is not supported. * @throws RepositoryException if an error occurs. */ protected String createXPath() throws RepositoryException { List<String> languages = Arrays.asList(superuser.getWorkspace().getQueryManager().getSupportedQueryLanguages()); if (languages.contains(qsXPATH)) { return xpathRoot + "/*[@jcr:primaryType='" + testNodeType + "'] order by @" + propertyName1; } else { return null; } }
/** {@inheritDoc} */ public String[] getSupportedQueryLanguages() throws RepositoryException, RemoteException { try { return manager.getSupportedQueryLanguages(); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
public String[] getSupportedQueryLanguages() throws RepositoryException { return getDelegate().getSupportedQueryLanguages(); } }
public String[] execute() throws Exception { return getDelegate().getSupportedQueryLanguages(); } });
public void testUnknownQueryLanguage() throws RepositoryException { List<String> supported = Arrays.asList(qm.getSupportedQueryLanguages()); String language; do { language = createRandomString(5); } while (supported.contains(language)); try { qm.createQuery("foo", language); fail("createQuery() must throw for unknown query language: " + language); } catch (InvalidQueryException e) { // expected } } }
/** * {@inheritDoc} */ public String[] getSupportedQueryLanguages(SessionInfo sessionInfo) throws RepositoryException { SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo); return sInfo.getSession().getWorkspace().getQueryManager().getSupportedQueryLanguages(); }
/** * {@inheritDoc} */ public String[] getSupportedQueryLanguages(SessionInfo sessionInfo) throws RepositoryException { SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo); return sInfo.getSession().getWorkspace().getQueryManager().getSupportedQueryLanguages(); }
/** * Tests if all implementations return {@link Query#JCR_SQL2} with * {@link QueryManager#getSupportedQueryLanguages()}. Tests if repositores * that have the SQL descriptor set in the repository return {@link Query#SQL}. */ public void testGetSupportedQueryLanguages() throws RepositoryException { List<String> langs = Arrays.asList(session.getWorkspace().getQueryManager().getSupportedQueryLanguages()); // all repositories must support XPath assertTrue("JCR_SQL2 not returnd with QueryManager.getSupportedQueryLanguages(), got: " + langs, langs.contains(Query.JCR_SQL2)); // if repository descriptor for sql is present also sql must be returned if (isSupported(Repository.OPTION_QUERY_SQL_SUPPORTED)) { assertTrue("SQL not returned with QueryManager.getSupportedQueryLanguages(), got: " + langs, langs.contains(qsSQL)); } } }
@Override public String[] getSupportedLanguages(final ResolveContext<JcrProviderState> ctx) { try { return ctx.getProviderState().getSession().getWorkspace().getQueryManager().getSupportedQueryLanguages(); } catch (final RepositoryException e) { throw new SlingException("Unable to discover supported query languages", e); } }
/** * @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; }