felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r905657 - in /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole: AbstractWebConsolePlugin.java BrandingPlugin.java DefaultBrandingPlugin.java
Date Tue, 02 Feb 2010 14:52:48 GMT
Author: fmeschbe
Date: Tue Feb  2 14:52:47 2010
New Revision: 905657

URL: http://svn.apache.org/viewvc?rev=905657&view=rev
Log:
FELIX-1958 use the brand name (BrandingPlugin.getBrandName()) as the page title (together
with the plugin title) and allow for its configuraiton through the properties file (webconsole.brand.name)
in the DefaultBrandingPlugin

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/BrandingPlugin.java
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/DefaultBrandingPlugin.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java?rev=905657&r1=905656&r2=905657&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
Tue Feb  2 14:52:47 2010
@@ -34,7 +34,6 @@
 import org.apache.commons.fileupload.servlet.ServletRequestContext;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
 
 
 public abstract class AbstractWebConsolePlugin extends HttpServlet
@@ -67,8 +66,6 @@
 
     private BundleContext bundleContext;
 
-    private String adminTitle;
-
     private static BrandingPlugin brandingPlugin = DefaultBrandingPlugin.getInstance();
 
     //---------- HttpServlet Overwrites ----------------------------------------
@@ -144,10 +141,6 @@
     public void activate( BundleContext bundleContext )
     {
         this.bundleContext = bundleContext;
-
-        Dictionary headers = bundleContext.getBundle().getHeaders();
-
-        adminTitle = ( String ) headers.get( Constants.BUNDLE_NAME );
     }
 
 
@@ -425,10 +418,10 @@
         final String appRoot = ( String ) request.getAttribute( WebConsoleConstants.ATTR_APP_ROOT
);
 
         String header = MessageFormat.format( getHeader(), new Object[]
-            { adminTitle, getTitle(), appRoot, getLabel(), toUrl( brandingPlugin.getFavIcon(),
appRoot ),
-                toUrl( brandingPlugin.getMainStyleSheet(), appRoot ), brandingPlugin.getProductURL(),
-                brandingPlugin.getProductName(), toUrl( brandingPlugin.getProductImage(),
appRoot ),
-                getCssLinks( appRoot ) } );
+            { brandingPlugin.getBrandName(), getTitle(), appRoot, getLabel(),
+                toUrl( brandingPlugin.getFavIcon(), appRoot ), toUrl( brandingPlugin.getMainStyleSheet(),
appRoot ),
+                brandingPlugin.getProductURL(), brandingPlugin.getProductName(),
+                toUrl( brandingPlugin.getProductImage(), appRoot ), getCssLinks( appRoot
) } );
         pw.println( header );
 
         return pw;
@@ -619,7 +612,7 @@
     private String getHeader()
     {
         // MessageFormat pattern place holder
-        //  0 main title (plugin providing bundle name)
+        //  0 main title (brand name)
         //  1 console plugin title
         //  2 application root path (ATTR_APP_ROOT)
         //  3 console plugin label (from the URI)

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/BrandingPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/BrandingPlugin.java?rev=905657&r1=905656&r2=905657&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/BrandingPlugin.java (original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/BrandingPlugin.java Tue
Feb  2 14:52:47 2010
@@ -28,7 +28,9 @@
 public interface BrandingPlugin
 {
     /**
-     * Returns an indicative name of the branding plugin
+     * Returns an indicative name of the branding plugin. This value is used
+     * as the Window/Page title together with the title of the respective
+     * plugin.
      */
     String getBrandName();
 

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/DefaultBrandingPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/DefaultBrandingPlugin.java?rev=905657&r1=905656&r2=905657&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/DefaultBrandingPlugin.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/DefaultBrandingPlugin.java
Tue Feb  2 14:52:47 2010
@@ -35,6 +35,11 @@
  * <table>
  * <tr><th>Name</th><th>Property Name</th><th>Default
Value</th></tr>
  * <tr>
+ *  <td>Brand Name</td>
+ *  <td>webconsole.brand.name</td>
+ *  <td>Apache Felix Web Console</td>
+ * </tr>
+ * <tr>
  *  <td>Product Name</td>
  *  <td>webconsole.product.name</td>
  *  <td>Apache Felix</td>
@@ -92,6 +97,8 @@
 
     private static DefaultBrandingPlugin instance;
 
+    private final String brandName;
+
     private final String productName;
 
     private final String productURL;
@@ -137,6 +144,7 @@
         }
 
         // set the fields from the properties now
+        brandName = props.getProperty( "webconsole.brand.name", "Apache Felix Web Console"
);
         productName = props.getProperty( "webconsole.product.name", "Apache Felix" );
         productURL = props.getProperty( "webconsole.product.url", "http://felix.apache.org"
);
         productImage = props.getProperty( "webconsole.product.image", "/res/imgs/logo.png"
);
@@ -160,7 +168,7 @@
 
     public String getBrandName()
     {
-        return "DefaultBrandingPlugin";
+        return brandName;
     }
 
 



Mime
View raw message