내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Reading data stored in separate nodes design dialog

Avatar

Level 7

design-dialog-nodes.pngHi,

 

I know to read design dialog values through for example: ${currentStyle.titleType} 

 

But how do you read design dialog data stored as separate nodes below component policy node. 

 

I have a multi field values stored as item nodes below component policy node.

 

I am trying to read it using data sly list ${curentStyle.link} which does not work as link is a child node below component policy node.

i appreciate any help, thanks.

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

Hi @sreenu539,

For getting policy programmatically, we need to make use of ContentPolicyManager and ContentPolicy API (We will be able to gain access to ContentPolicyManager from ResourceResolver)

ContentPolicyManager cntPolicyMgr = rescResolver.adaptTo(ContentPolicyManager.class);

Go through the methods exposed by the API and use accordingly. 

We will be able to get the policy and its properties (properties on the policy node). For accessing child nodes under policy node, should be either Resource or Node API. 

ContentPolicyManager API:

ContentPolicy API:

원본 게시물의 솔루션 보기

6 답변 개

Avatar

정확한 답변 작성자:
Level 10

Hi @sreenu539,

For getting policy programmatically, we need to make use of ContentPolicyManager and ContentPolicy API (We will be able to gain access to ContentPolicyManager from ResourceResolver)

ContentPolicyManager cntPolicyMgr = rescResolver.adaptTo(ContentPolicyManager.class);

Go through the methods exposed by the API and use accordingly. 

We will be able to get the policy and its properties (properties on the policy node). For accessing child nodes under policy node, should be either Resource or Node API. 

ContentPolicyManager API:

ContentPolicy API:

Avatar

Level 7

Is there a way to get content resource from sling request - I am trying to use content policy manager to populate data source elements for a dropdown in cq:dialog 

Resource contentResource = resolver.getResource((String) request.getAttribute(Value.CONTENTPATH_ATTRIBUTE)); 

Value.CONTENTPATH_ATTRIBUTE is displayed as deprecated

 

@Vijayalakshmi_S 

Avatar

Level 10

Could you please elaborate on the

  • Exact resource that you are trying to fetch with below snippet and
  • Servlet you are using for datasource logic is registered with paths or resourcetypes? Share the path used in either case.

"dataPath" property on the granite form fields is what will be available in "Value.CONTENTPATH_ATTRIBUTE". Couldn't relate which exact resource you are trying to retrieve with respect to the current context, hence the queries. 

Avatar

Level 4
Level 4
Hi @sreenu539, I have the same use case, how di you manage to resolve this. Can you please share your solution. Thanks NJ

Avatar

Level 7

@nj2 

I have written a sling model to retrieve parent style node.

getAllowedLinks() {
allowedLinks = request.getResourceResolver().getResource(currentStyle.getPath()).getChild("links");

return allowedLinks;
}

in HTL:

data-sly-repeat : articleInsightsModel.allowedLinks

Avatar

Level 4
Level 4
Thank you Sreenu