Copied to clipboard

Flag this post as spam?

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


  • Nikola Petkovic 64 posts 63 karma points
    Jul 10, 2009 @ 18:18
    Nikola Petkovic
    0

    Can I tell if Document is being created from one section/tree or another?

    Hi folks,

    I'm using events to additionaly handle Document creation.

    At the other part of the system, I also call Document.CreateNew(..) mehtod, but this time I dont want it to be handled with the above delegate.

    Unluckily, docType I am creating is also the same, so I can't tell if I want to execute custom handler or not.

    Is there a way to distinguish if an admin is creating Document using Content tree action or any other custom tree action or logic?

    I guess it should be somehow possible since you have to derive from AplicationBase to name the event handlers, which allows you to override app Alias, and other app properties, but dont know how to use them... :{}

  • Sjors Pals 617 posts 270 karma points
    Jul 10, 2009 @ 18:37
    Sjors Pals
    0

    Can't you make a check in the event handler to see who's creating it?

  • Chris Dunn 75 posts 127 karma points
    Jul 17, 2009 @ 02:59
    Chris Dunn
    1

    To follow up on Sjors comment, you could create a specific "worker" user which you use in your custom events, rather than user 0 or the document creator.  This would let you identify whether the document was created through the admin UI or a back end process.  So when handling an event you only want executed for admin UI initiated events, check that the user was not the "worker" user.

    -Chris

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jul 18, 2009 @ 00:43
    Aaron Powell
    0

    There's no property of a Document which is set (OOB) that indicates where it was created. As others have said you could create a specific user which is used for your custom creating method.

    The only other way would be to check the Call Stack in the event handler and check where it came from.

Please Sign in or register to post replies

Write your reply to:

Draft