Search code examples
aemquery-builder

AEM CURL - Need specific property and value shown in JSON response for Query without knowing the value


I have a query that I am using to access a specific property on an AEM page. What I need to do is display the property and its value in the JSON response without knowing the value of the property.

What I have right now looks like

http://localhost:4502/bin/querybuilder.json?1_property=dnt_productPath&path=<path to page>

Which obviously isn't working. I have used these types of queries to find pages that have certain property values set to true, but this is technically the inverse. I know the page, and need the value of the property.

Anybody have any thoughts?


Solution

  • http://localhost:4502/bin/querybuilder.json?p.properties=dnt_productPath&path=<path to page>
    

    One option would be something like this if you just want to see anything that has the property:

    property=dnt_productPath
    property.operation=exists
    p.properties=dnt_productPath
    

    Also, you can specify which properties you want back using this: p.properties=<space delimited list of the properties you want>

    For example:

    p.properties=jcr:path cq:lastReplicationAction cq:lastReplicated cq:lastModified cq:template
    

    Or

    p.properties=jcr:path jcr:content/metadata/photoshop:DocumentAncestors
    

    URI encoded: p.properties=jcr%3apath jcr%3acontent%2fmetadata%2fphotoshop%3aDocumentAncestors

    So think of the "1_property" as the filter that is only needed if you are going to limit the results somehow, and "p.properties" as defining what parts of the results you want to see.

    These links may also be helpful:

    https://github.com/paulrohrbeck/aem-links/blob/master/querybuilder_cheatsheet.md

    http://www.aemcq5tutorials.com/tutorials/adobe-aem-cq5-tutorials/aem-query-builder/