-
1. Re: How to change standard messaging
nickarls Sep 24, 2008 3:06 PM (in response to cash1981)message.properties
-
2. Re: How to change standard messaging
cash1981 Sep 24, 2008 3:09 PM (in response to cash1981)The problem is that message.properties does not have that today. So could you then please inform me what persist,update and remove has for property name so I can override it?
Shervin
-
3. Re: How to change standard messaging
nickarls Sep 25, 2008 12:05 PM (in response to cash1981)Are you using entity home objects? If so, I think the reference manual mentions a couple of ways of doing this.
-
4. Re: How to change standard messaging
cash1981 Sep 25, 2008 1:47 PM (in response to cash1981)Yes thank you I found it.
It suggested doing this on the EntityHome classes.
protected String getCreatedMessage() { return "New person #{person.firstName} #{person.lastName} created"; } protected String getUpdatedMessage() { return "Person #{person.firstName} #{person.lastName} updated"; } protected String getDeletedMessage() { return "Person #{person.firstName} #{person.lastName} deleted"; }
I was though kinda hoping I could override the default message some how so that I didn't have to og on all EntityHome classes and override it there.
Any suggestions?
-
5. Re: How to change standard messaging
daniura Sep 25, 2008 1:55 PM (in response to cash1981)Hello,
Unfortunatly org.jboss.seam.framework.Home class has hardcoded those messages, but you can write some derived class from EntityHome and override methods for messages to use resources.
BestRegards
Daniel -
6. Re: How to change standard messaging
daniura Sep 25, 2008 2:10 PM (in response to cash1981)Some update,
I was wrong.
There is feature to addcreated
,deleted
andupdated
messages strings to resource bundle file.
Names of the properies looks like:
(your entity class name)updated
(your entity class name)deleted
(your entity class name)created
For example:
you have entity class org.package.Person and the message properties for that class are:
Personupdated
Personcreated
Persondeleted -
7. Re: How to change standard messaging
cash1981 Sep 25, 2008 2:16 PM (in response to cash1981)I see. So I still would have to override each entity?
Then its the same problem but of course better to have internalization. -
8. Re: How to change standard messaging
daniura Sep 25, 2008 2:23 PM (in response to cash1981)Corrected formatting :
(your entity class name)_updated
(your entity class name)_deleted
(your entity class name)_createdFor example: you have entity class org.package.Person and the message properties for that class are
Person_updated
Person_created
Person_deletedit is relevant for Seam 2.0.2.SP1
-
9. Re: How to change standard messaging
cash1981 Sep 25, 2008 2:28 PM (in response to cash1981)Just tested this and it works like a charm.
-
10. Re: How to change standard messaging
valatharv Oct 3, 2008 9:45 PM (in response to cash1981)Hi Daniel/Shervin,
Please let me know where I can change, I have an entity say Region....
How do I change to region Created instead of
Successfully created
message, can I reference it in my regionHome. -
11. Re: How to change standard messaging
andygibson.contact.andygibson.net Oct 3, 2008 10:17 PM (in response to cash1981)You can also set the createdMessage property of the home bean. This can be done either in the constructor of the home bean.
public RegionHome() { setCreatedMessage("Successfully Created Region"); }
or if you are using components.xml for specifying components, within the definition for region home you can use :
<property name="createdMessage">Successfully Created Region</property>
Cheers,
Andy Gibson
-
12. Re: How to change standard messaging
condesales Jan 7, 2009 7:47 PM (in response to cash1981)
Andy Gibson wrote on Oct 03, 2008 22:17:
You can also set the createdMessage property of the home bean. This can be done either in the constructor of the home bean.public RegionHome() { setCreatedMessage("Successfully Created Region"); }
or if you are using components.xml for specifying components, within the definition for region home you can use :<property name="createdMessage">Successfully Created Region</property>
Cheers,
Andy Gibson
at this first case, just have to remember that the argument is not a String, but an Value Expression.
so have to do like thispublic RegionHome() { setCreatedMessage(createValueExpression("Successfully Created Region")); }
it works for me.
;)Click HELP for text formatting instructions. Then edit this text and check the preview.
-
13. Re: How to change standard messaging
condesales Jan 7, 2009 7:49 PM (in response to cash1981)
Andy Gibson wrote on Oct 03, 2008 22:17:
You can also set the createdMessage property of the home bean. This can be done either in the constructor of the home bean.public RegionHome() { setCreatedMessage("Successfully Created Region"); }
or if you are using components.xml for specifying components, within the definition for region home you can use :<property name="createdMessage">Successfully Created Region</property>
Cheers,
Andy Gibsonat this first case, just have to remember that the argument is not a String, but an Value Expression.
so have to do like this
public RegionHome() { setCreatedMessage(createValueExpression("Successfully Created Region")); }
it works for me.
;)