felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r789243 - in /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole: ./ internal/compendium/ internal/core/ internal/deppack/ internal/misc/ internal/servlet/
Date Mon, 29 Jun 2009 07:21:39 GMT
Author: fmeschbe
Date: Mon Jun 29 07:21:39 2009
New Revision: 789243

URL: http://svn.apache.org/viewvc?rev=789243&view=rev
Log:
FELIX-1281 Adding official constants for the request attributes
providing the web console root path and the labe/title map of
plugins.

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleConstants.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ComponentsServlet.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/deppack/DepPackServlet.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/EventAdminServlet.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleConstants.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleConstants.java?rev=789243&r1=789242&r2=789243&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleConstants.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleConstants.java
Mon Jun 29 07:21:39 2009
@@ -50,4 +50,30 @@
      */
     public static final String PLUGIN_TITLE = "felix.webconsole.title";
 
+    /**
+     * The name of the request attribute providing the absolute path of the
+     * Web Console root (value is "felix.webconsole.appRoot"). This consists of
+     * the servlet context path (from <code>ServletRequest.getContextPath()</code>)
+     * and the configured path of the web console root (<code>/system/console</code>
+     * by default).
+     * <p>
+     * The type of this request attribute is <code>String</code>.
+     *
+     * @since 1.2.12
+     */
+    public static final String ATTR_APP_ROOT = "felix.webconsole.appRoot";
+
+    /**
+     * The name of the request attribute providing a mapping of labels to page
+     * titles of registered console plugins (value is "felix.webconsole.labelMap").
+     * This map may be used to render a navigation of the console plugins as the
+     * {@link AbstractWebConsolePlugin#renderTopNavigation(javax.servlet.http.HttpServletRequest,
java.io.PrintWriter)}
+     * method does.
+     * <p>
+     * The type of this request attribute is <code>Map<String, String></code>.
+     *
+     * @since 1.2.12
+     */
+    public static final String ATTR_LABEL_MAP = "felix.webconsole.labelMap";
+
 }

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ComponentsServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ComponentsServlet.java?rev=789243&r1=789242&r2=789243&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ComponentsServlet.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ComponentsServlet.java
Mon Jun 29 07:21:39 2009
@@ -33,9 +33,9 @@
 import org.apache.felix.scr.Component;
 import org.apache.felix.scr.Reference;
 import org.apache.felix.scr.ScrService;
+import org.apache.felix.webconsole.WebConsoleConstants;
 import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
 import org.apache.felix.webconsole.internal.Util;
-import org.apache.felix.webconsole.internal.servlet.OsgiManager;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONWriter;
@@ -141,7 +141,7 @@
         final RequestInfo reqInfo = getRequestInfo(request);
         final PrintWriter pw = response.getWriter();
 
-        final String appRoot = ( String ) request.getAttribute( OsgiManager.ATTR_APP_ROOT
);
+        final String appRoot = ( String ) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT
);
 
         Util.startScript( pw );
         pw.println( "var imgRoot = '" + appRoot + "/res/imgs';");

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java?rev=789243&r1=789242&r2=789243&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
Mon Jun 29 07:21:39 2009
@@ -42,8 +42,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.felix.webconsole.WebConsoleConstants;
 import org.apache.felix.webconsole.internal.Util;
-import org.apache.felix.webconsole.internal.servlet.OsgiManager;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONWriter;
@@ -276,7 +276,7 @@
 
         final PrintWriter pw = response.getWriter();
 
-        final String appRoot = (String) request.getAttribute( OsgiManager.ATTR_APP_ROOT );
+        final String appRoot = (String) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT
);
         pw.println( "<script src='" + appRoot + "/res/ui/configmanager.js' language='JavaScript'></script>"
);
 
         pw.println( "<table class='content' cellpadding='0' cellspacing='0' width='100%'>"
);

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java?rev=789243&r1=789242&r2=789243&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/LogServlet.java
Mon Jun 29 07:21:39 2009
@@ -25,9 +25,9 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.felix.webconsole.WebConsoleConstants;
 import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
 import org.apache.felix.webconsole.internal.Util;
-import org.apache.felix.webconsole.internal.servlet.OsgiManager;
 import org.json.JSONException;
 import org.json.JSONWriter;
 import org.osgi.framework.ServiceReference;
@@ -162,7 +162,7 @@
     {
         final PrintWriter pw = response.getWriter();
 
-        final String appRoot = ( String ) request.getAttribute( OsgiManager.ATTR_APP_ROOT
);
+        final String appRoot = ( String ) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT
);
         Util.script( pw, appRoot, "logs.js" );
 
         pw.println( "<div id='plugin_content'/>" );

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java?rev=789243&r1=789242&r2=789243&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java
Mon Jun 29 07:21:39 2009
@@ -26,9 +26,9 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.felix.bundlerepository.*;
+import org.apache.felix.webconsole.WebConsoleConstants;
 import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
 import org.apache.felix.webconsole.internal.Util;
-import org.apache.felix.webconsole.internal.servlet.OsgiManager;
 import org.json.*;
 import org.osgi.framework.*;
 import org.osgi.service.cm.ConfigurationAdmin;
@@ -281,7 +281,7 @@
         final RequestInfo reqInfo = getRequestInfo(request);
         final PrintWriter pw = response.getWriter();
 
-        final String appRoot = ( String ) request.getAttribute( OsgiManager.ATTR_APP_ROOT
);
+        final String appRoot = ( String ) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT
);
 
         Util.startScript( pw );
         pw.println( "var imgRoot = '" + appRoot + "/res/imgs';");

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/deppack/DepPackServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/deppack/DepPackServlet.java?rev=789243&r1=789242&r2=789243&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/deppack/DepPackServlet.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/deppack/DepPackServlet.java
Mon Jun 29 07:21:39 2009
@@ -27,9 +27,9 @@
 
 import org.apache.commons.fileupload.FileItem;
 import org.apache.felix.webconsole.AbstractWebConsolePlugin;
+import org.apache.felix.webconsole.WebConsoleConstants;
 import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
 import org.apache.felix.webconsole.internal.Util;
-import org.apache.felix.webconsole.internal.servlet.OsgiManager;
 import org.json.JSONException;
 import org.json.JSONWriter;
 import org.osgi.service.component.ComponentContext;
@@ -162,7 +162,7 @@
 
         PrintWriter pw = response.getWriter();
 
-        String appRoot = ( String ) request.getAttribute( OsgiManager.ATTR_APP_ROOT );
+        String appRoot = ( String ) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT
);
         pw.println( "<script src='" + appRoot + "/res/ui/packages.js' language='JavaScript'></script>"
);
 
         pw.println( "<h1>Deployment Admin</h1>" );

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/EventAdminServlet.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/EventAdminServlet.java?rev=789243&r1=789242&r2=789243&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/EventAdminServlet.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/misc/EventAdminServlet.java
Mon Jun 29 07:21:39 2009
@@ -25,9 +25,9 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.felix.webconsole.WebConsoleConstants;
 import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
 import org.apache.felix.webconsole.internal.Util;
-import org.apache.felix.webconsole.internal.servlet.OsgiManager;
 import org.json.JSONException;
 import org.json.JSONWriter;
 import org.osgi.framework.*;
@@ -233,7 +233,7 @@
     {
         final PrintWriter pw = response.getWriter();
 
-        final String appRoot = ( String ) request.getAttribute( OsgiManager.ATTR_APP_ROOT
);
+        final String appRoot = ( String ) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT
);
         Util.script(pw, appRoot, "events.js");
 
         pw.println( "<div id='plugin_content'/>");

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java?rev=789243&r1=789242&r2=789243&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
Mon Jun 29 07:21:39 2009
@@ -305,8 +305,8 @@
         if ( plugin != null )
         {
             // the official request attributes
-//            req.setAttribute( WebConsoleConstants.ATTR_LABEL_MAP, labelMap );
-//            req.setAttribute( WebConsoleConstants.ATTR_APP_ROOT, request.getContextPath()
+ request.getServletPath() );
+            req.setAttribute( WebConsoleConstants.ATTR_LABEL_MAP, labelMap );
+            req.setAttribute( WebConsoleConstants.ATTR_APP_ROOT, request.getContextPath()
+ request.getServletPath() );
 
             // deprecated request attributes
             req.setAttribute( ATTR_LABEL_MAP_OLD, labelMap );



Mime
View raw message