How can we find empty page list using query builder in AEM.
Solved! Go to Solution.
Views
Replies
Total Likes
@vijitha : thanks for providing further details.
I do not think you can get the list of all such pages using querybuilder debugger alone.
You will have to use query + additional filtering on the results using java/groovy etc. You will be able to do this on local instance and will have to get content packages from your working instance.
Create a servlet so that you have a trigger point/url to run this.
You can refer this for Querybuilder Java API - https://medium.com/@manumathew28.94/query-builder-aem-5869a1850c85
thanks.
@vijitha : It is difficult to classify a empty page as Pages are basically nodes and properties. Every page that gets created has some nodes and properties such as pagename/jcr:content, jcr:title, cq:template etc.
I assume that you want to find pages which does not have any component dropped on it which again is very tricky as you may have your templates with initial content which will create pages with that initial content so you will always end up having some nodes in the page on creation itself.
If you have an identifier for an empty page which gets stored at jcr:content node of the page for eg, then you can do a query for that property and get the list of such pages.
Please refer this querybuilder cheatsheet to see what you can use to build your queries: https://github.com/paulrohrbeck/aem-links/blob/master/querybuilder_cheatsheet.md
Thanks for your reply. your assumption is correct.I don't see any specific identifer to write queryto get empty page list . As you said while creating page with template will be having some nodes so I have deleted those nodes and it looks like below.
@vijitha : thanks for providing further details.
I do not think you can get the list of all such pages using querybuilder debugger alone.
You will have to use query + additional filtering on the results using java/groovy etc. You will be able to do this on local instance and will have to get content packages from your working instance.
Create a servlet so that you have a trigger point/url to run this.
You can refer this for Querybuilder Java API - https://medium.com/@manumathew28.94/query-builder-aem-5869a1850c85
thanks.
Hi @vijitha ,
By empty page I'm assuming you are trying to find pages which doesn't have jcr:content node. That means it will not have "jcr:primaryType" for "jcr:content" node.
Please try to use below query in your query builder, it should give you the results.
type=cq:Page
path=/content/<sample-page-path>
property=jcr:content/jcr:primaryType
property.operation=not
Thanks
Tarun
Hi @TarunKumar
Thanks for your reply.I have jcr:content node for page and inside jcr:content I see two responsive grid nodes and under one responsive grid I see page title component. Do we have any way to check if the page is having only page title component.I have written below query to get page list but it's giving all the pages where we have page title component but I need the list where we have empty page or if it has only the page title component.
path=/content/****
property=jcr:content/cq:template
property.value=/conf/****/settings/wcm/templates/***
property.operation=like
property.1_property=apps/****/components/content/page-title
property.1_property.operation=exists
Hi @vijitha ,
If you need pages which contain specific component like "page title component " in your case, please try to use sling:resourceType in your query builder for property and for value use its corresponding value.
something like below:-
path=/content/<sapmle-page-path>
1_property=sling:resourceType
1_property.value=<resource-type>/<value>/<your-page-title-component>
Thanks
tarun
@vijitha Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies