Unable to get key/value using Query Builder API
I am trying to get the cq:name and dam:relativePath of PDFs found within a dam content folder. I followed this tutorial:
I have everything plugged in, debugged and working except that when I click my button to submit my AJAX call it says that no data is available. Here is my hashmap:
Map<String, String> map = new HashMap<String, String>();
map.put("type", "dam:AssetContent");
map.put("path", "/content/dam/formsanddocuments/provider-forms");
map.put("p.limit", "20");
Query query = builder.createQuery(PredicateGroup.create(map), session);
query.setStart(0);
query.setHitsPerPage(20);
SearchResult result = query.getResult();
int hitsPerPage = result.getHits().size();
Here is my AJAX call:
$(document).ready(function() {
var table = $('.forms-table').DataTable();
var submit = $('.submit');
submit.on('click', function() {
$.ajax({
type: 'GET',
url:'/bin/myCustData',
data:'type='+ 'data',
success: function(msg) {
var xml = msg;
var oTable = $('.forms-table').dataTable();
oTable.fnClearTable(true);
$(xml).find('Form').each(function() {
var $field = $(this);
var Title = $field.find('Title').text();
var Path = $field.find('Path').text();
oTable.fnAddData( [
Title,
Path
]);
});
}
});
});
});
I tested the query in the debugger and am able to yield the right properties so I'm not sure what I'm doing wrong here. Does anyone have an idea? Thank you so much in advance for your help!


