This is an automated email from the ASF dual-hosted git repository.
davidb pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-extension-content.git
The following commit(s) were added to refs/heads/master by this push:
new 435124b SLING-8028 Split FeatureExtensionHandler into MergeHandler
and PostProcessor
435124b is described below
commit 435124b2cfb954a1ea0c5492687fb8a7fc7c1aea
Author: David Bosschaert <[email protected]>
AuthorDate: Tue Oct 30 15:29:27 2018 +0000
SLING-8028 Split FeatureExtensionHandler into MergeHandler and PostProcessor
Update this extension implementation to use the new API
---
.../content/ContentOrderMergeProcessor.java | 29 ++++------------------
1 file changed, 5 insertions(+), 24 deletions(-)
diff --git
a/src/main/java/org/apache/sling/feature/extension/content/ContentOrderMergeProcessor.java
b/src/main/java/org/apache/sling/feature/extension/content/ContentOrderMergeProcessor.java
index 3cc9e97..f85f18a 100644
---
a/src/main/java/org/apache/sling/feature/extension/content/ContentOrderMergeProcessor.java
+++
b/src/main/java/org/apache/sling/feature/extension/content/ContentOrderMergeProcessor.java
@@ -22,34 +22,15 @@ import org.apache.sling.feature.ExtensionType;
import org.apache.sling.feature.Feature;
import org.apache.sling.feature.FeatureConstants;
import org.apache.sling.feature.KeyValueMap;
-import org.apache.sling.feature.builder.FeatureExtensionHandler;
+import org.apache.sling.feature.builder.HandlerContext;
+import org.apache.sling.feature.builder.PostProcessHandler;
-public class ContentOrderMergeProcessor implements FeatureExtensionHandler {
-
- private static final String DEFAULT_CONTENT_START_ORDER =
"default.content.startorder";
-
- /**
- * Only postprocessing - relying on default merge strategy
- * (non-Javadoc)
- * @see
org.apache.sling.feature.builder.FeatureExtensionHandler#canMerge(org.apache.sling.feature.Extension)
- */
- @Override
- public boolean canMerge(Extension extension) {
- return false;
- }
+public class ContentOrderMergeProcessor implements PostProcessHandler {
- /*
- * Only postprocessing - relying on default merge strategy
- * (non-Javadoc)
- * @see
org.apache.sling.feature.builder.FeatureExtensionHandler#merge(org.apache.sling.feature.Feature,
org.apache.sling.feature.Feature, org.apache.sling.feature.Extension)
- */
- @Override
- public void merge(Feature target, Feature source, Extension extension) {
- // not merging
- }
+ private static final String DEFAULT_CONTENT_START_ORDER =
"default.content.startorder";
@Override
- public void postProcess(Feature feature, Extension extension) {
+ public void postProcess(HandlerContext context, Feature feature, Extension
extension) {
if (extension.getType() == ExtensionType.ARTIFACTS
&&
extension.getName().equals(FeatureConstants.EXTENSION_NAME_CONTENT_PACKAGES)) {
String defaultOrder =
feature.getVariables().get(DEFAULT_CONTENT_START_ORDER);