AEM Query | Community
Skip to main content
Level 3
June 28, 2022
Solved

AEM Query

  • June 28, 2022
  • 3 replies
  • 1321 views

Hi Team

I have a requirement where i need to execute query to retrieve the below data.

 

Query Equivalent:-

Select page_url, published_datw,title,tags,(both on the Basic tab), content_type, content_format, category, sub-categories, article_read_time, (all on the Article Properties tab) secondary_meta_keywords, noindex, nofollow.

I have run the below query but its only gave page path, name, title and last modified date and created date but i want published date too that's why added property=@jcr:content/cq:lastReplicated.

http://localhost:4502/bin/querybuilder.json?path=/content&1_property=@jcr:content/cq:lastReplicateAction&1_property=@jcr:content/cq:lastReplicated&1_property=Activate&p.value=-1&orderby=path

Regards

Seema Kumari

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi,

try with query like below

type=cq:Page
path=/content/we-retail/us/en/products/equipment/running
orderby.sort=desc
orderby=@jcr:content/jcr:title
p.hits=selective
p.properties=jcr:path jcr:content/jcr:title jcr:content/cq:lastReplicated
p.limit=-1

Respectively to above query builder servlet path

 

http://localhost:4502/bin/querybuilder.json?orderby=%40jcr%3acontent%2fjcr%3atitle&orderby.sort=desc%20&p.hits=selective&p.limit=-1&p.properties=jcr%3apath%20jcr%3acontent%2fjcr%3atitle%20jcr%3acontent%2fcq%3alastReplicated&path=%2fcontent%2fwe-retail%2fus%2fen%2fproducts%2fequipment%2frunning&type=cq%3aPage%20 

3 replies

Anmol_Bhardwaj
Community Advisor
Community Advisor
June 28, 2022

Hi @skumari1 ,

 

What you're looking for is technically a report . 

And then you can add a query in the report and get the desired fields:

https://adobe-consulting-services.github.io/acs-aem-commons/features/report-builder/index.html 

skumari1Author
Level 3
June 28, 2022

Hi @anmol_bhardwaj 

After clicking on the link given in the doc i.e,  /etc/acs-commons/reports.html 

It's giving 404 error. Do I need to install any package to open this console?

Regards

Seema Kumari

 

Anmol_Bhardwaj
Community Advisor
Community Advisor
June 28, 2022
B_Sravan
Community Advisor
Community Advisor
June 28, 2022

Hi @skumari1 ,

If you are looking for a report as @anmol_bhardwaj  mentioned, yes you need to have acs-commons to instance.
(you can download the package or add a dependency to your project for ACS Commons, check this link: https://github.com/Adobe-Consulting-Services/acs-aem-commons/releases )

But if you are looking to retrieving the date for development purpose, you might need write a sling model where you can retrieve all the above mentioned data either through a value map or through query builder API.

Thanks,

Sravan

 

 

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
June 28, 2022

Hi,

try with query like below

type=cq:Page
path=/content/we-retail/us/en/products/equipment/running
orderby.sort=desc
orderby=@jcr:content/jcr:title
p.hits=selective
p.properties=jcr:path jcr:content/jcr:title jcr:content/cq:lastReplicated
p.limit=-1

Respectively to above query builder servlet path

 

http://localhost:4502/bin/querybuilder.json?orderby=%40jcr%3acontent%2fjcr%3atitle&orderby.sort=desc%20&p.hits=selective&p.limit=-1&p.properties=jcr%3apath%20jcr%3acontent%2fjcr%3atitle%20jcr%3acontent%2fcq%3alastReplicated&path=%2fcontent%2fwe-retail%2fus%2fen%2fproducts%2fequipment%2frunning&type=cq%3aPage%20 

Arun Patidar