incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1338272 - in /sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl: AbstractConfigTask.java ConfigTaskCreator.java
Date Mon, 14 May 2012 16:18:00 GMT
Author: cziegeler
Date: Mon May 14 16:17:59 2012
New Revision: 1338272

URL: http://svn.apache.org/viewvc?rev=1338272&view=rev
Log:
SLING-2450 : JcrInstaller generates incorrect node name in /apps/system/config (or else the
installer doesn't process the nodename properly)

Modified:
    sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java
    sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigTaskCreator.java

Modified: sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java?rev=1338272&r1=1338271&r2=1338272&view=diff
==============================================================================
--- sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java
(original)
+++ sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/AbstractConfigTask.java
Mon May 14 16:17:59 2012
@@ -80,7 +80,12 @@ abstract class AbstractConfigTask extend
         if ( this.aliasPid == null || this.factoryPid == null ) {
             return null;
         }
-        return factoryPid + "." + this.aliasPid;
+        final String alias = factoryPid + "." + this.aliasPid;
+        final int pos = this.getResource().getEntityId().indexOf(':');
+        if ( this.getResource().getEntityId().substring(pos + 1).equals(alias) ) {
+            return null;
+        }
+        return alias;
     }
 
     protected Dictionary<String, Object> getDictionary() {

Modified: sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigTaskCreator.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigTaskCreator.java?rev=1338272&r1=1338271&r2=1338272&view=diff
==============================================================================
--- sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigTaskCreator.java
(original)
+++ sling/trunk/installer/factories/configuration/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigTaskCreator.java
Mon May 14 16:17:59 2012
@@ -181,7 +181,22 @@ public class ConfigTaskCreator
         final String configPid;
         int n = pid.indexOf('-');
         if (n > 0) {
-            configPid = pid.substring(n + 1);
+            // quick check if this is an existing configuration
+            final String fString = pid.substring(0, n);
+            final String cString = pid.substring(n + 1);
+            boolean useExtendedPid = false;
+            try {
+                if ( ConfigUtil.getConfiguration(this.configAdmin, fString, fString + '.'
+ cString, false) != null ) {
+                    useExtendedPid = true;
+                }
+            } catch ( final Exception ignore) {
+                // ignore this
+            }
+            if ( useExtendedPid ) {
+                configPid = fString + '.' + cString;
+            } else {
+                configPid = pid.substring(n + 1);
+            }
             factoryPid = pid.substring(0, n);
         } else {
             factoryPid = null;



Mime
View raw message