More in this section

Forums / Developing with Sitefinity / How to fire a event while Creating/Editing/Deleting a Document

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

3 posts, 0 answered
  1. gopalraman gopal
    gopalraman gopal avatar
    52 posts
    03 Dec 2009
    26 Sep 2013
    Link to this post

    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?
  2. Craig
    Craig avatar
    82 posts
    07 Apr 2009
    27 Sep 2013
    Link to this post
    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... 

    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.

  3. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    31 May 2017
    02 Oct 2013
    Link to this post

    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:

    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.

    Stefani Tacheva
    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
3 posts, 0 answered