You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Thomas Herzog (JIRA)" <ji...@apache.org> on 2012/07/07 21:02:33 UTC

[jira] [Created] (DELTASPIKE-228) Make @MessageBundle annotated type available via EL

Thomas Herzog created DELTASPIKE-228:
----------------------------------------

             Summary: Make @MessageBundle annotated type available via EL 
                 Key: DELTASPIKE-228
                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-228
             Project: DeltaSpike
          Issue Type: New Feature
          Components: I18n-Module
    Affects Versions: 0.2-incubating
            Reporter: Thomas Herzog
             Fix For: 0.4-incubating


After you defined an MessageBundle type, you wanna use it in the views as well without wrapping the type into a @Named annotated cdi bean to be available to use it via EL.
It would be fine if the implementation would be created and registrered as an cdi bean at deployment time and therefore available via EL in the views.
I think the main usage for the messages is in the views, at least in our usacases.

Therefore it would also nice to define the name of the created cdi bean via maybe @MessageContextConfig annotation and default should be the name of the type, but the name of the type could be same, just placed in different packages.

If this will be done the developer only has to define his MessageBundle type with the getter for the messages and configuration via annotation if necessary, and use it in the views right away.

Regarding to issue DELTASPIKE-223 it would be necessary to think about follwing possible issues.
If there would be multiple choices for the convention of the getter methods for the messages defined in the MessageBundle type, there could occur follwing problems.
1. String welcomeTo(); // Key: welcome_to
2. String getWelcomeTo();  // Key: welcome_to with get prefix
3  String getWelcomeTo();  // Key: get_welcome_to

@1
How will EL resolve the method if called via #{type.welcomeTo} ?
As far as i know EL would try to invoke getWelcomeTo() method which could not be found in this case !!

@2 and 3
How will it be distiguished if get prefix is part of the key or just the start of the getter method? 



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DELTASPIKE-228) Make @MessageBundle annotated type available via EL

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DELTASPIKE-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408900#comment-13408900 ] 

Mark Struberg commented on DELTASPIKE-228:
------------------------------------------

right now we have the following logic. Allow me to take your examples and clarify what we do

1. String welcomeTo(); // Key: welcomeTo
2. String getWelcomeTo(); // Key: getWelcomeTo
3 String getWelcomeTo(); // Key: getWelcomeTo

We don't apply any special logic but just take the method name and use if for the resource lookup.

or the EL name: If you use EL-2.2 you can just type

#{type.welcomeTo()}

or even add parameters:

#{type.welcomeTo(location)}

EL-2.2 is perfectly fine with those and will invoke the welcomeTo methods.
                
> Make @MessageBundle annotated type available via EL 
> ----------------------------------------------------
>
>                 Key: DELTASPIKE-228
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-228
>             Project: DeltaSpike
>          Issue Type: New Feature
>          Components: I18n-Module, JSF-Module
>    Affects Versions: 0.2-incubating
>            Reporter: Thomas Herzog
>            Assignee: Mark Struberg
>             Fix For: 0.4-incubating
>
>
> After you defined an MessageBundle type, you wanna use it in the views as well without wrapping the type into a @Named annotated cdi bean to be available to use it via EL.
> It would be fine if the implementation would be created and registrered as an cdi bean at deployment time and therefore available via EL in the views.
> I think the main usage for the messages is in the views, at least in our usacases.
> Therefore it would also nice to define the name of the created cdi bean via maybe @MessageContextConfig annotation and default should be the name of the type, but the name of the type could be same, just placed in different packages.
> If this will be done the developer only has to define his MessageBundle type with the getter for the messages and configuration via annotation if necessary, and use it in the views right away.
> Regarding to issue DELTASPIKE-223 it would be necessary to think about follwing possible issues.
> If there would be multiple choices for the convention of the getter methods for the messages defined in the MessageBundle type, there could occur follwing problems.
> 1. String welcomeTo(); // Key: welcome_to
> 2. String getWelcomeTo();  // Key: welcome_to with get prefix
> 3  String getWelcomeTo();  // Key: get_welcome_to
> @1
> How will EL resolve the method if called via #{type.welcomeTo} ?
> As far as i know EL would try to invoke getWelcomeTo() method which could not be found in this case !!
> @2 and 3
> How will it be distiguished if get prefix is part of the key or just the start of the getter method? 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (DELTASPIKE-228) Make @MessageBundle annotated type available via EL

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

Mark Struberg reassigned DELTASPIKE-228:
----------------------------------------

    Assignee: Mark Struberg
    
> Make @MessageBundle annotated type available via EL 
> ----------------------------------------------------
>
>                 Key: DELTASPIKE-228
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-228
>             Project: DeltaSpike
>          Issue Type: New Feature
>          Components: I18n-Module, JSF-Module
>    Affects Versions: 0.2-incubating
>            Reporter: Thomas Herzog
>            Assignee: Mark Struberg
>             Fix For: 0.4-incubating
>
>
> After you defined an MessageBundle type, you wanna use it in the views as well without wrapping the type into a @Named annotated cdi bean to be available to use it via EL.
> It would be fine if the implementation would be created and registrered as an cdi bean at deployment time and therefore available via EL in the views.
> I think the main usage for the messages is in the views, at least in our usacases.
> Therefore it would also nice to define the name of the created cdi bean via maybe @MessageContextConfig annotation and default should be the name of the type, but the name of the type could be same, just placed in different packages.
> If this will be done the developer only has to define his MessageBundle type with the getter for the messages and configuration via annotation if necessary, and use it in the views right away.
> Regarding to issue DELTASPIKE-223 it would be necessary to think about follwing possible issues.
> If there would be multiple choices for the convention of the getter methods for the messages defined in the MessageBundle type, there could occur follwing problems.
> 1. String welcomeTo(); // Key: welcome_to
> 2. String getWelcomeTo();  // Key: welcome_to with get prefix
> 3  String getWelcomeTo();  // Key: get_welcome_to
> @1
> How will EL resolve the method if called via #{type.welcomeTo} ?
> As far as i know EL would try to invoke getWelcomeTo() method which could not be found in this case !!
> @2 and 3
> How will it be distiguished if get prefix is part of the key or just the start of the getter method? 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DELTASPIKE-228) Make @MessageBundle annotated type available via EL

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DELTASPIKE-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408883#comment-13408883 ] 

Mark Struberg commented on DELTASPIKE-228:
------------------------------------------

not even needed, it's much simpler, will hack it quickly.
                
> Make @MessageBundle annotated type available via EL 
> ----------------------------------------------------
>
>                 Key: DELTASPIKE-228
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-228
>             Project: DeltaSpike
>          Issue Type: New Feature
>          Components: I18n-Module, JSF-Module
>    Affects Versions: 0.2-incubating
>            Reporter: Thomas Herzog
>             Fix For: 0.4-incubating
>
>
> After you defined an MessageBundle type, you wanna use it in the views as well without wrapping the type into a @Named annotated cdi bean to be available to use it via EL.
> It would be fine if the implementation would be created and registrered as an cdi bean at deployment time and therefore available via EL in the views.
> I think the main usage for the messages is in the views, at least in our usacases.
> Therefore it would also nice to define the name of the created cdi bean via maybe @MessageContextConfig annotation and default should be the name of the type, but the name of the type could be same, just placed in different packages.
> If this will be done the developer only has to define his MessageBundle type with the getter for the messages and configuration via annotation if necessary, and use it in the views right away.
> Regarding to issue DELTASPIKE-223 it would be necessary to think about follwing possible issues.
> If there would be multiple choices for the convention of the getter methods for the messages defined in the MessageBundle type, there could occur follwing problems.
> 1. String welcomeTo(); // Key: welcome_to
> 2. String getWelcomeTo();  // Key: welcome_to with get prefix
> 3  String getWelcomeTo();  // Key: get_welcome_to
> @1
> How will EL resolve the method if called via #{type.welcomeTo} ?
> As far as i know EL would try to invoke getWelcomeTo() method which could not be found in this case !!
> @2 and 3
> How will it be distiguished if get prefix is part of the key or just the start of the getter method? 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DELTASPIKE-228) Make @MessageBundle annotated type available via EL

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

Gerhard Petracek updated DELTASPIKE-228:
----------------------------------------

    Component/s: JSF-Module
    
> Make @MessageBundle annotated type available via EL 
> ----------------------------------------------------
>
>                 Key: DELTASPIKE-228
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-228
>             Project: DeltaSpike
>          Issue Type: New Feature
>          Components: I18n-Module, JSF-Module
>    Affects Versions: 0.2-incubating
>            Reporter: Thomas Herzog
>             Fix For: 0.4-incubating
>
>
> After you defined an MessageBundle type, you wanna use it in the views as well without wrapping the type into a @Named annotated cdi bean to be available to use it via EL.
> It would be fine if the implementation would be created and registrered as an cdi bean at deployment time and therefore available via EL in the views.
> I think the main usage for the messages is in the views, at least in our usacases.
> Therefore it would also nice to define the name of the created cdi bean via maybe @MessageContextConfig annotation and default should be the name of the type, but the name of the type could be same, just placed in different packages.
> If this will be done the developer only has to define his MessageBundle type with the getter for the messages and configuration via annotation if necessary, and use it in the views right away.
> Regarding to issue DELTASPIKE-223 it would be necessary to think about follwing possible issues.
> If there would be multiple choices for the convention of the getter methods for the messages defined in the MessageBundle type, there could occur follwing problems.
> 1. String welcomeTo(); // Key: welcome_to
> 2. String getWelcomeTo();  // Key: welcome_to with get prefix
> 3  String getWelcomeTo();  // Key: get_welcome_to
> @1
> How will EL resolve the method if called via #{type.welcomeTo} ?
> As far as i know EL would try to invoke getWelcomeTo() method which could not be found in this case !!
> @2 and 3
> How will it be distiguished if get prefix is part of the key or just the start of the getter method? 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DELTASPIKE-228) Make @MessageBundle annotated type available via EL

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DELTASPIKE-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408906#comment-13408906 ] 

Mark Struberg commented on DELTASPIKE-228:
------------------------------------------

We can only do this in 0.4-incubating as we atm rely on having an InjectionPoint. See TypedMessageBundleProducer for the details. 

In the future we shall move away from the bean-delegation and generate own Beans for each @MessageBundle. We also need this to support @Jsf qualified beans in the future.

By creating 2 beans (one with @Default, the other one with @Jsf) we would allow to distinguish the default behaviour. Just a thought by now, we will for sure need to think a bit harder about the use cases.
                
> Make @MessageBundle annotated type available via EL 
> ----------------------------------------------------
>
>                 Key: DELTASPIKE-228
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-228
>             Project: DeltaSpike
>          Issue Type: New Feature
>          Components: I18n-Module, JSF-Module
>    Affects Versions: 0.2-incubating
>            Reporter: Thomas Herzog
>            Assignee: Mark Struberg
>             Fix For: 0.4-incubating
>
>
> After you defined an MessageBundle type, you wanna use it in the views as well without wrapping the type into a @Named annotated cdi bean to be available to use it via EL.
> It would be fine if the implementation would be created and registrered as an cdi bean at deployment time and therefore available via EL in the views.
> I think the main usage for the messages is in the views, at least in our usacases.
> Therefore it would also nice to define the name of the created cdi bean via maybe @MessageContextConfig annotation and default should be the name of the type, but the name of the type could be same, just placed in different packages.
> If this will be done the developer only has to define his MessageBundle type with the getter for the messages and configuration via annotation if necessary, and use it in the views right away.
> Regarding to issue DELTASPIKE-223 it would be necessary to think about follwing possible issues.
> If there would be multiple choices for the convention of the getter methods for the messages defined in the MessageBundle type, there could occur follwing problems.
> 1. String welcomeTo(); // Key: welcome_to
> 2. String getWelcomeTo();  // Key: welcome_to with get prefix
> 3  String getWelcomeTo();  // Key: get_welcome_to
> @1
> How will EL resolve the method if called via #{type.welcomeTo} ?
> As far as i know EL would try to invoke getWelcomeTo() method which could not be found in this case !!
> @2 and 3
> How will it be distiguished if get prefix is part of the key or just the start of the getter method? 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DELTASPIKE-228) Make @MessageBundle annotated type available via EL

Posted by "Gerhard Petracek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DELTASPIKE-228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408806#comment-13408806 ] 

Gerhard Petracek commented on DELTASPIKE-228:
---------------------------------------------

we could provide an optional el-resolver for it
                
> Make @MessageBundle annotated type available via EL 
> ----------------------------------------------------
>
>                 Key: DELTASPIKE-228
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-228
>             Project: DeltaSpike
>          Issue Type: New Feature
>          Components: I18n-Module
>    Affects Versions: 0.2-incubating
>            Reporter: Thomas Herzog
>             Fix For: 0.4-incubating
>
>
> After you defined an MessageBundle type, you wanna use it in the views as well without wrapping the type into a @Named annotated cdi bean to be available to use it via EL.
> It would be fine if the implementation would be created and registrered as an cdi bean at deployment time and therefore available via EL in the views.
> I think the main usage for the messages is in the views, at least in our usacases.
> Therefore it would also nice to define the name of the created cdi bean via maybe @MessageContextConfig annotation and default should be the name of the type, but the name of the type could be same, just placed in different packages.
> If this will be done the developer only has to define his MessageBundle type with the getter for the messages and configuration via annotation if necessary, and use it in the views right away.
> Regarding to issue DELTASPIKE-223 it would be necessary to think about follwing possible issues.
> If there would be multiple choices for the convention of the getter methods for the messages defined in the MessageBundle type, there could occur follwing problems.
> 1. String welcomeTo(); // Key: welcome_to
> 2. String getWelcomeTo();  // Key: welcome_to with get prefix
> 3  String getWelcomeTo();  // Key: get_welcome_to
> @1
> How will EL resolve the method if called via #{type.welcomeTo} ?
> As far as i know EL would try to invoke getWelcomeTo() method which could not be found in this case !!
> @2 and 3
> How will it be distiguished if get prefix is part of the key or just the start of the getter method? 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira