AEM 6.3 - How to read policy value from editable template initially | Community
Skip to main content
Level 3
August 31, 2018

AEM 6.3 - How to read policy value from editable template initially

  • August 31, 2018
  • 1 reply
  • 3043 views

I have a editable template where a component has a design dialog where the template author will enter the values.

and in the design dialog i have a node of select type where the data is bound by using datasource through a servlet where I need to fetch the data from the policy.

and the code for the servlet is as follows. If i dont give policyPath and just get the resource from request.getResource() i am getting contentpolicy as null.

initially when there are no policies a dynamic policy is being created when we get the resource and a nullpointer is being thrown.

So how to handle this initially that no null pointer is thrown and can say there are no policies.

Thanks,

Kalyani

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

1 reply

smacdonald2008
Level 10
August 31, 2018

If you want to read data from a policy - then like any other AEM nodes - make sure you referencing the correct path if you want to read the node's properties.

For your code - where did you get it - are you referencing an Adobe doc? 

Level 3
September 4, 2018

I have used Adobe Experience Manager Help | Using Granite DataSource objects to populate AEM Touch UI objects  for binding the data to the dropdown.

For reading policies i have read in some forums that by using ContentPolicyManager to get the policy.