DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5621>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5621 [PATCH] Refactoring and correction of error notification Summary: [PATCH] Refactoring and correction of error notification Product: Cocoon 2 Version: 2.1alpha CVS Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: core AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Attatched is a patch to Cocoon HEAD for the correction of the error notification stuff. This patch contains code and suggestions from Peter Royal whom I thank for the valuable and kind cooperation. What has been done: 1- Changed the names of the classes to be more clear; for example Notificable becomes Notifying (that notifies), Notification becomes SimpleNotifyingBean and ErrorNotifier becomes NotifyingGenerator. 2- Refactored the error notification classes to fit under components.notification and separated the code that builds a Notifying object from the SimpleNotifyingBean for max flexibility: (Default)NotifyingBuilder, that is also an Avalon component. In this way you can filter your errors without touching the Notification DTD or creating custom Generators. 3- Added to the objectModel (in sitemap.xsl) from the beginning of processing a NotifyingObjects object that can contain any Notifying object that any component in the sitemap wants to add to it. In this way warnings (from Xalan or Xerces 4 example) can be appended to this and reported at the end with a notifications-view. 4- Deprecated special method in AbstractEventPipeline for ErrorNotifier; now the Notification is gotten from the objectmodel. 5- As a direct consequence of point 3 now Actions put in the handle-errors sitemap can get the NotifyingObjects and act on those; many times requested for error reporting to admins. 6- Changed error notification in protected to use root sitemap handle-errors, added context:// to root sitemap handle-errors stylesheet url to make it usable for subsitemaps and deleted the "in no time" statement in the notification stylesheet as decided on the dev list. 7- Last, but not least, any Exception that is alse Notifying gets notified using Notifying methods by the DefaultNotifyingBuilder. The DTD of the notification is the same and Notifying is almost identical to Notificable (a HashMap became a Map). Old classes and methods have been deprecated. The points that need to be defined in the future are: I - should Constants.NOTIFYING_OBJECTS be put in the objectmodel and created there instead of in the sitemap? II - How come the handle-error pipeline works only after some time/invocations? The logs say that: DEBUG (2001-12-27) 14:57.21:537 [core ] (/cocoon/generror) HttpProcessor[8080][3]/ExcaliburComponentManager: Could not find component for role: org.apache.cocoon.generation.GeneratorSelector ERROR (2001-12-27) 14:57.21:537 [core ] (/cocoon/generror) HttpProcessor[8080][3]/sitemap_xmap: NotifyingGenerator was not able to notify the exception. org.apache.avalon.framework.component.ComponentException: Could not find component at org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup(Excal iburComponentManager.java:318) at org.apache.cocoon.components.pipeline.AbstractEventPipeline.setGenerator(Abs tractEventPipeline.java:97) at org.apache.cocoon.components.pipeline.CachingEventPipeline.setGenerator(Cach ingEventPipeline.java:75) at org.apache.cocoon.www.sitemap_xmap.error_process_9_500(sitemap_xmap.java:932 9) at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:3285) After some invocations/time it cutely says: DEBUG (2001-12-27) 14:58.14:973 [core ] (/cocoon/generror) HttpProcessor[8080][4]/ExcaliburComponentManager: Could not find component for role: org.apache.cocoon.generation.GeneratorSelector DEBUG (2001-12-27) 14:58.14:973 [core ] (/cocoon/generror) HttpProcessor[8080][4]/ExcaliburComponentManager: The Role Manager has not been set! DEBUG (2001-12-27) 14:58.14:973 [core ] (/cocoon/generror) HttpProcessor[8080][4]/AbstractEventPipeline: New GS org.apache.cocoon.sitemap.SitemapComponentSelector@24c22b DEBUG (2001-12-27) 14:58.14:973 [core ] (/cocoon/generror) HttpProcessor[8080][4]/ExcaliburComponentManager: The Role Manager has not been set! DEBUG (2001-12-27) 14:58.14:973 [core ] (/cocoon/generror) HttpProcessor[8080][4]/LogKitLogger: Retrieving a org.apache.cocoon.sitemap.NotifyingGenerator from the pool DEBUG (2001-12-27) 14:58.14:973 [core ] (/cocoon/generror) HttpProcessor[8080][4]/AbstractEventPipeline: !NG!org.apache.cocoon.sitemap.NotifyingGenerator@392fe8 Then all works perfectly. Does this have something to do with the Recomposable stuff? Suggestions? III- I would prefer to add the special NotifyingGenerator (ex-ErrorNotifier) to the sitemap in sitemap.roles instead of doing it in code in the sitemap. I've put tentative code in it (now commented) that doesn't work. Does this have something to do with the Recomposable stuff? Suggestions? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]