Package com.composum.ai.aem.core.impl
Class ComponentCancellationHelper
- java.lang.Object
-
- com.composum.ai.aem.core.impl.ComponentCancellationHelper
-
public class ComponentCancellationHelper extends Object
Wrapper aroundResource
that wraps operations around cancelling / reenabling inheritance.
-
-
Constructor Summary
Constructors Constructor Description ComponentCancellationHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
adjustPropertiesReenableInheritance(com.day.cq.wcm.msm.api.LiveRelationshipManager liveRelationshipManager, org.apache.sling.api.resource.Resource resource)
We callAITranslatePropertyWrapper.adjustForReenableInheritance()
on all properties that are *not* cancelled now.static org.apache.sling.api.resource.Resource
findNextHigherCancellableComponent(org.apache.sling.api.resource.Resource resource)
Finds next higher cq:Component in the resource tree, or the cq:PageContent if that is the next higher component.static boolean
isComponent(org.apache.sling.api.resource.Resource resource)
Checks whether a resource has a sling:resourceType that is of type cq:Component.static boolean
isContainer(org.apache.sling.api.resource.Resource resource)
Tries to guess whether the resource is actually a container (where inheritance cancelling is shallow only.)static boolean
isPage(org.apache.sling.api.resource.Resource resource)
static boolean
isPageContent(org.apache.sling.api.resource.Resource resource)
-
-
-
Method Detail
-
isComponent
public static boolean isComponent(@Nonnull org.apache.sling.api.resource.Resource resource)
Checks whether a resource has a sling:resourceType that is of type cq:Component.
-
isPageContent
public static boolean isPageContent(@Nonnull org.apache.sling.api.resource.Resource resource)
-
isPage
public static boolean isPage(@Nonnull org.apache.sling.api.resource.Resource resource)
-
findNextHigherCancellableComponent
public static org.apache.sling.api.resource.Resource findNextHigherCancellableComponent(@Nonnull org.apache.sling.api.resource.Resource resource)
Finds next higher cq:Component in the resource tree, or the cq:PageContent if that is the next higher component.
-
isContainer
public static boolean isContainer(@Nonnull org.apache.sling.api.resource.Resource resource)
Tries to guess whether the resource is actually a container (where inheritance cancelling is shallow only.) We guess this if the sling:resourceType has "cq:isContainer" true, or heuristics match: if it has a lonely "items" child or one of its children or childrens children is a component.
-
adjustPropertiesReenableInheritance
public static void adjustPropertiesReenableInheritance(com.day.cq.wcm.msm.api.LiveRelationshipManager liveRelationshipManager, org.apache.sling.api.resource.Resource resource) throws com.day.cq.wcm.api.WCMException
We callAITranslatePropertyWrapper.adjustForReenableInheritance()
on all properties that are *not* cancelled now.- Throws:
com.day.cq.wcm.api.WCMException
-
-