API Reference:
@Reference
QueryBuilder queryBuilder;
Session session = repository.loginAdministrative(null);
String resourcePath="/content/sample/site-demo/en";
Map<String, String> searchMap = new HashMap<String, String>();
searchMap.put("type", "cq:Page");
searchMap.put("path", resourcePath);
searchMap.put("property", "jcr:content/cq:template");
searchMap.put("property.value", "/apps/common/templates/sampleview");
searchMap.put("p.limit", "-1");
Query query = queryBuilder.createQuery(PredicateGroup.create(searchMap),session);
SearchResult result = query.getResult();
for(Hit hit:result.getHits()) {
String pagePath = hit.getPath();
Node pageNode = hit.getNode
}
QueryBuilder queryBuilder;
Session session = repository.loginAdministrative(null);
String resourcePath="/content/sample/site-demo/en";
Map<String, String> searchMap = new HashMap<String, String>();
searchMap.put("type", "cq:Page");
searchMap.put("path", resourcePath);
searchMap.put("property", "jcr:content/cq:template");
searchMap.put("property.value", "/apps/common/templates/sampleview");
searchMap.put("p.limit", "-1");
Query query = queryBuilder.createQuery(PredicateGroup.create(searchMap),session);
SearchResult result = query.getResult();
for(Hit hit:result.getHits()) {
String pagePath = hit.getPath();
Node pageNode = hit.getNode
}
No comments:
Post a Comment
If you have any doubts or questions, please let us know.