Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Create Restful Service to expose pages having some taxonomy in XML format

Avatar

Level 1

How to Create Restful Service to expose pages having some taxonomy in XML format

1 Accepted Solution

Avatar

Correct answer by
Level 6

Use querybuilder to find all pages tagged with specific tags. For eg: to find all pages tagged with "we-retail:apparel/pants"

path=/content/we-retail
type=cq:Page
property=jcr:content/@cq:tags
property.value=we-retail:apparel/pants
p.limit=-1

Refer https://sourcedcode.com/blog/aem/find-all-aem-pages-with-tags-with-query-builder

You need to write custom sling model exporter to return response in xml format. You can use javax.xml.bind.JAXBElement

Refer https://github.com/aemgeeks1212/aemgeeks/blob/master/core/src/main/java/com/aem/geeks/core/models/im...

https://github.com/aemgeeks1212/aemgeeks/blob/master/core/src/main/java/com/aem/geeks/core/exporter/... and customize as per your requirement.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/adobe-cq-export-content-as...

Or you can write servlet and return response to xml format.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 6

Use querybuilder to find all pages tagged with specific tags. For eg: to find all pages tagged with "we-retail:apparel/pants"

path=/content/we-retail
type=cq:Page
property=jcr:content/@cq:tags
property.value=we-retail:apparel/pants
p.limit=-1

Refer https://sourcedcode.com/blog/aem/find-all-aem-pages-with-tags-with-query-builder

You need to write custom sling model exporter to return response in xml format. You can use javax.xml.bind.JAXBElement

Refer https://github.com/aemgeeks1212/aemgeeks/blob/master/core/src/main/java/com/aem/geeks/core/models/im...

https://github.com/aemgeeks1212/aemgeeks/blob/master/core/src/main/java/com/aem/geeks/core/exporter/... and customize as per your requirement.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/adobe-cq-export-content-as...

Or you can write servlet and return response to xml format.