felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvalc...@apache.org
Subject svn commit: r923659 - in /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet: ConfigurationListener2.java OsgiManager.java
Date Tue, 16 Mar 2010 10:09:39 GMT
Author: vvalchev
Date: Tue Mar 16 10:09:38 2010
New Revision: 923659

URL: http://svn.apache.org/viewvc?rev=923659&view=rev
Log:
Fixed FELIX-2204
/Localization causes a problem in WebConsole configuration/

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/ConfigurationListener2.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/internal/servlet/ConfigurationListener2.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/ConfigurationListener2.java?rev=923659&r1=923658&r2=923659&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/ConfigurationListener2.java
(original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/ConfigurationListener2.java
Tue Mar 16 10:09:38 2010
@@ -21,6 +21,8 @@ package org.apache.felix.webconsole.inte
 
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Locale;
+import java.util.ResourceBundle;
 import java.util.TreeMap;
 
 import org.apache.felix.webconsole.AbstractWebConsolePlugin;
@@ -37,6 +39,7 @@ class ConfigurationListener2 extends Con
     final String pid; // reduces visibility because access to this was made though synthetic
accessor method
 
     private ObjectClassDefinition ocd;
+    private final OsgiManager osgiManager;
 
 
     static ServiceRegistration create( OsgiManager osgiManager )
@@ -51,6 +54,7 @@ class ConfigurationListener2 extends Con
     {
         super( osgiManager );
         this.pid = osgiManager.getConfigurationPid();
+        this.osgiManager = osgiManager;
     }
 
 
@@ -106,7 +110,14 @@ class ConfigurationListener2 extends Con
                     final Object plugin = loader.loadClass( defaultPluginsClasses[i] ).newInstance();
                     if ( plugin instanceof AbstractWebConsolePlugin )
                     {
-                        final String name = ( ( AbstractWebConsolePlugin ) plugin ).getTitle();
+                        String name = ( ( AbstractWebConsolePlugin ) plugin ).getTitle();
+                        if (name.startsWith("%"))
+                        {
+                            final ResourceBundle rb = osgiManager.resourceBundleManager.getResourceBundle(
+                                ((AbstractWebConsolePlugin) plugin).getBundle(),
+                                Locale.ENGLISH);
+                            name = rb.getString(name.substring(1));
+                        }
                         namesByClassName.put( defaultPluginsClasses[i], name );
                     }
                 }

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=923659&r1=923658&r2=923659&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
Tue Mar 16 10:09:38 2010
@@ -179,7 +179,7 @@ public class OsgiManager extends Generic
 
     private Set enabledPlugins;
 
-    private ResourceBundleManager resourceBundleManager;
+    ResourceBundleManager resourceBundleManager;
 
     private int logLevel = DEFAULT_LOG_LEVEL;
 



Mime
View raw message