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!
Solved! Go to Solution.
That error means that the POM file was not properly setup. Can you build your bundle - including the POM dependencies as shown in the artilce. You also have to setup the system user and permissions as stated. If you would like - we can setup a BLUEJEAN call and i wcan walk you through the process.
When you click the button - look at the network tab in chrome - are you getting 200 as the HTTP response.
When you follow that tutorial and pull in Employee data -- as shown in the example (install the package) - do you see the component populated with data?
This works - watch the video at end of article.
Views
Replies
Total Likes
Also - make sure you OSGi bundle is in active state - check that HTTP Response code.
Views
Replies
Total Likes
Did you create a system user and setup the Sling Mapping Service config too. You need to do that!
Views
Replies
Total Likes
Just retested - if you follow the article - you will get this result:
Views
Replies
Total Likes
As Scott mentioned , could you please check if the service is returning 200 OK in the network tab ? If no, please pull the error logs.Your error log should be able to tell you what is failing in your case. If hyou can share the same we can guide you what went wrong
Thanks
Veena
Views
Replies
Total Likes
For now - follow the article to see if you can pull a result set, etc. Once you know its working - you can try and modify the Query Builder code.
Views
Replies
Total Likes
So, I received a 200 HTTP response for that implementation, but I went ahead made the code consistent with the tutorial verbatim. I am still getting a 200 HTTP response but no data.
I checked and everything is consistent down to the 'data' user and User Service Mapping.
I did validate my package and received this error:
1 unsatisfied OSGi package import in 1 bundle.
1. Unsatisfied package import javax.inject-[0.0.0,1.0.0) in bundle Demo_Site.Demo.core-1.0.0.SNAPSHOT present at OSGi
Following 1 bundle will go from 'Active' to 'Installed' state if you install this content package.
1. Demo_Site.Demo.core-1.0.0.SNAPSHOT
The javax.inject is referring to the HelloWord java model though I'm not sure if this is relevant.
Thanks again for your help!
EDIT:
Also, I see the employee data under /content/employees and, I did confirm, the bundle is in an active state.
Views
Replies
Total Likes
Does the bundle location matter? Mine is found at
`jcrinstall:/apps/QUeryJCR64/install/QUeryJCR64.core-1.0-SNAPSHOT.jar`
Views
Replies
Total Likes
That error means that the POM file was not properly setup. Can you build your bundle - including the POM dependencies as shown in the artilce. You also have to setup the system user and permissions as stated. If you would like - we can setup a BLUEJEAN call and i wcan walk you through the process.
That was it! As always, thank you so much for sharing your expertise and helping me solve this issue!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies