You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2018/04/27 09:51:34 UTC

[sling-org-apache-sling-feature] 14/22: Support for special feature names when converting to provisioning model.

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.git

commit f3dffc7ae91a19b2b785c78694eb6b018ce44f71
Author: David Bosschaert <da...@gmail.com>
AuthorDate: Mon Mar 19 15:09:52 2018 +0000

    Support for special feature names when converting to provisioning model.
    
    The special feature names must be specified in the variables section
    under the variable name 'provisioning.model.name'.
    This commit also contains the start of a document-based set of tests for
    testing between conversions of the feature model to the provisioning
    model and back.
---
 src/main/java/org/apache/sling/feature/Feature.java | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/Feature.java b/src/main/java/org/apache/sling/feature/Feature.java
index 874790d..b1ad406 100644
--- a/src/main/java/org/apache/sling/feature/Feature.java
+++ b/src/main/java/org/apache/sling/feature/Feature.java
@@ -16,13 +16,13 @@
  */
 package org.apache.sling.feature;
 
+import org.osgi.resource.Capability;
+import org.osgi.resource.Requirement;
+
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
 
-import org.osgi.resource.Capability;
-import org.osgi.resource.Requirement;
-
 /**
  * A feature consists of
  * <ul>
@@ -53,6 +53,8 @@ public class Feature implements Comparable<Feature> {
 
     private final Extensions extensions = new Extensions();
 
+    private final KeyValueMap variables = new KeyValueMap();
+
     /** The optional location. */
     private volatile String location;
 
@@ -204,6 +206,14 @@ public class Feature implements Comparable<Feature> {
     }
 
     /**
+     * Obtain the variables of the feature
+     * @return The variables
+     */
+    public KeyValueMap getVariables() {
+        return this.variables;
+    }
+
+    /**
      * Get the vendor
      * @return The vendor or {@code null}
      */
@@ -275,6 +285,9 @@ public class Feature implements Comparable<Feature> {
         result.setLicense(this.getLicense());
         result.setAssembled(this.isAssembled());
 
+        // variables
+        result.getVariables().putAll(this.getVariables());
+
         // bundles
         for(final Artifact b : this.getBundles()) {
             final Artifact c = new Artifact(b.getId());

-- 
To stop receiving notification emails like this one, please contact
davidb@apache.org.