[seam-issues] [JBoss JIRA] Commented: (JBSEAM-4313) EntityHome created/updated/deleted default messages should come from resource bundle instead of hard-coded messages
Alberto Fernández (JIRA)
jira-events at lists.jboss.org
Mon May 2 12:29:18 EDT 2011
[ https://issues.jboss.org/browse/JBSEAM-4313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12599449#comment-12599449 ]
Alberto Fernández commented on JBSEAM-4313:
-------------------------------------------
it would be easy to implement.
The code as follow and include the three keys (successfully.created, successfully.updated and successfully.deleted) in the resources file:
protected void initDefaultMessages()
{
Expressions expressions = new Expressions();
if (createdMessage == null) { createdMessage = expressions.createValueExpression(StatusMessage.getBundleMessage("successfully.created", "Successfully created")); }
if (updatedMessage == null) { updatedMessage = expressions.createValueExpression(StatusMessage.getBundleMessage("successfully.updated", "Successfully updated")); }
if (deletedMessage == null) { deletedMessage = expressions.createValueExpression(StatusMessage.getBundleMessage("successfully.deleted", "Successfully deleted")); }
}
> EntityHome created/updated/deleted default messages should come from resource bundle instead of hard-coded messages
> -------------------------------------------------------------------------------------------------------------------
>
> Key: JBSEAM-4313
> URL: https://issues.jboss.org/browse/JBSEAM-4313
> Project: Seam 2
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 2.1.2.GA
> Reporter: Julien Kronegg
> Priority: Minor
>
> The EntityHome default messages on creation/update/deletion are hard-coded in the org.jboss.seam.framework.Home class:
> protected void initDefaultMessages()
> {
> Expressions expressions = new Expressions();
> if (createdMessage == null) {
> createdMessage = expressions.createValueExpression("Successfully created");
> }
> if (updatedMessage == null) {
> updatedMessage = expressions.createValueExpression("Successfully updated");
> }
> if (deletedMessage == null) {
> deletedMessage = expressions.createValueExpression("Successfully deleted");
> }
> }
> While the messages can be updated in the "messages_en.properties" (using "MyEntityClass_created" key for example), this must be done for each entity class. This is painful!
> It would be nice if we get the following messages decreasing priority for the entity class MyEntityClass:
> 1. "MyEntityClass_created"
> 2. "org.jboss.seam.framework.Home_defaultCreated"
> 3. static message "Successfully created"
> Note: the example above is given for the creation message only
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list