Interface PolicyImportRuleService

    • Method Detail

      • apply

        @Deprecated(since="2.1.0")
        void apply​(@NotNull
                   @NotNull org.apache.sling.api.resource.Resource source,
                   @NotNull
                   @NotNull String confRoot,
                   @NotNull
                   @NotNull Set<String> rules,
                   boolean deep,
                   boolean overwrite)
            throws RewriteException
        Deprecated.
        Applies the indicated rules to the provided Style. If deep is set, rules will be applied recursively. That is: if the Style reference is a page's root Style resource, all children styles will also be imported if deep is set.

        If overwrite is true, then any referenced existing Policy created from a Design will be overwritten with the rules applied. Otherwise, if a Policy has already been created from a Design, it will be ignored.

        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:
        source - The Resource Style from which to read design configurations
        confRoot - The /conf root path into which the new policies will be created
        rules - the rules to apply
        deep - true to recurse into the tree
        overwrite - true to overwrite existing modernization
        Throws:
        RewriteException - if any errors occur when applying the rules
      • apply

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

        If overwrite is true, then any referenced existing Policy created from a Design will be overwritten with the rules applied. Otherwise, if a Policy has already been created from a Design, it will be ignored.

        Transformations are performed but not saved.

        Parameters:
        source - The Resource Style from which to read design configurations
        confRoot - The /conf root path into which the new policies will be created
        rules - the ids of the rules to apply
        overwrite - true to overwrite existing modernization
        Returns:
        true if one of the specified rules was successfully applied, false otherwise
        Throws:
        RewriteException - if any errors occur when applying the rules