Can you use AEM Query Builder to pull Metadata values as JSON? | Community
Skip to main content
Level 2
Apr 1, 2022 8:02 PM UTC
Solved

Can you use AEM Query Builder to pull Metadata values as JSON?

We are wanting to create a string of metadata values that will return only those wanted values as JSON. Can AEM Query builder be used to build this query or test it? If so, are there are documents around what metadata values are available?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
DEBAL_DAS
DEBAL_DASAccepted solution
New Participant
Apr 2, 2022 5:29 AM UTC

Let's assume I am targeting list of properties like dc:format , dam:size, dc:modified of each asset under specific DAM path /content/dam/we-retail/en/people/mens

So here is my query -

 

type=dam:Asset
path=/content/dam/we-retail/en/people/mens
p.hits=selective
p.properties=jcr:content/metadata/dc:format jcr:content/metadata/dam:size jcr:content/metadata/dc:modified

 

using p.properties , I have specified the properties I want to get in as shown below -

Now if I copy and JSON QueryBuilder link as shown below -

 

http://localhost:7070/bin/querybuilder.json?p.hits=selective&p.properties=jcr%3acontent%2fmetadata%2fdc%3aformat%20jcr%3acontent%2fmetadata%2fdam%3asize%20jcr%3acontent%2fmetadata%2fdc%3amodified&path=%2fcontent%2fdam%2fwe-retail%2fen%2fpeople%2fmens&type=dam%3aAsset

 

Then I am getting  below JSON response -

 

Are you expecting this? Please correct me.

 

Please refer this: https://experienceleague.adobe.com/docs/experience-manager-65/developing/platform/query-builder/querybuilder-api.html?lang=en

 

 

 

 

3 replies

srnya
Level 2
Apr 2, 2022 1:46 PM UTC

@jwendling 
AEM Query builder can be used to query the repository and get a list of nodes (javax.jcr.node) or hits (com.day.cq.search.result.Hit)

To get specific properties or metadata from each node, we will have to have custom implementations, via a sling model/OSGi servlet/OSGi service.
Hope this helps.

 

 

 

 

 

 

Translate
DEBAL_DAS
DEBAL_DASAccepted solution
New Participant
Apr 2, 2022 5:29 AM UTC

Let's assume I am targeting list of properties like dc:format , dam:size, dc:modified of each asset under specific DAM path /content/dam/we-retail/en/people/mens

So here is my query -

 

type=dam:Asset
path=/content/dam/we-retail/en/people/mens
p.hits=selective
p.properties=jcr:content/metadata/dc:format jcr:content/metadata/dam:size jcr:content/metadata/dc:modified

 

using p.properties , I have specified the properties I want to get in as shown below -

Now if I copy and JSON QueryBuilder link as shown below -

 

http://localhost:7070/bin/querybuilder.json?p.hits=selective&p.properties=jcr%3acontent%2fmetadata%2fdc%3aformat%20jcr%3acontent%2fmetadata%2fdam%3asize%20jcr%3acontent%2fmetadata%2fdc%3amodified&path=%2fcontent%2fdam%2fwe-retail%2fen%2fpeople%2fmens&type=dam%3aAsset

 

Then I am getting  below JSON response -

 

Are you expecting this? Please correct me.

 

Please refer this: https://experienceleague.adobe.com/docs/experience-manager-65/developing/platform/query-builder/querybuilder-api.html?lang=en

 

 

 

 

Translate
Nitin_laad
New Participant
Apr 1, 2022 8:24 PM UTC