Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Laurent Lequenne 123 posts 248 karma points
    Mar 18, 2011 @ 09:52
    Laurent Lequenne
    0

    Multiple Action handlers => order of events

    I'm implement some generic website, and I'm dealing now with action handlers by creating different applicationbase classes => I have such thing as DateFolder, CategoryFolder .... And DocumentIndexing

    So I guess you see what I mean... The document indexing handler should only occur after the datefolder  or categoryfolder hanlers occurs. Is there any way to specify the order the Application Bases are processed ?

    Thank you !

  • Daniel Bardi 927 posts 2562 karma points
    Mar 18, 2011 @ 10:55
    Daniel Bardi
    0

    You could set a session variable after DateFolder and CategoryFolder.

    Check the variable on all events and update when each occurs... only run DocumentIndexing if the session variables says that the other 2 have run.. then reset the variable for the next time.

  • Laurent Lequenne 123 posts 248 karma points
    Mar 18, 2011 @ 11:48
    Laurent Lequenne
    0

    Euh Thank you Daniel, but I do not think this will help.

    The Application Bases are instantiated by Umbraco. Everytime you publish a document by example, the event handlers defined in the applicationbases are called. But I don't see anything to ensure that some events should be called after other events. I could do all this in one, but that doesn't help me to make it flexible and configurable. For now in my generic site, i have a part of my content that is configuration, and in this configuration part there is a part for action handlers.

    You can select :

    • Action handlers to run => some dataType editor that gets the applicationbase with some attribute
    • Document Types it applies to => multiple selection
    • And the parent nodes it applies to => also multiple selection.

    Each time I publish, delete, ... the events are called from my applicationbase classes, and each of them check if the action on the document applies to one of the configuration defined into the CMS.. So for now it's very simple, and ensure you can deliver something that can be extensible... You want another event handler , just derives your own application base, and it will be available to be configure into the CMS.

    But !!! This means, that I would like to get some priority scheme also to be sure things are called in the right order ....   !

     

  • Eric 2 posts 22 karma points
    May 03, 2011 @ 15:59
    Eric
    0

    Hi,

    did you manage to do that ? I have the same need...

  • Laurent Lequenne 123 posts 248 karma points
    May 03, 2011 @ 16:10
    Laurent Lequenne
    0

    Hello Eric ! I didn't went back to that topic yet... But In Umbraco if you want to have things done, you have to do it yourself ! So for now I did'nt had a case where it was specifically needed, So I go ahead with my implementation, but I think the only way to make it happen the way you want, is to have only one action event handler that calls your own made event handlers  :-))))

  • Eric 2 posts 22 karma points
    May 03, 2011 @ 17:03
    Eric
    0

    Hello Laurent :)

    Thanks for your prompt reply. I had the same conclusions...

Please Sign in or register to post replies

Write your reply to:

Draft