You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Andy Blower (JIRA)" <ji...@apache.org> on 2008/10/07 11:57:45 UTC

[jira] Created: (TAP5-253) Default validation messages only overridable individually

Default validation messages only overridable individually
---------------------------------------------------------

                 Key: TAP5-253
                 URL: https://issues.apache.org/jira/browse/TAP5-253
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.0.15
            Reporter: Andy Blower
            Priority: Minor


I'm trying to set up validation for our forms and I need to customise the default validation messages. Unfortunately there doesn't seem to be a way to do this as contributing to ValidationMessagesSource just adds new messages for new validators. I need to change the default messages to what we need.

I know that we can override the message for each field name in the message catalogs, but this is undesirable (& expensive with extra translations needed) because they'll all be the same. The only solution I've found is to override this with a properties file in the tapestry5.internal package but this doesn't work in every environment so it's not really a good solution.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Assigned: (TAP5-253) Default validation messages only overridable individually

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAP5-253:
-----------------------------------------

    Assignee: Howard M. Lewis Ship

> Default validation messages only overridable individually
> ---------------------------------------------------------
>
>                 Key: TAP5-253
>                 URL: https://issues.apache.org/jira/browse/TAP5-253
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.15
>            Reporter: Andy Blower
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>
> I'm trying to set up validation for our forms and I need to customise the default validation messages. Unfortunately there doesn't seem to be a way to do this as contributing to ValidationMessagesSource just adds new messages for new validators. I need to change the default messages to what we need.
> I know that we can override the message for each field name in the message catalogs, but this is undesirable (& expensive with extra translations needed) because they'll all be the same. The only solution I've found is to override this with a properties file in the tapestry5.internal package but this doesn't work in every environment so it's not really a good solution.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAP5-253) Unable to effectively override default validation messages globally

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-253:
--------------------------------------

    Description: 
I'm trying to set up validation for our forms and I need to customize the default validation messages. Unfortunately there doesn't seem to be a way to do this as contributing to ValidationMessagesSource just adds new messages for new validators. I need to change the default messages to what we need.

I know that we can override the message for each field name in the message catalogs, but this is undesirable (& expensive with extra translations needed) because they'll all be the same. The only solution I've found is to override this with a properties file in the tapestry5.internal package but this doesn't work in every environment so it's not really a good solution.


  was:
I'm trying to set up validation for our forms and I need to customise the default validation messages. Unfortunately there doesn't seem to be a way to do this as contributing to ValidationMessagesSource just adds new messages for new validators. I need to change the default messages to what we need.

I know that we can override the message for each field name in the message catalogs, but this is undesirable (& expensive with extra translations needed) because they'll all be the same. The only solution I've found is to override this with a properties file in the tapestry5.internal package but this doesn't work in every environment so it's not really a good solution.


        Summary: Unable to effectively override default validation messages globally  (was: Default validation messages only overridable individually)

My original thought with ValidationMessagesSource was that a new 3rd party validator or translator that wanted to provide its own set of default validation messages would contribute its own bundle.  Order wasn't important (thus Collection, not List) since there would not be any naming conflicts; it would be entirely new keys.

However, I now understand the desire to override built-in messages using a secondary bundle.

I think this can be taken care of, it will affect the contributions, since it will now be an OrderedConfiguration.

> Unable to effectively override default validation messages globally
> -------------------------------------------------------------------
>
>                 Key: TAP5-253
>                 URL: https://issues.apache.org/jira/browse/TAP5-253
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.15
>            Reporter: Andy Blower
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>
> I'm trying to set up validation for our forms and I need to customize the default validation messages. Unfortunately there doesn't seem to be a way to do this as contributing to ValidationMessagesSource just adds new messages for new validators. I need to change the default messages to what we need.
> I know that we can override the message for each field name in the message catalogs, but this is undesirable (& expensive with extra translations needed) because they'll all be the same. The only solution I've found is to override this with a properties file in the tapestry5.internal package but this doesn't work in every environment so it's not really a good solution.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Closed: (TAP5-253) Unable to effectively override default validation messages globally

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-253.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0.16

> Unable to effectively override default validation messages globally
> -------------------------------------------------------------------
>
>                 Key: TAP5-253
>                 URL: https://issues.apache.org/jira/browse/TAP5-253
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.15
>            Reporter: Andy Blower
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>             Fix For: 5.0.16
>
>
> I'm trying to set up validation for our forms and I need to customize the default validation messages. Unfortunately there doesn't seem to be a way to do this as contributing to ValidationMessagesSource just adds new messages for new validators. I need to change the default messages to what we need.
> I know that we can override the message for each field name in the message catalogs, but this is undesirable (& expensive with extra translations needed) because they'll all be the same. The only solution I've found is to override this with a properties file in the tapestry5.internal package but this doesn't work in every environment so it's not really a good solution.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAP5-253) Default validation messages only overridable individually

Posted by "Thiago H. de Paula Figueiredo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643519#action_12643519 ] 

Thiago H. de Paula Figueiredo commented on TAP5-253:
----------------------------------------------------

The ValidationMessagesSource contribution does not work even when you add a properties file for a locale that Tapestry does not have default messages yet. 

I've added this method to my AppModule.
 
public static void contributeValidationMessagesSource(Configuration<String> configuration) {
	configuration.add("classpath:/ValidationMessages");
}
 
After a lot of digging and debugging in the tapestry-core sources, I've found that in the ValidationMessagesSourceImpl.ValidationMessagesSourceImpl(Collection<String> bundles, Resource classpathRoot, URLChangeTracker tracker), that my ValidationMessages.properties is used as the parent bundle to the default Tapestry validation properties file. It should be exactly the other way. My validation messages do not override the defaults.
 
Shouldn't the ValidationMessagesSource service receive an OrderedConfiguration intead of a Configuration? The ordering of the contributions seems to be an issue here.

> Default validation messages only overridable individually
> ---------------------------------------------------------
>
>                 Key: TAP5-253
>                 URL: https://issues.apache.org/jira/browse/TAP5-253
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.15
>            Reporter: Andy Blower
>            Priority: Minor
>
> I'm trying to set up validation for our forms and I need to customise the default validation messages. Unfortunately there doesn't seem to be a way to do this as contributing to ValidationMessagesSource just adds new messages for new validators. I need to change the default messages to what we need.
> I know that we can override the message for each field name in the message catalogs, but this is undesirable (& expensive with extra translations needed) because they'll all be the same. The only solution I've found is to override this with a properties file in the tapestry5.internal package but this doesn't work in every environment so it's not really a good solution.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org