Hi Team,
I'm new to the Experience Manager and JCR repository. I have to implement a JCR Query to fetch the values from a content node.
Example: The content folder under several nodes.
/content/folder1/folder2/data1, /content/folder1/folder2/data2 with some properties inside it.
The data under folder2 in json format looks in this way:
{
"sling:resourceType": "xyz/exp-manager",
"jcr:primaryType": "xyz:adobe",
"test": "hi",
"list": {
"0": {
"ids": [],
"sling:resourceType": "xyz/list",
"jcr:primaryType": "nt:unstructured"
},
"jcr:primaryType": "nt:unstructured"
},
"adobe": {
"text1": "hello,
}
}
In this way i have several folder under content. Now I have to implement a query to fetch the id's available under list node in all the folders.
Is this possible to achieve it. Please help in resolving it.
Thanks,
Varun.
Views
Replies
Total Likes
Once you query the list node, you can read the ID property by using syntax to read an Array.
Once you get the node that contains this property - you can get the array by using this JCR API code;
Property references = node.getProperty(
"id"
);
Value[] values = references.getValues();
String myId = values[
0
].getString();
Hope this helps...
Views
Replies
Total Likes
As you are new to AEM - read this article on how to use QueryBuilder API -- Adobe Experience Manager Help | Creating Adobe Experience Manager OSGi bundles that use the Query Bu...
Views
Replies
Total Likes