@SuppressWarnings( "deprecation" ) @Test public void shouldQueryRepository() throws Exception { QueryResult queryResult = REST_CLIENT.query("SELECT node.[jcr:path] FROM [mode:root] AS node", Query.JCR_SQL2); assertQueryResult(queryResult); queryResult = REST_CLIENT.query("SELECT jcr:path FROM mode:root", Query.SQL); assertQueryResult(queryResult); queryResult = REST_CLIENT.query(" assertQueryResult(queryResult); }
public QueryResult query( String query, String queryLanguage ) { String url = jsonRestClient.appendToURL(QUERY_METHOD); String contentType = contentTypeForQueryLanguage(queryLanguage); JSONRestClient.Response response = jsonRestClient.postStream(new ByteArrayInputStream(query.getBytes()), url, contentType); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new QueryResult(response.json()); }
ModeShapeRestClient { public QueryResult query( String query, String queryLanguage ) { String url = jsonRestClient.appendToURL(QUERY_METHOD); String contentType = contentTypeForQueryLanguage(queryLanguage); JSONRestClient.Response response = jsonRestClient.postStream(new ByteArrayInputStream(query.getBytes()), url, contentType); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new QueryResult(response.json()); } }
ModeShapeRestClient { public QueryResult query( String query, String queryLanguage ) { String url = jsonRestClient.appendToURL(QUERY_METHOD); String contentType = contentTypeForQueryLanguage(queryLanguage); JSONRestClient.Response response = jsonRestClient.postStream(new ByteArrayInputStream(query.getBytes()), url, contentType); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new QueryResult(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); }
ModeShapeRestClient { public QueryResult query( String query, String queryLanguage ) { String url = jsonRestClient.appendToURL(QUERY_METHOD); String contentType = contentTypeForQueryLanguage(queryLanguage); JSONRestClient.Response response = jsonRestClient.postStream(new ByteArrayInputStream(query.getBytes()), url, contentType); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new QueryResult(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); String serverUrl(); Repositories getRepositories(); Repositories.Repository getRepository( String name ); Workspaces getWorkspaces( String repositoryName ); NodeTypes getNodeTypes(); QueryResult query( String query,
                              String queryLanguage ); String queryPlan( String query,
                             String queryLanguage ); }
ModeShapeRestClient { public QueryResult query( String query, String queryLanguage ) { String url = jsonRestClient.appendToURL(QUERY_METHOD); String contentType = contentTypeForQueryLanguage(queryLanguage); JSONRestClient.Response response = jsonRestClient.postStream(new ByteArrayInputStream(query.getBytes()), url, contentType); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(url, response.asString())); } return new QueryResult(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); String serverUrl(); Repositories getRepositories(); Repositories.Repository getRepository( String name ); Workspaces getWorkspaces( String repositoryName ); NodeTypes getNodeTypes(); QueryResult query( String query,
                              String queryLanguage ); String queryPlan( String query,
                             String queryLanguage );  }