incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r818804 - /sling/trunk/contrib/extensions/runmode/src/main/java/org/apache/sling/runmode/impl/RunModePanel.java
Date Fri, 25 Sep 2009 10:06:13 GMT
Author: cziegeler
Date: Fri Sep 25 10:06:13 2009
New Revision: 818804

URL: http://svn.apache.org/viewvc?rev=818804&view=rev
Log:
SLING-1124 : RunMode should only provide a configuration printer for the web console

Modified:
    sling/trunk/contrib/extensions/runmode/src/main/java/org/apache/sling/runmode/impl/RunModePanel.java

Modified: sling/trunk/contrib/extensions/runmode/src/main/java/org/apache/sling/runmode/impl/RunModePanel.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/runmode/src/main/java/org/apache/sling/runmode/impl/RunModePanel.java?rev=818804&r1=818803&r2=818804&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/runmode/src/main/java/org/apache/sling/runmode/impl/RunModePanel.java
(original)
+++ sling/trunk/contrib/extensions/runmode/src/main/java/org/apache/sling/runmode/impl/RunModePanel.java
Fri Sep 25 10:06:13 2009
@@ -14,80 +14,22 @@
  */
 package org.apache.sling.runmode.impl;
 
-import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Arrays;
 
-import javax.servlet.Servlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.felix.webconsole.AbstractWebConsolePlugin;
 import org.apache.felix.webconsole.ConfigurationPrinter;
 import org.apache.sling.runmode.RunMode;
-import org.osgi.service.component.ComponentContext;
 
 /**
  * @scr.component metatype="no"
  * @scr.service
- * @scr.property name="felix.webconsole.label" valueRef="LABEL"
  */
-public class RunModePanel extends AbstractWebConsolePlugin implements Servlet,
-        ConfigurationPrinter {
-
-    private static final String LABEL = "runmodes";
-
+public class RunModePanel implements ConfigurationPrinter {
     private static final String TITLE = "Run Modes";
 
     /** @scr.reference */
     private RunMode runMode;
 
-    // ---------- AbstractWebConsolePlugin API
-
-    @Override
-    public String getLabel() {
-        return LABEL;
-    }
-
-    @Override
-    public String getTitle() {
-        return TITLE;
-    }
-
-    @Override
-    protected void renderContent(HttpServletRequest request,
-            HttpServletResponse response) throws IOException {
-        PrintWriter pw = response.getWriter();
-
-        pw.println("<pre>");
-        pw.println("</pre>");
-
-        pw.println("<table class='content' cellpadding='0' cellspacing='0' width='100%'>");
-
-        pw.println("<tr class='content'>");
-        pw.println("<th class='content container' colspan='2'>" + getTitle()
-            + "</th>");
-        pw.println("</tr>");
-
-        pw.println("<tr class='content'>");
-        pw.println("<td class='content'>Current Run Modes</td>");
-        pw.println("<td class='content'>");
-
-        String[] modes = runMode.getCurrentRunModes();
-        if (modes == null || modes.length == 0) {
-            pw.println("-");
-        } else {
-            for (String mode : modes) {
-                pw.print(mode);
-                pw.println("<br>");
-            }
-        }
-
-        pw.println("</td>");
-        pw.println("</tr>");
-        pw.println("</table>");
-    }
-
     // ---------- ConfigurationPrinter
 
     public void printConfiguration(PrintWriter pw) {
@@ -101,13 +43,7 @@
         }
     }
 
-    // ---------- SCR integration
-
-    protected void activate(ComponentContext context) {
-        activate(context.getBundleContext());
-    }
-
-    protected void deactivate(ComponentContext context) {
-        deactivate();
+    public String getTitle() {
+        return TITLE;
     }
 }



Mime
View raw message