Class ComponentCancellationHelper


  • public class ComponentCancellationHelper
    extends Object
    Wrapper around Resource that wraps operations around cancelling / reenabling inheritance.
    • Constructor Detail

      • ComponentCancellationHelper

        public ComponentCancellationHelper()
    • 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 call AITranslatePropertyWrapper.adjustForReenableInheritance() on all properties that are *not* cancelled now.
        Throws:
        com.day.cq.wcm.api.WCMException