Class NodesComponentsService

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.sling.api.resource.Resource copyTemplate​(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull org.apache.sling.api.resource.Resource template, @NotNull org.apache.sling.api.resource.Resource parent)  
      @Nullable org.apache.sling.api.resource.Resource createOverlay​(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull String overlayType)
      Creates or replaces an overlay component for the specified component type.
      protected org.apache.sling.api.resource.Resource getTemplate​(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull String overlayType, @NotNull Iterator<String> searchPathIterator)  
      protected org.apache.sling.api.resource.Resource prepareParent​(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, org.apache.sling.api.resource.Resource template, String targetPath)  
      boolean removeOverlay​(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull String overlayType)
      Deletes an overlay component of the specified component type.
    • Field Detail

      • IGNORED_PROPERTIES

        public static final List<String> IGNORED_PROPERTIES
    • Constructor Detail

      • NodesComponentsService

        public NodesComponentsService()
    • Method Detail

      • createOverlay

        @Nullable
        public @Nullable org.apache.sling.api.resource.Resource createOverlay​(@NotNull
                                                                              @NotNull org.apache.sling.api.resource.ResourceResolver resolver,
                                                                              @NotNull
                                                                              @NotNull String overlayType)
                                                                       throws org.apache.sling.api.resource.PersistenceException
        Description copied from interface: ComponentsService
        Creates or replaces an overlay component for the specified component type.
        Specified by:
        createOverlay in interface ComponentsService
        Parameters:
        resolver - the resolver to use
        overlayType - the component type as resource type (relative) or as absolute path
        Returns:
        the resource of the created overlay
        Throws:
        org.apache.sling.api.resource.PersistenceException - an error has been detected
      • removeOverlay

        public boolean removeOverlay​(@NotNull
                                     @NotNull org.apache.sling.api.resource.ResourceResolver resolver,
                                     @NotNull
                                     @NotNull String overlayType)
                              throws org.apache.sling.api.resource.PersistenceException
        Description copied from interface: ComponentsService
        Deletes an overlay component of the specified component type.
        Specified by:
        removeOverlay in interface ComponentsService
        Parameters:
        resolver - the resolver to use
        Returns:
        'true' of the deletion was succesful'
        Throws:
        org.apache.sling.api.resource.PersistenceException - an error has been detected
      • getTemplate

        protected org.apache.sling.api.resource.Resource getTemplate​(@NotNull
                                                                     @NotNull org.apache.sling.api.resource.ResourceResolver resolver,
                                                                     @NotNull
                                                                     @NotNull String overlayType,
                                                                     @NotNull
                                                                     @NotNull Iterator<String> searchPathIterator)
      • copyTemplate

        protected org.apache.sling.api.resource.Resource copyTemplate​(@NotNull
                                                                      @NotNull org.apache.sling.api.resource.ResourceResolver resolver,
                                                                      @NotNull
                                                                      @NotNull org.apache.sling.api.resource.Resource template,
                                                                      @NotNull
                                                                      @NotNull org.apache.sling.api.resource.Resource parent)
                                                               throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException
      • prepareParent

        protected org.apache.sling.api.resource.Resource prepareParent​(@NotNull
                                                                       @NotNull org.apache.sling.api.resource.ResourceResolver resolver,
                                                                       org.apache.sling.api.resource.Resource template,
                                                                       String targetPath)
                                                                throws org.apache.sling.api.resource.PersistenceException
        Throws:
        org.apache.sling.api.resource.PersistenceException