Interface ComponentRewriteRuleService

  • All Superinterfaces:
    RewriteRuleService

    @ProviderType
    public interface ComponentRewriteRuleService
    extends RewriteRuleService
    Provides a mechanism for listing all configured rules either via Nodes or custom implementations.
    • Method Detail

      • apply

        @Deprecated(since="2.1.0")
        void apply​(@NotNull
                   @NotNull org.apache.sling.api.resource.Resource resource,
                   @NotNull
                   @NotNull Set<String> rules,
                   boolean deep)
            throws RewriteException
        Deprecated.
        Applies the indicated rules to the provided resource. If deep is set, rules will be applied recursively.

        Transformations are performed but not saved.

        The rules can be either a fully qualified path to a rule or a Service PID depending on the implementation.

        Parameters:
        resource - Parent node for applying rules
        rules - the rules to apply
        deep - true to recurse into the tree
        Throws:
        RewriteException - if any errors occur when applying the rules
      • apply

        boolean apply​(@NotNull
                      @NotNull org.apache.sling.api.resource.Resource resource,
                      @NotNull
                      @NotNull Set<String> rules)
               throws RewriteException
        Applies the indicated rules to the provided resource.

        Transformations are performed but not saved.

        Parameters:
        resource - Resource to process
        rules - the ids of the rules to apply
        Returns:
        true if one of the specified rules was successfully applied, false otherwise
        Throws:
        RewriteException - if any errors occur when applying the rules