From: Evgeny G. <gaz...@gm...> - 2010-03-29 19:24:25
|
Hello! I want present the new triggers staff here. Current trunk has triggers for six events for document and collections Some of them (all collection's triggers) is not implemented. I had implemented all collection's triggers and adding new evens. So just we can have triggers fired for create, move, rename, remove collections and documents and update documents. Every trigger's interfaces (CollectionTrigger and DocumentTrigger) were divided for two interfaces CollectionTriggerUnary, CollectionTriggerBinary and DocumentTriggerUnary, DocumentTriggerBinary. The "unary" triggers are for create, update, events and equal old trigger's model. The "binary" triggers are for rename or move events. They have additional parameter for prepare() and finish() methods. This parameter is destination path of collection or document. So collection triggers were not implemented and it's methods not called, I'd remove one. DocumentTriggerUnary, DocumentTriggerBinary has DocumentTrigger as parent interface. Also DocumentTrigger still have old methods prepare() and finish(), which I'd deprecated. All events have a new names. but old can be used as well too. If user use own triggers compiled with old triggers, he can use them and wit new triggers interfaces too. User will be warned in a logs, when "binary" event will be fired for such trigger. In XQuery trigger I'd remove one external variable that was passed docImpl. Think we had loose performance here. Some external variables are have a new names. But old can be used too. See new trigger's documentation in webapp/trigger.xml. All triggers tests, fluent and versioning extensions were refactored for new event's names. All tests are worked as well. ToDo: test cases for collection's triggers and move/rename events. Roadmap: triggers for meta information (owner, group, permissions) changes. For this need a lot investigation into another kernel's modules. Like the "copy/paste" pattern was used there very often. Think need to refactor. --------- Evgeny |