You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2012/07/13 14:28:56 UTC
svn commit: r1361182 - 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...
Author: cziegeler
Date: Fri Jul 13 12:28:55 2012
New Revision: 1361182
URL: http://svn.apache.org/viewvc?rev=1361182&view=rev
Log:
SLING-2530 : Implement CRUD based on resources (WiP)
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/ModifiableValueMap.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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -114,40 +114,4 @@ public abstract class AbstractResource
//
return ResourceUtil.isA(this, resourceType);
}
-
- /**
- * @see org.apache.sling.api.resource.Resource#isModifiable()
- */
- public boolean isModifiable() {
- return false;
- }
-
- /**
- * @see org.apache.sling.api.resource.Resource#remove()
- */
- public void remove() throws PersistenceException {
- this.getResourceResolver().delete(this);
- }
-
- /**
- * @see org.apache.sling.api.resource.Resource#update(org.apache.sling.api.resource.ModifiableValueMap)
- */
- public void update(final ModifiableValueMap properties) throws PersistenceException {
- this.getResourceResolver().update(this, properties);
- }
-
- /**
- * @see org.apache.sling.api.resource.Resource#addChild(java.lang.String, org.apache.sling.api.resource.ValueMap)
- */
- public Resource addChild(final String name, final ValueMap properties)
- throws PersistenceException {
- return this.getResourceResolver().addChild(this, name, properties);
- }
-
- /**
- * @see org.apache.sling.api.resource.Resource#getModifiableValueMap()
- */
- public ModifiableValueMap getModifiableValueMap() {
- return null;
- }
}
Modified: 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=1361182&r1=1361181&r2=1361182&view=diff
==============================================================================
--- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java (original)
+++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java Fri Jul 13 12:28:55 2012
@@ -19,12 +19,37 @@
package org.apache.sling.api.resource;
/**
- * The <code>ModifiableValueMap</code> marks a {@link ValueMap}
- * as modifiable.
+ * The <code>ModifiableValueMap</code> is an extension
+ * of the {@link ValueMap} which allows to modify and
+ * persist the properties.
+ *
+ * Changes can be pushed into the persistence layer
+ * with a call to {@link #update()}. The changes are then
+ * stored in the persistence layer for committing. Once
+ * {@link ResourceResolver#commit()} is called, the
+ * changes get persisted.
+ *
+ * Note, that each time you call {@link Resource#adaptTo(Class)}
+ * you get a new map instance which does not share modified
+ * properties with other representations.
*
* @since 2.2
*/
public interface ModifiableValueMap extends ValueMap {
- // just a marker interface
+ /**
+ * Persists the changes.
+ * @throws PersistenceException If the changes can't be persisted.
+ */
+ void update() throws PersistenceException;
+
+ /**
+ * Revert temporary changes.
+ */
+ void revert();
+
+ /**
+ * Are there any changes?
+ */
+ boolean hasChanges();
}
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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -43,9 +43,6 @@ public interface ModifyingResourceProvid
void delete(ResourceResolver resolver, String path)
throws PersistenceException;
- void update(ResourceResolver resolver, String path, ModifiableValueMap properties)
- throws PersistenceException;
-
void revert()
throws PersistenceException;
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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -18,8 +18,6 @@
*/
package org.apache.sling.api.resource;
-
-
/**
* The <code>PersistableValueMap</code> is an extension
* of the {@link ValueMap} which allows to modify and
@@ -29,7 +27,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 ModifiableValueMap {
+public interface PersistableValueMap extends ValueMap {
/**
* 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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -140,40 +140,4 @@ public interface Resource extends Adapta
* retrieved.
*/
ResourceResolver getResourceResolver();
-
- /**
- * TODO : What does this mean?
- * @since 2.2.0
- */
- boolean isModifiable();
-
- /**
- * @since 2.2.0
- * @throws UnsupportedOperationException, PersistenceException
- */
- void remove() throws PersistenceException;
-
- /**
- * @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 ModifiableValueMap properties) throws PersistenceException;
-
- /**
- * TODO - do we really need this method here?
- * @since 2.2.0
- * @throws UnsupportedOperationException, PersistenceException
- */
- Resource addChild(final String name, final ValueMap properties)
- throws 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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -523,16 +523,6 @@ public interface ResourceResolver extend
throws PersistenceException;
/**
- * Update the resource with the new properties set.
- * @param resource The resource
- * @param properties The properties
- *
- * @throws PersistenceException, NullPointerException
- */
- void update(Resource resource, ModifiableValueMap properties)
- throws PersistenceException;
-
- /**
* Revert all pending changes.
*/
void revert() 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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -157,40 +157,4 @@ public class ResourceWrapper implements
return getClass().getSimpleName() + ", type=" + getResourceType()
+ ", path=" + getPath() + ", resource=[" + getResource() + "]";
}
-
- /**
- * @see org.apache.sling.api.resource.Resource#isModifiable()
- */
- public boolean isModifiable() {
- return getResource().isModifiable();
- }
-
- /**
- * @see org.apache.sling.api.resource.Resource#remove()
- */
- public void remove() throws PersistenceException {
- getResource().remove();
- }
-
- /**
- * @see org.apache.sling.api.resource.Resource#update(org.apache.sling.api.resource.ModifiableValueMap)
- */
- public void update(final ModifiableValueMap properties) throws PersistenceException {
- getResource().update(properties);
- }
-
- /**
- * @see org.apache.sling.api.resource.Resource#addChild(java.lang.String, org.apache.sling.api.resource.ValueMap)
- */
- public Resource addChild(final String name, final ValueMap properties)
- 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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -28,6 +28,7 @@ import javax.jcr.RepositoryException;
import javax.jcr.Value;
import javax.jcr.nodetype.NodeType;
+import org.apache.sling.api.resource.ModifiableValueMap;
import org.apache.sling.api.resource.PersistableValueMap;
import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.jcr.resource.internal.helper.JcrPropertyMapCacheEntry;
@@ -38,7 +39,7 @@ import org.apache.sling.jcr.resource.int
*/
public final class JcrModifiablePropertyMap
extends JcrPropertyMap
- implements PersistableValueMap {
+ implements PersistableValueMap, ModifiableValueMap {
/** Set of removed and changed properties. */
private Set<String> changedProperties;
@@ -182,7 +183,7 @@ public final class JcrModifiableProperty
return;
}
try {
- this.apply();
+ this.update();
getNode().getSession().save();
} catch (final RepositoryException re) {
throw new PersistenceException("Unable to persist changes.", re);
@@ -190,41 +191,59 @@ public final class JcrModifiableProperty
}
/**
- * Apply all changes but don't save
+ * @see org.apache.sling.api.resource.ModifiableValueMap#update()
*/
- public void apply() throws RepositoryException {
+ public void update() throws PersistenceException {
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);
+ 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);
+ }
}
- }
- 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);
+ 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]);
+ }
} else {
- node.setProperty(name, entry.values[0]);
+ node.setProperty(name, (String)null);
}
- } else {
- node.setProperty(name, (String)null);
}
}
+ this.reset();
+ } catch (final RepositoryException re) {
+ throw new PersistenceException("Unable to persist changes.", re);
}
+ }
+
+ /**
+ * @see org.apache.sling.api.resource.ModifiableValueMap#revert()
+ */
+ public void revert() {
this.reset();
}
+
+ /**
+ * @see org.apache.sling.api.resource.ModifiableValueMap#hasChanges()
+ */
+ public boolean hasChanges() {
+ return this.changedProperties != null && this.changedProperties.size() > 0;
+ }
}
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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -127,7 +127,7 @@ public class JcrNodeResource extends Jcr
return (Type) getURL(); // unchecked cast
} else if (type == Map.class || type == ValueMap.class) {
return (Type) new JcrPropertyMap(getNode(), this.dynamicClassLoader); // unchecked cast
- } else if (type == PersistableValueMap.class) {
+ } else if (type == PersistableValueMap.class || type == ModifiableValueMap.class ) {
// check write
try {
getNode().getSession().checkPermission(getNode().getPath(),
@@ -136,12 +136,12 @@ public class JcrNodeResource extends Jcr
} catch (AccessControlException ace) {
// the user has no write permission, cannot adapt
LOGGER.debug(
- "adaptTo(PersistableValueMap): Cannot set properties on {}",
+ "adaptTo(ModifiableValueMap): Cannot set properties on {}",
this);
} catch (RepositoryException e) {
// some other problem, cannot adapt
LOGGER.debug(
- "adaptTo(PersistableValueMap): Unexpected problem for {}",
+ "adaptTo(ModifiableValueMap): Unexpected problem for {}",
this);
}
}
@@ -294,26 +294,4 @@ public class JcrNodeResource extends Jcr
+ getPath(), re);
}
}
-
- /**
- * @see org.apache.sling.api.resource.AbstractResource#isModifiable()
- */
- 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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -41,7 +41,6 @@ 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;
@@ -398,7 +397,7 @@ public class JcrResourceProvider
jcrMap.put(entry.getKey(), entry.getValue());
}
}
- jcrMap.apply();
+ jcrMap.update();
}
return new JcrNodeResource(resolver, node, this.dynamicClassLoader);
@@ -423,25 +422,6 @@ public class JcrResourceProvider
}
/**
- * @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 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 {
- jcrMap.apply();
- } catch (final RepositoryException e) {
- throw new PersistenceException("Unable to update node at " + path, e);
- }
- }
-
- /**
* @see org.apache.sling.api.resource.ModifyingResourceProvider#revert()
*/
public void revert() throws PersistenceException {
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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -29,7 +29,6 @@ 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;
@@ -213,11 +212,6 @@ public class JcrResourceListenerTest ext
return null;
}
- public void update(Resource resource, ModifiableValueMap properties) {
- // TODO Auto-generated method stub
-
- }
-
public void revert() {
// 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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -28,7 +28,6 @@ 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;
@@ -137,11 +136,6 @@ public class MockResourceResolver implem
return null;
}
- public void update(Resource resource, ModifiableValueMap properties) {
- // TODO Auto-generated method stub
-
- }
-
public void revert() {
// 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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -37,7 +37,6 @@ 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;
@@ -1028,19 +1027,6 @@ public class ResourceResolverImpl extend
}
/**
- * @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 ModifiableValueMap properties)
- throws PersistenceException {
- // if resource is null, we get an NPE as stated in the API
- final String path = resource.getPath();
- final ModifyingResourceProvider mrp = this.factory.getRootProviderEntry().getModifyingProvider(this.context,
- this,
- path);
- mrp.update(this, path, properties);
- }
-
- /**
* @see org.apache.sling.api.resource.ResourceResolver#revert()
*/
public void revert() throws PersistenceException {
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=1361182&r1=1361181&r2=1361182&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 12:28:55 2012
@@ -30,7 +30,6 @@ 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;
@@ -310,10 +309,6 @@ public class ResourceProviderEntryTest {
return null;
}
- public void update(Resource resource, ModifiableValueMap properties) {
- // TODO Auto-generated method stub
- }
-
public void revert() {
// TODO Auto-generated method stub