incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r889624 - in /sling/trunk/bundles/jcr/resource/src: main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverWebConsolePlugin.java test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
Date Fri, 11 Dec 2009 13:58:18 GMT
Author: fmeschbe
Date: Fri Dec 11 13:58:17 2009
New Revision: 889624

URL: http://svn.apache.org/viewvc?rev=889624&view=rev
Log:
SLING-1233 Add (subset of) current configuration to the web console page and fix JcrResourceResolverTest
(have to setup mapRoot field before testing)

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverWebConsolePlugin.java
    sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverWebConsolePlugin.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverWebConsolePlugin.java?rev=889624&r1=889623&r2=889624&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverWebConsolePlugin.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverWebConsolePlugin.java
Fri Dec 11 13:58:17 2009
@@ -111,6 +111,28 @@
 
         MapEntries mapEntries = resolverFactory.getMapEntries();
 
+        titleHtml(pw, "Configuration", null);
+        pw.println("<tr class='content'>");
+        pw.println("<td class='content'>Resource Search Path</td>");
+        pw.print("<td class='content' colspan='2'>");
+        pw.print(Arrays.asList(resolverFactory.getSearchPath()).toString());
+        pw.print("</td>");
+        pw.println("</tr>");
+        pw.println("<tr class='content'>");
+        pw.println("<td class='content'>Namespace Mangling</td>");
+        pw.print("<td class='content' colspan='2'>");
+        pw.print(resolverFactory.isMangleNamespacePrefixes() ? "Enabled" : "Disabled");
+        pw.print("</td>");
+        pw.println("</tr>");
+        pw.println("<tr class='content'>");
+        pw.println("<td class='content'>Mapping Location</td>");
+        pw.print("<td class='content' colspan='2'>");
+        pw.print(resolverFactory.getMapRoot());
+        pw.print("</td>");
+        pw.println("</tr>");
+
+        separatorHtml(pw);
+
         titleHtml(
             pw,
             "Configuration Test",
@@ -143,7 +165,7 @@
             pw.println("</tr>");
         }
 
-        separator(pw);
+        separatorHtml(pw);
 
         dumpMapHtml(
             pw,
@@ -151,7 +173,7 @@
             "Lists the entries used by the ResourceResolver.resolve methods to map URLs to
Resources",
             mapEntries.getResolveMaps());
 
-        separator(pw);
+        separatorHtml(pw);
 
         dumpMapHtml(
             pw,
@@ -225,7 +247,7 @@
             "Resolver Map Entries",
             mapEntries.getResolveMaps());
 
-        separator(pw);
+         separatorText(pw);
 
         dumpMapText(
             pw,
@@ -283,6 +305,12 @@
         }
     }
 
+    private void separatorHtml(PrintWriter pw) {
+        pw.println("<tr class='content'>");
+        pw.println("<td class='content' colspan='3'>&nbsp;</td>");
+        pw.println("</tr>");
+    }
+
     private void dumpMapText(PrintWriter pw, String title,
             Collection<MapEntry> list) {
 
@@ -300,10 +328,8 @@
         }
     }
 
-    private void separator(PrintWriter pw) {
-        pw.println("<tr class='content'>");
-        pw.println("<td class='content' colspan='3'>&nbsp;</td>");
-        pw.println("</tr>");
+    private void separatorText(PrintWriter pw) {
+        pw.println();
     }
 
     private static class ResolverRequest extends HttpServletRequestWrapper {

Modified: sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java?rev=889624&r1=889623&r2=889624&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverTest.java
Fri Dec 11 13:58:17 2009
@@ -109,6 +109,11 @@
         mangeNamespacePrefixesField.setAccessible(true);
         mangeNamespacePrefixesField.set(resFac, true);
 
+        // setup mapping root
+        Field mapRootField = resFac.getClass().getDeclaredField("mapRoot");
+        mapRootField.setAccessible(true);
+        mapRootField.set(resFac, "/etc/map");
+
         Field mapEntriesField = resFac.getClass().getDeclaredField("mapEntries");
         mapEntriesField.setAccessible(true);
         mapEntries = new MapEntries(resFac, getRepository());



Mime
View raw message