You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2007/12/18 13:02:17 UTC
svn commit: r605196 - in /incubator/sling/trunk/scripting:
jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/
jsp-taglib/src/main/resources/META-INF/
jsp/src/main/java/org/apache/sling/scripting/jsp/util/
Author: fmeschbe
Date: Tue Dec 18 04:02:10 2007
New Revision: 605196
URL: http://svn.apache.org/viewvc?rev=605196&view=rev
Log:
SLING-134 Use ResourceResolver instead of ResourceManager, which has
been removed.
Modified:
incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTEI.java
incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTag.java
incubator/sling/trunk/scripting/jsp-taglib/src/main/resources/META-INF/taglib.tld
incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/util/TagUtil.java
Modified: incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTEI.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTEI.java?rev=605196&r1=605195&r2=605196&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTEI.java (original)
+++ incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTEI.java Tue Dec 18 04:02:10 2007
@@ -16,7 +16,13 @@
*/
package org.apache.sling.scripting.jsp.taglib;
-import static org.apache.sling.scripting.jsp.taglib.DefineObjectsTag.*;
+import static org.apache.sling.scripting.jsp.taglib.DefineObjectsTag.DEFAULT_MAPPED_OBJECT_NAME;
+import static org.apache.sling.scripting.jsp.taglib.DefineObjectsTag.DEFAULT_NODE_NAME;
+import static org.apache.sling.scripting.jsp.taglib.DefineObjectsTag.DEFAULT_REQUEST_NAME;
+import static org.apache.sling.scripting.jsp.taglib.DefineObjectsTag.DEFAULT_RESOURCE_NAME;
+import static org.apache.sling.scripting.jsp.taglib.DefineObjectsTag.DEFAULT_RESOURCE_RESOLVER_NAME;
+import static org.apache.sling.scripting.jsp.taglib.DefineObjectsTag.DEFAULT_RESPONSE_NAME;
+import static org.apache.sling.scripting.jsp.taglib.DefineObjectsTag.DEFAULT_SERVICE_LOCATOR_NAME;
import java.util.ArrayList;
import java.util.List;
@@ -29,7 +35,7 @@
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceManager;
+import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.services.ServiceLocator;
/**
@@ -82,9 +88,9 @@
/**
* The name of the tag attribute used to define the name of the
- * ResourceManager scripting variable (value is "resourceManagerName").
+ * ResourceResolver scripting variable (value is "resourceResolverName").
*/
- public static final String ATTR_RESOURCE_MANAGER_NAME = "resourceManagerName";
+ public static final String ATTR_RESOURCE_RESOLVER_NAME = "resourceResolverName";
private static final String RENDER_REQUEST_CLASS = SlingHttpServletRequest.class.getName();
@@ -92,7 +98,7 @@
private static final String RESOURCE_CLASS = Resource.class.getName();
- private static final String RESOURCE_MANAGER_CLASS = ResourceManager.class.getName();
+ private static final String RESOURCE_RESOLVER_CLASS = ResourceResolver.class.getName();
private static final String NODE_CLASS = Node.class.getName();
@@ -122,8 +128,8 @@
addVar(varInfos, data, ATTR_MAPPED_OBJECT_NAME,
DEFAULT_MAPPED_OBJECT_NAME, mappedObjectClass);
- addVar(varInfos, data, ATTR_RESOURCE_MANAGER_NAME,
- DEFAULT_RESOURCE_MANAGER_NAME, RESOURCE_MANAGER_CLASS);
+ addVar(varInfos, data, ATTR_RESOURCE_RESOLVER_NAME,
+ DEFAULT_RESOURCE_RESOLVER_NAME, RESOURCE_RESOLVER_CLASS);
addVar(varInfos, data, ATTR_SERVICE_LOCATOR_NAME,
DEFAULT_SERVICE_LOCATOR_NAME, SERVICE_LOCATOR_CLASS);
Modified: incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTag.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTag.java?rev=605196&r1=605195&r2=605196&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTag.java (original)
+++ incubator/sling/trunk/scripting/jsp-taglib/src/main/java/org/apache/sling/scripting/jsp/taglib/DefineObjectsTag.java Tue Dec 18 04:02:10 2007
@@ -22,7 +22,7 @@
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.ResourceManager;
+import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.scripting.jsp.util.TagUtil;
/**
@@ -66,9 +66,9 @@
/**
* Default name for the scripting variable referencing the current
- * <code>ResourceManager</code> (value is "resourceManager").
+ * <code>ResourceResolver</code> (value is "resourceResolver").
*/
- public static final String DEFAULT_RESOURCE_MANAGER_NAME = "resourceManager";
+ public static final String DEFAULT_RESOURCE_RESOLVER_NAME = "resourceResolver";
/**
* Default name for the scripting variable referencing the current
@@ -88,7 +88,7 @@
private String mappedObjectClass = null;
- private String resourceManagerName = DEFAULT_RESOURCE_MANAGER_NAME;
+ private String resourceResolverName = DEFAULT_RESOURCE_RESOLVER_NAME;
private String serviceLocatorName = DEFAULT_SERVICE_LOCATOR_NAME;
@@ -105,7 +105,7 @@
* <li><code>SlingHttpServletResponse</code>
* <li>current <code>Resource</code>
* <li>current <code>Node</code> (if resource is a NodeProvider)
- * <li>current <code>ResourceManager</code>
+ * <li>current <code>ResourceResolver</code>
* <li>current <code>ServiceLocator</code>
* </ul>
*
@@ -116,12 +116,12 @@
SlingHttpServletRequest req = TagUtil.getRequest(pageContext);
SlingHttpServletResponse res = TagUtil.getResponse(pageContext);
Resource resource = req.getResource();
- ResourceManager resourceManager = TagUtil.getResourceManager(pageContext);
+ ResourceResolver resourceResolver = TagUtil.getResourceResolver(pageContext);
pageContext.setAttribute(requestName, req);
pageContext.setAttribute(responseName, res);
pageContext.setAttribute(resourceName, resource);
- pageContext.setAttribute(resourceManagerName, resourceManager);
+ pageContext.setAttribute(resourceResolverName, resourceResolver);
pageContext.setAttribute(serviceLocatorName, req.getServiceLocator());
Node node = resource.adaptTo(Node.class);
@@ -166,8 +166,8 @@
this.mappedObjectClass = name;
}
- public void setResourceManagerName(String name) {
- this.resourceManagerName = name;
+ public void setResourceResolverName(String name) {
+ this.resourceResolverName = name;
}
public void setServiceLocatorName(String name) {
Modified: incubator/sling/trunk/scripting/jsp-taglib/src/main/resources/META-INF/taglib.tld
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/jsp-taglib/src/main/resources/META-INF/taglib.tld?rev=605196&r1=605195&r2=605196&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/jsp-taglib/src/main/resources/META-INF/taglib.tld (original)
+++ incubator/sling/trunk/scripting/jsp-taglib/src/main/resources/META-INF/taglib.tld Tue Dec 18 04:02:10 2007
@@ -129,7 +129,7 @@
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
- <name>resourceManagerName</name>
+ <name>resourceResolverName</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
Modified: incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/util/TagUtil.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/util/TagUtil.java?rev=605196&r1=605195&r2=605196&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/util/TagUtil.java (original)
+++ incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/util/TagUtil.java Tue Dec 18 04:02:10 2007
@@ -25,7 +25,7 @@
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
-import org.apache.sling.api.resource.ResourceManager;
+import org.apache.sling.api.resource.ResourceResolver;
import org.slf4j.Logger;
/**
@@ -113,10 +113,10 @@
return (SlingHttpServletResponse) req;
}
- public static ResourceManager getResourceManager(PageContext pageContext) {
+ public static ResourceResolver getResourceResolver(PageContext pageContext) {
try {
SlingHttpServletRequest request = getRequest(pageContext);
- return (ResourceManager) request.getResourceResolver();
+ return request.getResourceResolver();
} catch (ClassCastException cce) {
throw new IllegalStateException("resource resolver wrong class");
}