incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1361148 - in /sling/trunk/bundles: api/src/main/java/org/apache/sling/api/resource/ jcr/resource/src/main/java/org/apache/sling/jcr/resource/ jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/ jcr/resource/src/te...
Date Fri, 13 Jul 2012 10:57:48 GMT
Author: cziegeler
Date: Fri Jul 13 10:57:47 2012
New Revision: 1361148

URL: http://svn.apache.org/viewvc?rev=1361148&view=rev
Log:
SLING-2530 : Implement CRUD based on resources (WiP)

Added:
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java
  (with props)
Modified:
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/AbstractResource.java
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifyingResourceProvider.java
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/PersistableValueMap.java
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/Resource.java
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
    sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrModifiablePropertyMap.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
    sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceListenerTest.java
    sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/jcr/MockResourceResolver.java
    sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
    sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntryTest.java

Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/AbstractResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/AbstractResource.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/AbstractResource.java
(original)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/AbstractResource.java
Fri Jul 13 10:57:47 2012
@@ -130,9 +130,9 @@ public abstract class AbstractResource
     }
 
     /**
-     * @see org.apache.sling.api.resource.Resource#update(org.apache.sling.api.resource.ValueMap)
+     * @see org.apache.sling.api.resource.Resource#update(org.apache.sling.api.resource.ModifiableValueMap)
      */
-    public void update(final ValueMap properties) throws PersistenceException {
+    public void update(final ModifiableValueMap properties) throws PersistenceException {
         this.getResourceResolver().update(this, properties);
     }
 
@@ -143,4 +143,11 @@ public abstract class AbstractResource
     throws PersistenceException {
         return this.getResourceResolver().addChild(this, name, properties);
     }
+
+    /**
+     * @see org.apache.sling.api.resource.Resource#getModifiableValueMap()
+     */
+    public ModifiableValueMap getModifiableValueMap() {
+        return null;
+    }
 }

Added: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java?rev=1361148&view=auto
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java
(added)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java
Fri Jul 13 10:57:47 2012
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.api.resource;
+
+/**
+ * The <code>ModifiableValueMap</code> marks a {@link ValueMap}
+ * as modifiable.
+ *
+ * @since 2.2
+ */
+public interface ModifiableValueMap extends ValueMap {
+
+    // just a marker interface
+}

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Propchange: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifyingResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifyingResourceProvider.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifyingResourceProvider.java
(original)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifyingResourceProvider.java
Fri Jul 13 10:57:47 2012
@@ -43,7 +43,7 @@ public interface ModifyingResourceProvid
     void delete(ResourceResolver resolver, String path)
     throws PersistenceException;
 
-    void update(ResourceResolver resolver, String path, ValueMap properties)
+    void update(ResourceResolver resolver, String path, ModifiableValueMap properties)
     throws PersistenceException;
 
     void revert()

Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/PersistableValueMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/PersistableValueMap.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/PersistableValueMap.java
(original)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/PersistableValueMap.java
Fri Jul 13 10:57:47 2012
@@ -29,7 +29,7 @@ package org.apache.sling.api.resource;
  * you get a new map instance which does not share modified
  * properties with other representations.
  */
-public interface PersistableValueMap extends ValueMap {
+public interface PersistableValueMap extends ModifiableValueMap {
 
     /**
      * Persists the changes.

Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/Resource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/Resource.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/Resource.java (original)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/Resource.java Fri
Jul 13 10:57:47 2012
@@ -142,6 +142,7 @@ public interface Resource extends Adapta
     ResourceResolver getResourceResolver();
 
     /**
+     * TODO : What does this mean?
      * @since 2.2.0
      */
     boolean isModifiable();
@@ -154,11 +155,22 @@ public interface Resource extends Adapta
 
     /**
      * @since 2.2.0
+     * @return ModifiableValueMap or <code>null</code>
+     */
+    ModifiableValueMap getModifiableValueMap();
+
+    /**
+     * Update the resource.
+     * The passed in {@link ModifiableValueMap} must be the one fetched
+     * from {@link #getModifiableValueMap()}.
+     *
+     * @since 2.2.0
      * @throws UnsupportedOperationException, PersistenceException
      */
-    void update(final ValueMap properties) throws PersistenceException;
+    void update(final ModifiableValueMap properties) throws PersistenceException;
 
     /**
+     * TODO - do we really need this method here?
      * @since 2.2.0
      * @throws UnsupportedOperationException, PersistenceException
      */

Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
(original)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
Fri Jul 13 10:57:47 2012
@@ -529,7 +529,7 @@ public interface ResourceResolver extend
      *
      * @throws PersistenceException, NullPointerException
      */
-    void update(Resource resource, ValueMap properties)
+    void update(Resource resource, ModifiableValueMap properties)
     throws PersistenceException;
 
     /**

Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java
(original)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java
Fri Jul 13 10:57:47 2012
@@ -173,9 +173,9 @@ public class ResourceWrapper implements 
     }
 
     /**
-     * @see org.apache.sling.api.resource.Resource#update(org.apache.sling.api.resource.ValueMap)
+     * @see org.apache.sling.api.resource.Resource#update(org.apache.sling.api.resource.ModifiableValueMap)
      */
-    public void update(final ValueMap properties) throws PersistenceException {
+    public void update(final ModifiableValueMap properties) throws PersistenceException {
         getResource().update(properties);
     }
 
@@ -186,4 +186,11 @@ public class ResourceWrapper implements 
     throws PersistenceException {
         return getResource().addChild(name, properties);
     }
+
+    /**
+     * @see org.apache.sling.api.resource.Resource#getModifiableValueMap()
+     */
+    public ModifiableValueMap getModifiableValueMap() {
+        return getResource().getModifiableValueMap();
+    }
 }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrModifiablePropertyMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrModifiablePropertyMap.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrModifiablePropertyMap.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrModifiablePropertyMap.java
Fri Jul 13 10:57:47 2012
@@ -182,36 +182,48 @@ public final class JcrModifiableProperty
             return;
         }
         try {
-            final Node node = getNode();
-            // check for mixin types
-            if ( this.changedProperties.contains(MIXIN_TYPES) ) {
-                if ( cache.containsKey(MIXIN_TYPES) ) {
-                    final JcrPropertyMapCacheEntry entry = cache.get(MIXIN_TYPES);
-                    handleMixinTypes(node, entry.values);
-                } else {
-                    // remove all mixin types!
-                    handleMixinTypes(node, null);
-                }
+            this.apply();
+            getNode().getSession().save();
+        } catch (final RepositoryException re) {
+            throw new PersistenceException("Unable to persist changes.", re);
+        }
+    }
+
+    /**
+     * Apply all changes but don't save
+     */
+    public void apply() throws RepositoryException {
+        if ( this.changedProperties == null || this.changedProperties.size() == 0 ) {
+            // nothing has changed
+            return;
+        }
+
+        final Node node = getNode();
+        // check for mixin types
+        if ( this.changedProperties.contains(MIXIN_TYPES) ) {
+            if ( cache.containsKey(MIXIN_TYPES) ) {
+                final JcrPropertyMapCacheEntry entry = cache.get(MIXIN_TYPES);
+                handleMixinTypes(node, entry.values);
+            } else {
+                // remove all mixin types!
+                handleMixinTypes(node, null);
             }
+        }
 
-            for(final String key : this.changedProperties) {
-                final String name = escapeKeyName(key);
-                if ( !MIXIN_TYPES.equals(name) ) {
-                    if ( cache.containsKey(key) ) {
-                        final JcrPropertyMapCacheEntry entry = cache.get(key);
-                        if ( entry.isMulti ) {
-                            node.setProperty(name, entry.values);
-                        } else {
-                            node.setProperty(name, entry.values[0]);
-                        }
+        for(final String key : this.changedProperties) {
+            final String name = escapeKeyName(key);
+            if ( !MIXIN_TYPES.equals(name) ) {
+                if ( cache.containsKey(key) ) {
+                    final JcrPropertyMapCacheEntry entry = cache.get(key);
+                    if ( entry.isMulti ) {
+                        node.setProperty(name, entry.values);
                     } else {
-                        node.setProperty(name, (String)null);
+                        node.setProperty(name, entry.values[0]);
                     }
+                } else {
+                    node.setProperty(name, (String)null);
                 }
             }
-            node.getSession().save();
-        } catch (final RepositoryException re) {
-            throw new PersistenceException("Unable to persist changes.", re);
         }
         this.reset();
     }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java
Fri Jul 13 10:57:47 2012
@@ -41,6 +41,7 @@ import javax.jcr.ValueFormatException;
 import org.apache.jackrabbit.net.URLFactory;
 import org.apache.sling.adapter.annotations.Adaptable;
 import org.apache.sling.adapter.annotations.Adapter;
+import org.apache.sling.api.resource.ModifiableValueMap;
 import org.apache.sling.api.resource.PersistableValueMap;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
@@ -300,4 +301,19 @@ public class JcrNodeResource extends Jcr
     public boolean isModifiable() {
         return true;
     }
+
+    /**
+     * @see org.apache.sling.api.resource.AbstractResource#getModifiableValueMap()
+     */
+    public ModifiableValueMap getModifiableValueMap() {
+        // check write
+        try {
+            getNode().getSession().checkPermission(getNode().getPath(),
+                "set_property");
+            return new JcrModifiablePropertyMap(getNode(), this.dynamicClassLoader);
+        } catch (RepositoryException e) {
+            // the user has no write permission
+        }
+        return null;
+    }
 }

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
Fri Jul 13 10:57:47 2012
@@ -41,6 +41,7 @@ import org.apache.sling.api.SlingExcepti
 import org.apache.sling.api.adapter.SlingAdaptable;
 import org.apache.sling.api.resource.AttributableResourceProvider;
 import org.apache.sling.api.resource.DynamicResourceProvider;
+import org.apache.sling.api.resource.ModifiableValueMap;
 import org.apache.sling.api.resource.ModifyingResourceProvider;
 import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.QueriableResourceProvider;
@@ -50,6 +51,7 @@ import org.apache.sling.api.resource.Res
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
 import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.jcr.resource.JcrModifiablePropertyMap;
 import org.apache.sling.jcr.resource.JcrResourceUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -388,16 +390,16 @@ public class JcrResourceProvider
         try {
             final Node node = JcrResourceUtil.createPath(path, null, nodeType, this.session,
false);
 
-            // mixin types
-            final String[] mixinTypes = (properties != null ? properties.get("jcr:mixinTypes",
String[].class) : null);
-            if ( mixinTypes != null ) {
-                for(final String mixin : mixinTypes ) {
-                    if ( !node.isNodeType(mixin) ) {
-                        node.addMixin(mixin);
+            if ( properties != null ) {
+                // create modifiable map
+                final JcrModifiablePropertyMap jcrMap = new JcrModifiablePropertyMap(node,
this.dynamicClassLoader);
+                for(final Map.Entry<String, Object> entry : properties.entrySet())
{
+                    if ( !"jcr:primaryType".equals(entry.getKey()) ) {
+                        jcrMap.put(entry.getKey(), entry.getValue());
                     }
                 }
+                jcrMap.apply();
             }
-            this.update(node, properties);
 
             return new JcrNodeResource(resolver, node, this.dynamicClassLoader);
         } catch (final RepositoryException e) {
@@ -420,24 +422,20 @@ public class JcrResourceProvider
         }
     }
 
-    private void update(final Node node, final ValueMap properties) throws RepositoryException
{
-        for(final Map.Entry<String, Object> entry : properties.entrySet()) {
-            if ( !entry.getKey().equals("jcr:primaryType") && !entry.getKey().equals("jcr:mixinTypes")
) {
-                JcrResourceUtil.setProperty(node, entry.getKey(), entry.getValue());
-            }
-        }
-    }
-
     /**
-     * @see org.apache.sling.api.resource.ModifyingResourceProvider#update(org.apache.sling.api.resource.ResourceResolver,
java.lang.String, org.apache.sling.api.resource.ValueMap)
+     * @see org.apache.sling.api.resource.ModifyingResourceProvider#update(org.apache.sling.api.resource.ResourceResolver,
java.lang.String, org.apache.sling.api.resource.ModifiableValueMap)
      */
-    public void update(final ResourceResolver resolver, final String path, final ValueMap
properties)
+    public void update(final ResourceResolver resolver, final String path, final ModifiableValueMap
properties)
     throws PersistenceException {
+        if ( !(properties instanceof JcrModifiablePropertyMap) ) {
+            throw new PersistenceException("ModifiableValueMap"); // TODO - IllegalArgumentException
?
+        }
+        final JcrModifiablePropertyMap jcrMap = (JcrModifiablePropertyMap)properties;
+        if ( !jcrMap.getPath().equals(path) ) {
+            throw new PersistenceException("ModifiableValueMap"); // TODO - IllegalArgumentException
?
+        }
         try {
-            final Node node = this.session.getNode(path);
-
-            this.update(node, properties);
-
+            jcrMap.apply();
         } catch (final RepositoryException e) {
             throw new PersistenceException("Unable to update node at " + path, e);
         }

Modified: sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceListenerTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceListenerTest.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceListenerTest.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceListenerTest.java
Fri Jul 13 10:57:47 2012
@@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletReq
 
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.ModifiableValueMap;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
@@ -212,7 +213,7 @@ public class JcrResourceListenerTest ext
                 return null;
             }
 
-            public void update(Resource resource, ValueMap properties) {
+            public void update(Resource resource, ModifiableValueMap properties) {
                 // TODO Auto-generated method stub
 
             }

Modified: sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/jcr/MockResourceResolver.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/jcr/MockResourceResolver.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/jcr/MockResourceResolver.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/helper/jcr/MockResourceResolver.java
Fri Jul 13 10:57:47 2012
@@ -28,6 +28,7 @@ import javax.jcr.Property;
 import javax.jcr.Session;
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.sling.api.resource.ModifiableValueMap;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ValueMap;
@@ -136,7 +137,7 @@ public class MockResourceResolver implem
         return null;
     }
 
-    public void update(Resource resource, ValueMap properties) {
+    public void update(Resource resource, ModifiableValueMap properties) {
         // TODO Auto-generated method stub
 
     }

Modified: sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
(original)
+++ sling/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/ResourceResolverImpl.java
Fri Jul 13 10:57:47 2012
@@ -37,6 +37,7 @@ import org.apache.sling.adapter.annotati
 import org.apache.sling.api.SlingException;
 import org.apache.sling.api.adapter.SlingAdaptable;
 import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.ModifiableValueMap;
 import org.apache.sling.api.resource.ModifyingResourceProvider;
 import org.apache.sling.api.resource.NonExistingResource;
 import org.apache.sling.api.resource.PersistenceException;
@@ -1027,9 +1028,9 @@ public class ResourceResolverImpl extend
     }
 
     /**
-     * @see org.apache.sling.api.resource.ResourceResolver#update(org.apache.sling.api.resource.Resource,
org.apache.sling.api.resource.ValueMap)
+     * @see org.apache.sling.api.resource.ResourceResolver#update(org.apache.sling.api.resource.Resource,
org.apache.sling.api.resource.ModifiableValueMap)
      */
-    public void update(final Resource resource, final ValueMap properties)
+    public void update(final Resource resource, final ModifiableValueMap properties)
     throws PersistenceException {
         // if resource is null, we get an NPE as stated in the API
         final String path = resource.getPath();

Modified: sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntryTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntryTest.java?rev=1361148&r1=1361147&r2=1361148&view=diff
==============================================================================
--- sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntryTest.java
(original)
+++ sling/trunk/bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/tree/ResourceProviderEntryTest.java
Fri Jul 13 10:57:47 2012
@@ -30,6 +30,7 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.sling.api.resource.AbstractResource;
+import org.apache.sling.api.resource.ModifiableValueMap;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
 import org.apache.sling.api.resource.ResourceProvider;
@@ -309,7 +310,7 @@ public class ResourceProviderEntryTest {
             return null;
         }
 
-        public void update(Resource resource, ValueMap properties) {
+        public void update(Resource resource, ModifiableValueMap properties) {
             // TODO Auto-generated method stub
         }
 



Mime
View raw message