sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sseif...@apache.org
Subject svn commit: r1691105 - in /sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model: EffectiveModelProcessor.java ModelResolveUtility.java ModelUtility.java
Date Tue, 14 Jul 2015 23:24:19 GMT
Author: sseifert
Date: Tue Jul 14 23:24:19 2015
New Revision: 1691105

URL: http://svn.apache.org/r1691105
Log:
SLING-4807 introduce explicit boolean flag to make sure variable replacement does not take
place when merging models

Modified:
    sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/EffectiveModelProcessor.java
    sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelResolveUtility.java
    sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelUtility.java

Modified: sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/EffectiveModelProcessor.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/EffectiveModelProcessor.java?rev=1691105&r1=1691104&r2=1691105&view=diff
==============================================================================
--- sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/EffectiveModelProcessor.java
(original)
+++ sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/EffectiveModelProcessor.java
Tue Jul 14 23:24:19 2015
@@ -56,7 +56,7 @@ class EffectiveModelProcessor extends Mo
     @Override
     protected Configuration processConfiguration(Configuration config, Feature newFeature,
RunMode newRunMode) {
         Configuration newConfig = new Configuration(config.getPid(), config.getFactoryPid());
-        getProcessedConfiguration(newFeature, newConfig, config, options.getVariableResolver());
+        getProcessedConfiguration(newFeature, newConfig, config, true, options.getVariableResolver());
         return newConfig;
     }
 

Modified: sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelResolveUtility.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelResolveUtility.java?rev=1691105&r1=1691104&r2=1691105&view=diff
==============================================================================
--- sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelResolveUtility.java
(original)
+++ sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelResolveUtility.java
Tue Jul 14 23:24:19 2015
@@ -104,12 +104,14 @@ class ModelResolveUtility {
      * @param feature Feature
      * @param newConfig New configuration with replaced variables
      * @param config Source configuration which may contain variable placeholders
-     * @param resolver Variable resolver
+     * @param replaceVariables If set to true variables are resolved in the config before
processing it.
+     * @param resolver Variable resolver Optional variable resolver which is used. If not
given only the feature's variables are used.
      */
     static void getProcessedConfiguration(
             final Feature feature,
             final Configuration newConfig,
             final Configuration config,
+            final boolean replaceVariables,
             final VariableResolver resolver) {
         newConfig.setComment(config.getComment());
         newConfig.setLocation(config.getLocation());
@@ -117,7 +119,9 @@ class ModelResolveUtility {
         // check for raw configuration
         String rawConfig = (String)config.getProperties().get(ModelConstants.CFG_UNPROCESSED);
         if ( rawConfig != null ) {
-            rawConfig = replace(feature, rawConfig, resolver);
+            if ( replaceVariables ) {
+                rawConfig = replace(feature, rawConfig, resolver);
+            }
             if ( config.isSpecial() ) {
                 newConfig.getProperties().put(config.getPid(), rawConfig);
             } else {

Modified: sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelUtility.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelUtility.java?rev=1691105&r1=1691104&r2=1691105&view=diff
==============================================================================
--- sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelUtility.java
(original)
+++ sling/trunk/tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelUtility.java
Tue Jul 14 23:24:19 2015
@@ -171,12 +171,12 @@ public abstract class ModelUtility {
                     copyConfigurationProperties(baseConfig, mergeConfig);
                 } else {
                     final Configuration newConfig = new Configuration(baseConfig.getPid(),
baseConfig.getFactoryPid());
-                    getProcessedConfiguration(null, newConfig, baseConfig, null);
+                    getProcessedConfiguration(null, newConfig, baseConfig, false, null);
                     clearConfiguration(baseConfig);
                     copyConfigurationProperties(baseConfig, newConfig);
 
                     clearConfiguration(newConfig);
-                    getProcessedConfiguration(null, newConfig, mergeConfig, null);
+                    getProcessedConfiguration(null, newConfig, mergeConfig, false, null);
 
                     if ( baseConfig.isSpecial() ) {
                         final String baseValue = baseConfig.getProperties().get(baseConfig.getPid()).toString();
@@ -201,7 +201,7 @@ public abstract class ModelUtility {
                     copyConfigurationProperties(baseConfig, mergeConfig);
                 } else {
                     final Configuration newMergeConfig = new Configuration(mergeConfig.getPid(),
mergeConfig.getFactoryPid());
-                    getProcessedConfiguration(null, newMergeConfig, mergeConfig, null);
+                    getProcessedConfiguration(null, newMergeConfig, mergeConfig, false, null);
 
                     if ( baseConfig.isSpecial() ) {
                         final String baseValue = baseConfig.getProperties().get(baseConfig.getPid()).toString();



Mime
View raw message