On 11/11/2010 01:16 AM, Thomas Mortagne wrote:
On Wed, Nov 10, 2010 at 20:45, Sergiu Dumitriu<[email protected]> wrote:
On 11/10/2010 07:29 PM, Marius Dumitru Florea wrote:
What about creating an EventLogger component with implementations for each of the events that need to be logged by the activity stream? When an event is triggered you lookup the corresponding EventLogger. If there is no EventLogger for the specific hint then ignore the event.
The problem is that you have to write extra code to store the extra events. It's just moving the current if-else to a different level. It is more easily extensible, but I don't agree that any new component sending events has to have a dependency on the activity stream plugin to also be able to store those events in the stream.
I don't agree with the activity stream dependency. It's not about activity stream, it's a handler that extract important event informations in a serializable object. This system is then used by activity stream and remote observation manager to store or send events.
Code speaks better than people. Here's a proposed first patch: http://jira.xwiki.org/jira/browse/XPAS-29
Hope this helps, Marius
On 11/10/2010 10:08 AM, Stefan abageru wrote:
Hi devs !
I thought about adding some changes in Events and Activity Stream.
First of all, I want to remove all the listeners from Activity Stream and make this class listen to AllEvent, making it capable of cathcing all events that occur in the wiki (and this way, when adding a new event, you wouldn't need any modifications to this class in order to catch it).
Secondly, I would like to modify onEvent function in the class so that it uses the simpleClassName of the event occurred in order to log the event (the eventType would be this simpleClassName...for example DocumentSavedEvent, AnnotationAddedEvent and so on).
And thirdly i thought about adding one field in AbstractFilterableEvent called /identifier/ and make all events extend directly this class. And that /identifier/ would be used in a different way by the events themselves. But it would be used to retrieve infos about that events. And so, when logging an event, we could use classname + identifier. For example AnnotationAddedEvent + "This is my annotation" . CommentAddedEvent + "This is my comment" or the number of the comment.
-- Sergiu Dumitriu http://purl.org/net/sergiu/