History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: JBSEAM-2515
Type: Feature Request Feature Request
Status: Closed Closed
Resolution: Done
Priority: Major Major
Assignee: Pete Muir
Reporter: Pete Muir
Votes: 2
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Seam

Abstraction of FacesMessages

Created: 21/Jan/08 10:04 AM   Updated: 13/May/08 09:21 AM
Component/s: JSF Integration
Affects Version/s: 2.0.1.CR1
Fix Version/s: 2.1.0.BETA1

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Dependency
 
This issue is a dependency of:
PBR-1 Seam Exception Handling Major Open
Related
This issue related:
JBSEAM-2989 Log Seam FacesMessages with a filtera... Major Open
JBSEAM-2990 Implementation of StatusMessages for ... Major Closed
 


 Description  « Hide
Needed for support other view layers

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order:
Pete Muir [21/Jan/08 01:16 PM]
Some sort of transport from messages from the application layer to the view layer.

Przemyslaw Jaskierski [02/Apr/08 11:33 AM]
Pete,

Because looks like you're focusing on this class now, may I suggest something? In general, Seam is over verbose in showing default messages to the end user. I mean similarities of "Transaction failed", despite the fact that I actually show perfectly precise and meaningful message to user. Most of these default messages has no real sense and should be rather logged at debug level to the log file. But we are forced to shown these messages if only we put h:message on the page :(. Overriding default messages in resources solves nothing here...

Currently I'm dealing with it by overriding Seam's FacesMessages bean with higher precedence and dropping all Seam internal messages to file. Only messages added by my method addPublicMessage() are actually shown to end user.
This realization is clumsy but it allows me to get rid of this unfortunate Seam's default behavior.

Can I suggest following?

1. Either allow to disable default Seam-internals-originated messages (and simply allow them to be logged). Provide a mean to ensure that only messages explicitly produced by developer are shown to user.

or

2. Cross-redirect message preserving in FacesMessages is cool but these methods are private, make addToTasks*() and getTasks*() overrideable, and keep FacesMessages easy overrideable in general.

TIA

Regards,
Przemek.




Pete Muir [02/Apr/08 11:41 AM]
Przemyslaw, why does overriding the default messages in messages.properties not work?

How about

(3) Add priorities like SEAM_INFO. Then you could filter these messages out in your custom FacesMessages class. Seam would translate these to INFO at the view layer. Or some other flag you can access (to avoid overloading the meaning of priority).

Przemyslaw Jaskierski [02/Apr/08 01:35 PM]
Pete, I guess overriding works (never used it though). Problem is that it is limited to showing generic messages only which were meant for i.e. log-in event or failed transaction. Generic "failed transaction"-like message has no real value/meaning for end user. And there is no strict control on what is shown to user (all these illegal navigation etc he has no clue about).

Your (3) solution is great and very flexible. Another approach to priorities (in contrary to the JSF model) would be to be consistent to Seam components precedence model, all default Seam messages could have SEAM_BUILT_IN priority (with this as a default value, to make it quick to use). Priorities will allow to have an ability to silence all Seam messages in production but keep them for development/prototyping. Let developer decide what he wants to show.

Pete Muir [02/Apr/08 01:59 PM]
With (3) we could of course provide a simple boolean switch that would cater for the common use case of not wanting these messages displayed.

Pete Muir [13/May/08 09:21 AM]
Done, with a default transport for JSF that emulates current facesMessages behaviour