incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1021417 - in /sling/trunk/bundles/jcr/resource: pom.xml src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverWebConsolePlugin.java
Date Mon, 11 Oct 2010 16:39:56 GMT
Author: cziegeler
Date: Mon Oct 11 16:39:56 2010
New Revision: 1021417

URL: http://svn.apache.org/viewvc?rev=1021417&view=rev
Log:
SLING-1837 : Remove direct dependency to web console by using new configuration printer support

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

Modified: sling/trunk/bundles/jcr/resource/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/pom.xml?rev=1021417&r1=1021416&r2=1021417&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/pom.xml (original)
+++ sling/trunk/bundles/jcr/resource/pom.xml Mon Oct 11 16:39:56 2010
@@ -76,7 +76,6 @@
                             javax.script.*;
                             org.apache.sling.scripting.api.*;resolution:=optional,
                             org.apache.sling.api.resource;version="[$(version;==;$(@)),$(version;=+;$(@)))",
-                            org.apache.felix.webconsole;resolution:=optional,
                             *
                         </Import-Package>
                         <Export-Package>
@@ -181,12 +180,6 @@
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.webconsole</artifactId>
-            <version>1.2.0</version>
-            <scope>provided</scope>
-        </dependency>
 
         <!-- for adapting JCR resources to URLs -->
         <dependency>

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=1021417&r1=1021416&r2=1021417&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
Mon Oct 11 16:39:56 2010
@@ -28,13 +28,11 @@ import java.util.List;
 
 import javax.jcr.Session;
 import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.felix.webconsole.AbstractWebConsolePlugin;
-import org.apache.felix.webconsole.ConfigurationPrinter;
-import org.apache.felix.webconsole.WebConsoleConstants;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.jcr.resource.internal.helper.MapEntries;
 import org.apache.sling.jcr.resource.internal.helper.MapEntry;
@@ -45,7 +43,7 @@ import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
 
 public class JcrResourceResolverWebConsolePlugin extends
-        AbstractWebConsolePlugin implements ConfigurationPrinter {
+        HttpServlet {
 
     private static final long serialVersionUID = 0;
 
@@ -63,44 +61,30 @@ public class JcrResourceResolverWebConso
             JcrResourceResolverFactoryImpl resolverFactory) {
         this.resolverFactory = resolverFactory;
 
-        activate(context);
-
         Dictionary<String, Object> props = new Hashtable<String, Object>();
         props.put(Constants.SERVICE_DESCRIPTION,
             "JCRResourceResolver Web Console Plugin");
         props.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         props.put(Constants.SERVICE_PID, getClass().getName());
-        props.put(WebConsoleConstants.PLUGIN_LABEL, getLabel());
+        props.put("felix.webconsole.label", "jcrresolver");
+        props.put("felix.webconsole.title", "JCR ResourceResolver");
+        props.put("felix.webconsole.configprinter.modes", "always");
 
         service = context.registerService(new String[] {
-            WebConsoleConstants.SERVICE_NAME, ConfigurationPrinter.SERVICE },
+                "javax.servlet.Servlet" },
             this, props);
     }
 
     void dispose() {
         if (service != null) {
             service.unregister();
-            deactivate();
             service = null;
         }
     }
 
-    // ---------- AbstractWebConsolePlugin
-
-    @Override
-    public String getLabel() {
-        return "jcrresolver";
-    }
-
     @Override
-    public String getTitle() {
-        return "JCR ResourceResolver";
-    }
-
-    @Override
-    protected void renderContent(HttpServletRequest request,
-            HttpServletResponse response) throws IOException {
-
+    protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
+    throws ServletException, IOException {
         String test = (String) request.getAttribute(ATTR_TEST);
         if (test == null) test = "";
         String result = (String) request.getAttribute(ATTR_RESULT);



Mime
View raw message