More in this section

Forums / Developing with Sitefinity / EventsManager - ExecutedEventArgs

EventsManager - ExecutedEventArgs

5 posts, 0 answered
  1. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    22 Jun 2011
    Link to this post
    I'm writing some code to act when an event is created/updated and deleted.

    I've managed to hook the EventHandler up correctly but now face the following problem:

    I can only get CommandName values like "GetEvents", "GetItems", "GetLiveBase" from ExecutingEventArgs. Also...they're happening multiple times which makes it rough to run code once per update/create/delete. :)

     I'm looking for something that fires once...like "CreateEvent", "UpdateEvent" and such. I know they're somewhere, I've seen them referenced all over in the 3.x forums.

    Am I looking in the wrong place?

    NOTE: "RemoveItemUrls" was used simply for testing. I needed *something* to run my other code on.

    void EventsManager_Executing(object sender, ExecutingEventArgs e)
        {
             
            System.Diagnostics.Debug.WriteLine("COMMAND:" + e.CommandName.ToString());
     
            if (e.CommandName.Equals("RemoveItemUrls"))
            {

    Any help is appreciated!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    23 Jun 2011
    Link to this post
    Hi Tim,

    The command name is passed multiple time and it would be hard to identify the actual process you are looking for. One of the option that I see is adding your logic in the data provider class - Telerik.Sitefinity.Modules.Events.Data.OpenAccessEventProvider where you can override methods like GetEvents(), GetEvent(Guid id), CreateEvent(Guid id) etc.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    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. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    23 Jun 2011
    Link to this post
    Ivan,

    So, if I'm understanding correctly, the method below (from adding event handlers) doesn't work anymore? I can't imagine that such a straightforward approach would be deprecated.

    void ForumManager_Executing(object sender, Telerik.ExecutingEventArgs e)     
        {    
            if (e.CommandName == "CreatePost")   
            {    
                Telerik.Forums.IPost item = e.CommandArguments as Telerik.Forums.IPost;      
      
                // item.Content ...      
      
                // item.Title    
                // item.SomeThingElse    
            }    
        }    

    The suggestion involving the OpenAccessEventProvider doesn't seem like it would help based on the fact that the individual events are fired over and over again.

    How does the Twitter/Sitefinity notifier handle the task? It has functionality along the same lines that I'm looking to achieve.

    I appreciate your response,

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    23 Jun 2011
    Link to this post
    Hi Tim,

    The code you posted is form Sitefinity 3.x. Here the API  is different. The methods for creating and getting objects are fired once so you don't need to identify the command name or use command arguments.
    For Twitter we use Publishing system - pipes.A publishing pipe works with a publishing point in the following ways.Inbound=>Importing data from external source or sitefinity content into a Publishing Point by applying inbound data fields mapping and translationOutBound=>Reading data from a publishing point, applying outbound mapping , translation and converting it to external format as RSS or pushing it to tweeter , facebook etc.A pipe class implements the actual transformation algorithm,the transformation is configured using the PipeSettings class. Each pipe implements it's own PipeSettings inherting the base settings class.The pipe settings also relate the pipe with the particular publishing point where to import/export. Pipes are usually triggered based on system events or scheduled tasks, for example - upon the event of publishing a blog post , all content pipes related to the particular blog are triggered and import the post into the related publishing points.Outbound Pull pipes can be triggered upon request - for example an rss feed read request triggers the rss outbound pipe to read and transform data from the publsihing point.Outbound Push pipes are executing automatically upon the event of new item being imported into the publishing point

    Greetings,
    Ivan Dimitrov
    the Telerik team
    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
  5. Conrad Ehinger
    Conrad Ehinger avatar
    59 posts
    Registered:
    22 Sep 2009
    25 Jul 2011
    Link to this post
    Ivan,

    Thanks for your response about the publishing pipes. That functionality that happens with the twitter feed is the same functionality that I need to achieve. Upon the creation of an event, I need to run my own method.

    Do you have any documentation or sample code that you can provide?

    Thanks
5 posts, 0 answered