You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:43:56 UTC

[sling-org-apache-sling-installer-factory-configuration] 05/07: SLING-4410 : Make default bundle location configurable

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.installer.factory.configuration-1.1.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-factory-configuration.git

commit ce240a7e685fc69ebf5b53cfa98c475cc810a2bb
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Feb 12 02:08:50 2015 +0000

    SLING-4410 : Make default bundle location configurable
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/factories/configuration@1659124 13f79535-47bb-0310-9956-ffa450edef68
---
 .../factories/configuration/ConfigurationConstants.java     |  3 ++-
 .../installer/factories/configuration/impl/Activator.java   | 13 +++++++++++++
 .../factories/configuration/impl/ConfigInstallTask.java     |  2 +-
 .../installer/factories/configuration/package-info.java     |  2 +-
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/installer/factories/configuration/ConfigurationConstants.java b/src/main/java/org/apache/sling/installer/factories/configuration/ConfigurationConstants.java
index c762c00..9c0372b 100644
--- a/src/main/java/org/apache/sling/installer/factories/configuration/ConfigurationConstants.java
+++ b/src/main/java/org/apache/sling/installer/factories/configuration/ConfigurationConstants.java
@@ -31,7 +31,8 @@ public abstract class ConfigurationConstants {
 
     /**
      * This property defines the value to be used as a bundle location if a configuration
-     * is created by the installer. This property is a string value defaulting to "?".
+     * is created by the installer. This property is a string value defaulting either
+     * to {@code null} or "?".
      * If this property contains the empty string, {@code null} is used as the value.
      *
      * The property should be used, if a configuration should be bound to a specific client.
diff --git a/src/main/java/org/apache/sling/installer/factories/configuration/impl/Activator.java b/src/main/java/org/apache/sling/installer/factories/configuration/impl/Activator.java
index ac16697..4602340 100644
--- a/src/main/java/org/apache/sling/installer/factories/configuration/impl/Activator.java
+++ b/src/main/java/org/apache/sling/installer/factories/configuration/impl/Activator.java
@@ -26,13 +26,26 @@ import org.osgi.framework.BundleContext;
  */
 public class Activator implements BundleActivator {
 
+    /** Property for bundle location default. */
+    private static final String PROP_LOCATION_DEFAULT = "sling.installer.config.useMulti";
+
     /** Services listener. */
     private ServicesListener listener;
 
+    public static String DEFAULT_LOCATION;
+
     /**
      * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
      */
     public void start(final BundleContext context) throws Exception {
+        String locationDefault = null;
+        if ( context.getProperty(PROP_LOCATION_DEFAULT) != null ) {
+            final Boolean bool = Boolean.valueOf(context.getProperty(PROP_LOCATION_DEFAULT).toString());
+            if ( bool.booleanValue() ) {
+                locationDefault = "?";
+            }
+        }
+        DEFAULT_LOCATION = locationDefault;
         this.listener = new ServicesListener(context);
     }
 
diff --git a/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigInstallTask.java b/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigInstallTask.java
index 2b27df6..7205195 100644
--- a/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigInstallTask.java
+++ b/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigInstallTask.java
@@ -52,7 +52,7 @@ public class ConfigInstallTask extends AbstractConfigTask {
             try {
                 String location = (String)this.getResource().getDictionary().get(ConfigurationConstants.PROPERTY_BUNDLE_LOCATION);
                 if ( location == null ) {
-                    location = "?"; // default
+                    location = Activator.DEFAULT_LOCATION; // default
                 } else if ( location.length() == 0 ) {
                     location = null;
                 }
diff --git a/src/main/java/org/apache/sling/installer/factories/configuration/package-info.java b/src/main/java/org/apache/sling/installer/factories/configuration/package-info.java
index 2068cb5..b25f85c 100644
--- a/src/main/java/org/apache/sling/installer/factories/configuration/package-info.java
+++ b/src/main/java/org/apache/sling/installer/factories/configuration/package-info.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@Version("1.1.0")
+@Version("1.1.2")
 package org.apache.sling.installer.factories.configuration;
 
 import aQute.bnd.annotation.Version;

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.