incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1125278 - in /sling/trunk/installer: core/src/main/java/org/apache/sling/installer/core/impl/ providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/
Date Fri, 20 May 2011 08:45:36 GMT
Author: cziegeler
Date: Fri May 20 08:45:35 2011
New Revision: 1125278

URL: http://svn.apache.org/viewvc?rev=1125278&view=rev
Log:
Several fixes for configuration write back

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
    sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java?rev=1125278&r1=1125277&r2=1125278&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
Fri May 20 08:45:35 2011
@@ -64,7 +64,7 @@ public class InternalResource extends In
 
         if ( is != null &&
              (InstallableResource.TYPE_PROPERTIES.equals(type) ||
-              type == null && isConfigExtension(resource.getId()))) {
+              ((type == null || InstallableResource.TYPE_FILE.equals(type)) && isConfigExtension(resource.getId()))))
{
             dict = readDictionary(is, getExtension(resource.getId()));
             if ( dict == null ) {
                 throw new IOException("Unable to read dictionary from input stream: " + resource.getId());

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java?rev=1125278&r1=1125277&r2=1125278&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/OsgiInstallerImpl.java
Fri May 20 08:45:35 2011
@@ -664,19 +664,15 @@ public class OsgiInstallerImpl
      * @see org.apache.sling.installer.api.ResourceChangeListener#resourceAddedOrUpdated(java.lang.String,
java.lang.String, java.io.InputStream, java.util.Dictionary, Map)
      */
     public void resourceAddedOrUpdated(final String resourceType,
-            String entityId,
+            final String entityId,
             final InputStream is,
             final Dictionary<String, Object> dict,
             final Map<String, Object> attributes) {
-        String key = resourceType + ':' + entityId;
+        final String key = resourceType + ':' + entityId;
         try {
             final ResourceData data = ResourceData.create(is, dict);
             synchronized ( this.resourcesLock ) {
                 final EntityResourceList erl = this.persistentList.getEntityResourceList(key);
-                if ( erl != null ) {
-                    entityId = erl.getResourceId();
-                    key = resourceType + ':' + entityId;
-                }
                 logger.debug("Added or updated {} : {}", key, erl);
 
                 // we first check for update

Modified: sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java?rev=1125278&r1=1125277&r2=1125278&view=diff
==============================================================================
--- sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
(original)
+++ sling/trunk/installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
Fri May 20 08:45:35 2011
@@ -628,8 +628,10 @@ public class JcrInstaller implements Eve
                 final String oldPath = url.substring(pos + 1);
                 final String nodePath = getPathWithHighestPrio(oldPath);
                 // ensure extension 'config'
-                if ( !nodePath.endsWith(".config") && session.itemExists(nodePath)
) {
-                    session.getItem(nodePath).remove();
+                if ( !nodePath.endsWith(".config") ) {
+                    if ( session.itemExists(nodePath) ) {
+                        session.getItem(nodePath).remove();
+                    }
                     path = nodePath + ".config";
                 } else {
                     path = nodePath;
@@ -660,7 +662,9 @@ public class JcrInstaller implements Eve
 
             final UpdateResult result = new UpdateResult(JcrInstaller.URL_SCHEME + ':' +
path);
             // priority
-            result.setPriority(this.folderNameFilter.getPriority(path));
+            final int lastSlash = path.lastIndexOf('/');
+            final String parentPath = path.substring(0, lastSlash);
+            result.setPriority(this.folderNameFilter.getPriority(parentPath));
             result.setResourceIsMoved(resourceIsMoved);
             return result;
         } catch (final RepositoryException re) {



Mime
View raw message