Fetching component list allowed in temple | Community
Skip to main content
Level 4
October 6, 2021

Fetching component list allowed in temple

  • October 6, 2021
  • 2 replies
  • 2529 views

Hi,

 

I am using aem 6.5 and this query is for editable templates.

Is there any way to get list of allowed components selected in template .

 

Like I have given input path as /conf/abc/setting/wcm/templates/pqr

 

And get response as list of components added to layout container via policy or directly added etc

 

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

2 replies

Kiran_Vedantam
Community Advisor
Community Advisor
October 6, 2021

Hi @kiranc13433869 

 

You can use the Content policy manager API to access the policies and its properties.

 

Ex: getPolicy(Resource contentResource).getProperties() 

 

https://www.adobe.io/experience-manager/reference-materials/6-5/javadoc/com/day/cq/wcm/api/policies/ContentPolicyManager.html

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

Level 4
October 6, 2021

Hi Kiran,

 

What is the maven dependency required for this? And if I provide template path, will that be sufficient?

I tried same but com.day.cq.wcm.api.policies is becoming unsatisfied in bundles

Level 4
October 6, 2021

Hi @kiranc13433869 

 

What error are you getting? Check if the bundle exists in the system/console, if not try uploading it manually.

 

Also while building try this command "mvn clean install -PautoInstallPackage,adobe-public"

 

Thanks,

Kiran Vedantam.


Yes that's what bundle already exists with 5.12.26 version

I m trying to use in servlet to get components list from template.

arunpatidar
Community Advisor
Community Advisor
October 7, 2021