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
BedrockMission!

Learn More

View all

Sign in to view all badges

How to programmatically check if a inheritance in cancelled on the path provided?

Avatar

Avatar
Validate 1
Level 1
puniths34934369
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
puniths34934369
Level 1

Like

1 like

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
Ignite 1
Boost 1
Applaud 5
View profile
puniths34934369
Level 1

15-12-2020

Hi,

 

I have a component with has a parsys inside it.

Now on breaking the  inheritance on a page for this component works flawlessly as expected.

 

Now for a different requirement i am provided a path, but i need to check if the provided path's inheritance is broken or on. How to achieve that?

FYI: I have been checking "cq:LiveSyncCancelled" mixin type is present or not. However it doesnt seem to work for the below scenario:

 

  1. Component: I have a parsys inside the component
  2. Authored the above component on a page
  3. Inside the components parsys, i authored multiple components
  4. Now break the inhertitance of the parent component
  5. I notice that cq:LiveSyncCancelled gets added to the parent node but not for the components authored inside the parsys

So my assumption of checking if the cq:LiveSyncCancelled is present or not is not a viable solution. Any API?

 

 

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

274 likes

Total Posts

320 posts

Correct Reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Establish
MVP
Anudeep_Garnepudi
MVP

Likes

274 likes

Total Posts

320 posts

Correct Reply

87 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
Anudeep_Garnepudi
MVP

21-12-2020

@puniths34934369 

Check cq:isCancelledForChildren (Boolean) true property for the specified path.

Answers (2)

Answers (2)

Avatar

Avatar
Ignite 1
MVP
SureshDhulipudi
MVP

Likes

163 likes

Total Posts

174 posts

Correct Reply

49 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile

Avatar
Ignite 1
MVP
SureshDhulipudi
MVP

Likes

163 likes

Total Posts

174 posts

Correct Reply

49 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile
SureshDhulipudi
MVP

16-12-2020

I am thinking on the other way like get the properties of the resource and check it inherited from parent or other resource:

HierarchyNodeInheritanceValueMap - This will help to retrieve the inherited properties from parent pages.

ResourceResolver resourceResolver = slingRequest.getResourceResolver();
String resourceContentPath = resourcePathURL<>;
Resource res = resourceResolver.getResource(resourceContentPath);

InheritanceValueMap inheritedProp = new HierarchyNodeInheritanceValueMap(res);
String prop1 = inheritedProp.getInherited(<property1>, String.class);

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

15-12-2020