Package com.adobe.aem.modernize.policy
Interface PolicyImportRuleService
-
- All Superinterfaces:
RewriteRuleService
@ProviderType public interface PolicyImportRuleService extends RewriteRuleService
-
-
Field Summary
Fields Modifier and Type Field Description static String
PN_IMPORTED
static String
POLICY_REL_PATH
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
apply(@NotNull org.apache.sling.api.resource.Resource source, @NotNull String confRoot, @NotNull Set<String> rules, boolean overwrite)
Applies the indicated rules to the provided Resource.void
apply(@NotNull org.apache.sling.api.resource.Resource source, @NotNull String confRoot, @NotNull Set<String> rules, boolean deep, boolean overwrite)
Deprecated.-
Methods inherited from interface com.adobe.aem.modernize.rule.RewriteRuleService
find, getRule, listRules, listRules
-
-
-
-
Field Detail
-
PN_IMPORTED
static final String PN_IMPORTED
- See Also:
- Constant Field Values
-
POLICY_REL_PATH
static final String POLICY_REL_PATH
- See Also:
- Constant Field Values
-
-
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. Ifdeep
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 ifdeep
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 configurationsconfRoot
- The/conf
root path into which the new policies will be createdrules
- the rules to applydeep
-true
to recurse into the treeoverwrite
-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 configurationsconfRoot
- The/conf
root path into which the new policies will be createdrules
- the ids of the rules to applyoverwrite
-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
-
-