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 2013/04/04 11:34:22 UTC
svn commit: r1464394 - in
/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource:
ModifiableValueMap.java ModifyingResourceProvider.java ResourceResolver.java
Author: cziegeler
Date: Thu Apr 4 09:34:21 2013
New Revision: 1464394
URL: http://svn.apache.org/r1464394
Log:
SLING-2782 : Try to use sling:resourceType as a node type for node creation
Modified:
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/ResourceResolver.java
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=1464394&r1=1464393&r2=1464394&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 Thu Apr 4 09:34:21 2013
@@ -49,6 +49,10 @@ package org.apache.sling.api.resource;
* <li>{@link #clear()}</li>
* </ul>
* <p>
+ *
+ * A modifiable value map should value {@link ResourceResolver#PROPERTY_RESOURCE_TYPE}
+ * to set the resource type of a resource.
+ *
* @since 2.2
*/
public interface ModifiableValueMap extends ValueMap {
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=1464394&r1=1464393&r2=1464394&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 Thu Apr 4 09:34:21 2013
@@ -48,6 +48,9 @@ public interface ModifyingResourceProvid
* The new resource is put into the transient space of this provider
* until {@link #commit(ResourceResolver)} is called.
*
+ * A resource provider should value {@link ResourceResolver#PROPERTY_RESOURCE_TYPE}
+ * to set the resource type of a resource.
+ *
* @param resolver The current resource resolver.
* @param path The resource path.
* @param properties Optional properties
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=1464394&r1=1464393&r2=1464394&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 Thu Apr 4 09:34:21 2013
@@ -121,6 +121,17 @@ public interface ResourceResolver extend
String USER_IMPERSONATOR = "user.impersonator";
/**
+ * This is the suggested property to be used for setting the resource type
+ * of a resource during either creation ({@link #create(Resource, String, Map)})
+ * or modifying ({@link ModifiableValueMap}).
+ * However the exact way to set the resource type of a resource is defined
+ * by the underlying resource provider. It should value this property but
+ * is not required to do so.
+ * @since 2.3
+ */
+ String PROPERTY_RESOURCE_TYPE = "sling:resourceType";
+
+ /**
* Resolves the resource from the given <code>absPath</code> optionally
* taking <code>HttpServletRequest</code> into account, such as the value of
* the <code>Host</code> request header. Returns a