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 StringPN_IMPORTEDstatic StringPOLICY_REL_PATH
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanapply(@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.voidapply(@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. Ifdeepis 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 ifdeepis set.If
overwriteis 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/confroot path into which the new policies will be createdrules- the rules to applydeep-trueto recurse into the treeoverwrite-trueto 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
overwriteis 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/confroot path into which the new policies will be createdrules- the ids of the rules to applyoverwrite-trueto overwrite existing modernization- Returns:
trueif one of the specified rules was successfully applied, false otherwise- Throws:
RewriteException- if any errors occur when applying the rules
-
-