Interface ComponentsService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @Nullable org.apache.sling.api.resource.Resource createOverlay​(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull String templateType)
      Creates or replaces an overlay component for the specified component type.
      boolean removeOverlay​(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull String overlayType)
      Deletes an overlay component of the specified component type.
    • Method Detail

      • createOverlay

        @Nullable
        @Nullable org.apache.sling.api.resource.Resource createOverlay​(@NotNull
                                                                       @NotNull org.apache.sling.api.resource.ResourceResolver resolver,
                                                                       @NotNull
                                                                       @NotNull String templateType)
                                                                throws org.apache.sling.api.resource.PersistenceException
        Creates or replaces an overlay component for the specified component type.
        Parameters:
        resolver - the resolver to use
        templateType - 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

        boolean removeOverlay​(@NotNull
                              @NotNull org.apache.sling.api.resource.ResourceResolver resolver,
                              @NotNull
                              @NotNull String overlayType)
                       throws org.apache.sling.api.resource.PersistenceException
        Deletes an overlay component of the specified component type.
        Parameters:
        resolver - the resolver to use
        templateType - the component type as resource type (relative) or as absolute path
        Returns:
        'true' of the deletion was succesful'
        Throws:
        org.apache.sling.api.resource.PersistenceException - an error has been detected