Remove unused imports and use ResourceUtil instead of directly calling adaptTo for a value map.
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@894668 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/html.jsp
index 49d27d3..919b4bd 100644
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/html.jsp
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Album/html.jsp
@@ -16,17 +16,12 @@
specific language governing permissions and limitations
under the License.
--%><%@page session="false" %><%
-%><%@page import="java.util.ArrayList,
- java.util.Iterator,
- java.util.List,
- org.apache.sling.api.resource.Resource,
- org.apache.sling.api.resource.ResourceUtil,
- org.apache.sling.api.resource.ValueMap,
- org.apache.sling.sample.slingshot.Constants" %><%
+%><%@page import="org.apache.sling.api.resource.ResourceUtil,
+ org.apache.sling.api.resource.ValueMap" %><%
%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><sling:defineObjects/><%
-final ValueMap attributes = resource.adaptTo(ValueMap.class);
+final ValueMap attributes = ResourceUtil.getValueMap(resource);
final String albumName = attributes.get("jcr:title", ResourceUtil.getName(resource));
%><html>
<head>
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/html.jsp
index 2acad73..0afef81 100644
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/html.jsp
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/html.jsp
@@ -16,7 +16,6 @@
specific language governing permissions and limitations
under the License.
--%><%@page session="false" %><%
-%><%@page import="java.util.Map" %><%
%><%@page import="org.apache.sling.api.resource.ResourceUtil,
org.apache.sling.api.resource.ValueMap"%><%
%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/main.html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/main.html.jsp
index 25f1ab1..41e68f6 100644
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/main.html.jsp
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Photo/main.html.jsp
@@ -24,7 +24,7 @@
%><sling:defineObjects/><%
%><div class="photo">
<%
-final ValueMap attr = ResourceUtil.getValueMap(resource);
+ final ValueMap attr = ResourceUtil.getValueMap(resource);
final String albumName = ResourceUtil.getName(ResourceUtil.getParent(resource));
final String photoName = attr.get("jcr:title", ResourceUtil.getName(resource));
final String relPath = resource.getPath();
diff --git a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Tag/html.jsp b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Tag/html.jsp
index 4af447b..b8f4ab1 100644
--- a/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Tag/html.jsp
+++ b/slingshot/src/main/resources/SLING-INF/content/libs/slingshot/Tag/html.jsp
@@ -23,7 +23,7 @@
java.util.Iterator"%><%
%><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0" %><%
%><sling:defineObjects/><%
- final ValueMap attributes = resource.adaptTo(ValueMap.class);
+ final ValueMap attributes = ResourceUtil.getValueMap(resource);
final String name = ResourceUtil.getName(resource);
final ResourceResolver resolver = resource.getResourceResolver();
%><html>