use of com.day.cq.wcm.core.contentfinder.ViewQuery in project acs-aem-commons by Adobe-Consulting-Services.
the class QueryBuilderViewHandler method createQuery.
@Override
protected ViewQuery createQuery(SlingHttpServletRequest slingRequest, Session session, String queryString) throws Exception {
final ResourceResolver resolver = slingRequest.getResourceResolver();
final QueryBuilder qb = resolver.adaptTo(QueryBuilder.class);
Map<String, String> map;
if (GQLToQueryBuilderConverter.convertToQueryBuilder(slingRequest)) {
map = this.convertToQueryBuilderParams(slingRequest, queryString);
log.debug("Forced QueryBuilder Parameter Map: {}", map);
} else {
map = this.getQueryBuilderParams(slingRequest, queryString);
log.debug("Converted QueryBuilder Parameter Map: {}", map);
}
final Query query = qb.createQuery(PredicateGroup.create(map), session);
return new QueryBuilderViewQuery(query);
}
Aggregations