You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Valentin Valchev (JIRA)" <ji...@apache.org> on 2010/03/16 17:08:27 UTC

[jira] Created: (FELIX-2206) Localization causes a problem in Configuration Printers

Localization causes a problem in Configuration Printers
-------------------------------------------------------

                 Key: FELIX-2206
                 URL: https://issues.apache.org/jira/browse/FELIX-2206
             Project: Felix
          Issue Type: Bug
          Components: Web Console
            Reporter: Valentin Valchev


When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.

Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.

So there are few possibilities:
1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
{code}
interface ResourceBundleManager {
 public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
}
{code}
3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.

So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-2206) Localization causes a problem in Configuration Printers

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed FELIX-2206.
-----------------------------------


> Localization causes a problem in Configuration Printers
> -------------------------------------------------------
>
>                 Key: FELIX-2206
>                 URL: https://issues.apache.org/jira/browse/FELIX-2206
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>            Assignee: Felix Meschberger
>             Fix For: webconsole-3.0.0
>
>         Attachments: FELIX-2206-fmeschbe.patch, services_config_printer.patch
>
>
> When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.
> Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.
> So there are few possibilities:
> 1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
> 2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
> interface ResourceBundleManager {
>  public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
> }
> 3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
> 4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.
> So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-2206) Localization causes a problem in Configuration Printers

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated FELIX-2206:
-------------------------------------

    Fix Version/s: webconsole-3.0.0

I think we need a fix for this issue for the release

> Localization causes a problem in Configuration Printers
> -------------------------------------------------------
>
>                 Key: FELIX-2206
>                 URL: https://issues.apache.org/jira/browse/FELIX-2206
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.0
>
>         Attachments: FELIX-2206-fmeschbe.patch, services_config_printer.patch
>
>
> When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.
> Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.
> So there are few possibilities:
> 1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
> 2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
> interface ResourceBundleManager {
>  public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
> }
> 3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
> 4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.
> So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Updated: (FELIX-2206) Localization causes a problem in Configuration Printers

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 16.03.2010 17:14, Valentin Valchev (JIRA) wrote:
> Valentin Valchev updated FELIX-2206:
> ------------------------------------
> So there are few possibilities:
> 1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.

See below.

> 2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
> interface ResourceBundleManager {
>  public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
> }

I am not so sure, whether we should make this API public. Even though
once in a while I thought it would be useful to have the
ResourceBundleManager available, I always found a way to not need it...

> 3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.

This was an approach I chose in one of my prototype plugins. But I fear,
there a number of plugins out in the wild, which will not want to do
that (or cannot)...

> 4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.

This would be an option, too. Again, this may collide with plugins
existing in the wild.

I fear the cause of this problem is that we defined both the
AbstractWebConsolePlugin and the ConfigurationPrinter to have a
getTitle() method.

For the AbstractWebConsolePlugin, the problem is solved by the
OsgiManager. For the ConfigurationPrinter, the problem would have to be
solved in the ConfigurationRender.

In a sense the ConfigurationRender and the OsgiManager are comparable:
Both manage a collection of plugins and control there execution. So,
maybe your option 1. (adding the ResourceBundleManager to the
ConfigurationRender) is not wrong.

We could make the ConfigurationRender plugin a special plugin, which is
instantiated in a special way be the OsgiManager by explicitly calling
the constructor taking the ResourceBundleManager. This allows for the
ConfigurationRender class to localize its plugins (the
ConfigurationPrinter services); if only to localize them to English.

WDYT ?

Regards
Felix

[jira] Updated: (FELIX-2206) Localization causes a problem in Configuration Printers

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Valentin Valchev updated FELIX-2206:
------------------------------------

    Description: 
When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.

Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.

So there are few possibilities:
1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
interface ResourceBundleManager {
 public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
}


3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.

So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.

  was:
When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.

Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.

So there are few possibilities:
1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
{code}
interface ResourceBundleManager {
 public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
}
{code}
3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.

So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.


> Localization causes a problem in Configuration Printers
> -------------------------------------------------------
>
>                 Key: FELIX-2206
>                 URL: https://issues.apache.org/jira/browse/FELIX-2206
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>
> When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.
> Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.
> So there are few possibilities:
> 1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
> 2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
> interface ResourceBundleManager {
>  public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
> }
> 3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
> 4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.
> So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-2206) Localization causes a problem in Configuration Printers

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated FELIX-2206:
-------------------------------------

    Attachment: FELIX-2206-fmeschbe.patch

Here is a patch implementing the idea sketched on the dev list: The ConfigurationRender is now a special plugin known to the OsgiManager. It is created with the ResourceBundleManager such that the english (only english as discussed earlier) ConfigurationPrinter service titles can be generated.

This leaves plugin developers the freedom to merge ConfigurationPrinter and Web Console Plugin implementations and to not require reverting to static methods etc.

WDYT ?

> Localization causes a problem in Configuration Printers
> -------------------------------------------------------
>
>                 Key: FELIX-2206
>                 URL: https://issues.apache.org/jira/browse/FELIX-2206
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.0
>
>         Attachments: FELIX-2206-fmeschbe.patch, services_config_printer.patch
>
>
> When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.
> Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.
> So there are few possibilities:
> 1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
> 2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
> interface ResourceBundleManager {
>  public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
> }
> 3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
> 4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.
> So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-2206) Localization causes a problem in Configuration Printers

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Valentin Valchev updated FELIX-2206:
------------------------------------

    Attachment: services_config_printer.patch

The provided patch "services_config_printer.patch" refactors the ServicesServlet and extracts the printer code in a separate class. Both - printer & servlet share a lot of code, using static methods.

The patch also fixes some spelling issues, javadoc and dead-code in OsgiManager. Some methods visibility is also changes, since eclipse reported, that they were accessed through synthetic accessor methods/

> Localization causes a problem in Configuration Printers
> -------------------------------------------------------
>
>                 Key: FELIX-2206
>                 URL: https://issues.apache.org/jira/browse/FELIX-2206
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>         Attachments: services_config_printer.patch
>
>
> When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.
> Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.
> So there are few possibilities:
> 1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
> 2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
> interface ResourceBundleManager {
>  public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
> }
> 3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
> 4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.
> So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2206) Localization causes a problem in Configuration Printers

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12847383#action_12847383 ] 

Valentin Valchev commented on FELIX-2206:
-----------------------------------------

Well, your patch works for both - bundles & services printer. Mine - for service only, and will require many more changes to make it work for bundles. 

So I guess a complete solution is better  than partial and yes - this is important issue, that must be fixed before webconsole 3.0.0 is released.


> Localization causes a problem in Configuration Printers
> -------------------------------------------------------
>
>                 Key: FELIX-2206
>                 URL: https://issues.apache.org/jira/browse/FELIX-2206
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.0
>
>         Attachments: FELIX-2206-fmeschbe.patch, services_config_printer.patch
>
>
> When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.
> Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.
> So there are few possibilities:
> 1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
> 2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
> interface ResourceBundleManager {
>  public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
> }
> 3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
> 4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.
> So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-2206) Localization causes a problem in Configuration Printers

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-2206.
--------------------------------------

    Resolution: Fixed
      Assignee: Felix Meschberger

Thanks for the feedback.

So I took the liberty and committed the patch in Rev. 925234.

> Localization causes a problem in Configuration Printers
> -------------------------------------------------------
>
>                 Key: FELIX-2206
>                 URL: https://issues.apache.org/jira/browse/FELIX-2206
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>            Assignee: Felix Meschberger
>             Fix For: webconsole-3.0.0
>
>         Attachments: FELIX-2206-fmeschbe.patch, services_config_printer.patch
>
>
> When Configuration Status is opened, the Bundles and Services tabs are rendered respectively as 'bundles.pluginTitle' and 'services.pluginTitle'.
> Unfortunately, the  ConfigurationRender cannot access the ResourceBundleManager which is required to translate the titles.
> So there are few possibilities:
> 1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a method, to *set* the resourceBundleManager.
> 2. Make resource bundle manager accessible to all plugins as a request parameter. This will also require to make the ResourceBundleManager class public... or define the following interface in the public API:
> interface ResourceBundleManager {
>  public ResourceBundle getResourceBundle( final Bundle provider, final Locale locale )
> }
> 3. Refactor the Bundles & Services plugins, and change the title to respectively %Bundles and %Services. This is another dirty hack but the titles will be shown correctly.
> 4. Refactor the Bundles & Services plugins and extract the configuration printer code in a separate class. In this case no localization will be supported for these printers - just like other ones. I want to remind again, that we choose that no localization is required for Configuration Status as the provided information is more for diagnostics and is better to remain not-localized.
> So what do you think. Which variant is better? I personally vote for 4. We can make some method static and package private, so they can be reused by both - plugins & printers can reduce the duplicate code to minimum.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.