incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r811295 - in /sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers: HtmlRendererServlet.java PlainTextRendererServlet.java
Date Fri, 04 Sep 2009 09:03:20 GMT
Author: fmeschbe
Date: Fri Sep  4 09:03:20 2009
New Revision: 811295

URL: http://svn.apache.org/viewvc?rev=811295&view=rev
Log:
SLING-1098 for debugging purposes also print the resource type and resource super type
of resources in text/plain and text/html representations.

Modified:
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
    sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java?rev=811295&r1=811294&r2=811295&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/HtmlRendererServlet.java
Fri Sep  4 09:03:20 2009
@@ -99,6 +99,21 @@
         pw.println("<p>Resource path: <b>" + r.getPath() + "</b></p>");
         pw.println("<p>Resource metadata: <b>" + r.getResourceMetadata()
             + "</b></p>");
+
+        pw.println("<p>Resource type: <b>" + r.getResourceType() + "</b></p>");
+
+        String resourceSuperType = r.getResourceSuperType();
+        if (resourceSuperType == null) {
+            resourceSuperType = ResourceUtil.getResourceSuperType(
+                r.getResourceResolver(), r.getResourceType());
+            if (resourceSuperType == null) {
+                resourceSuperType = "sling/servlet/default (default resource super type)";
+            } else {
+                resourceSuperType += " (from resource type hierarchy)";
+            }
+        }
+        pw.println("<p>Resource super type: <b>" + resourceSuperType
+            + "</b></p>");
     }
 
     @SuppressWarnings("unchecked")

Modified: sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java?rev=811295&r1=811294&r2=811295&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java
(original)
+++ sling/trunk/bundles/servlets/get/src/main/java/org/apache/sling/servlets/get/impl/helpers/PlainTextRendererServlet.java
Fri Sep  4 09:03:20 2009
@@ -83,6 +83,19 @@
         pw.println("** Resource dumped by " + getClass().getSimpleName() + "**");
         pw.println("Resource path:" + r.getPath());
         pw.println("Resource metadata: " + r.getResourceMetadata());
+        pw.println("Resource type: " + r.getResourceType());
+
+        String resourceSuperType = r.getResourceSuperType();
+        if (resourceSuperType == null) {
+            resourceSuperType = ResourceUtil.getResourceSuperType(
+                r.getResourceResolver(), r.getResourceType());
+            if (resourceSuperType == null) {
+                resourceSuperType = "sling/servlet/default (default resource super type)";
+            } else {
+                resourceSuperType += " (from resource type hierarchy)";
+            }
+        }
+        pw.println("Resource super type: " + resourceSuperType);
 
         pw.println("\n** Resource properties **");
         final Iterator<Map.Entry> pi = map.entrySet().iterator();



Mime
View raw message