How to fire a event while Creating/Editing/Deleting a Document
Hi,
I need to do some business logic when document has been uploaded,edited and deleted using sitefinity document library. Is there any way we can achive this through custom logic?
I don't think this is possible. If you check the Telerik.Sitefinity.Modules.Libraries.Web.Events namespace you will see that there are only three supported events.
Hello,
We have recently documented the Event System in Sitefinity. Unfortunately, we still haven't implemented such events which fire when a document is uploaded, deleted or edited. We have ones firing when a document is downloaded. You can ready about them here:
Libraries Events
As for the upload/delete/edit you will need to implement this using a lifecycle decorator. You can plug your code right after each document is published/edited/deleted.
Stanislav has described how to implement such a decorator for dynamic modules in this Forum thread:
http://www.sitefinity.com/devnet/forums/developing-with-sitefinity-/handling-an-adding-new-item-event-in-dynamic-module
The code for the Documents module should be the same. Just substitute the Type of the manager (instead of DynamicModuleManager use LibrariesManager) and also call the Libraries API instead of the Dynamic Modules one.
Regards,
Stefani Tacheva
Telerik