How to fire a event while Creating/Editing/Deleting a Docume

Posted by Community Admin on 04-Aug-2018 09:34

How to fire a event while Creating/Editing/Deleting a Document

All Replies

Posted by Community Admin on 26-Sep-2013 00:00

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?

Posted by Community Admin on 27-Sep-2013 00:00

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.

  • Media Content Downloaded Event
  • Media Content Download Event
  • Media Content Downloading Event
You can find all of the possible events by going to the link below...

www.sitefinity.com/.../list-of-events 

Or, you can open the Telerik.Sitefinity assembly with JustDecompile and search for all classes that implement the IEvent interface.  No luck finding anything here either.

Craig

Posted by Community Admin on 02-Oct-2013 00:00

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

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed