Copied to clipboard

Flag this post as spam?

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


  • Gna Andrew Cross 14 posts 34 karma points
    Sep 30, 2010 @ 09:09
    Gna Andrew Cross
    0

    Action Handler

    Hi

    I have done the followings;

      1. Created a project with some actions (It has included all the umbraco needed files, so no errors)

      2. Done build the project release.

     3. select the DLL from the bin / output folder and copied it into the bin folder umbraco.
    Now, I required your help how to add the created events with the parameters in the contents created in umbraco.
    Note: I have created document types, templates and contents without any errors.
    Thanks in advance

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Sep 30, 2010 @ 09:48
    Sebastiaan Janssen
    1

    I don't know what exactly it is that you want to do, but have a look at an example event handler to see how they can be constructed.

  • Gna Andrew Cross 14 posts 34 karma points
    Sep 30, 2010 @ 10:27
    Gna Andrew Cross
    0

    Thanks for the reply. I am clear till creation of any classes required for any operation in umbraco. I just copied the dll which consists the class also. But now, I need your help after it. After copying the dll in the umbraco bin folder. How to invoke the action available in the dll from the content or template or document in the umbraco.

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Sep 30, 2010 @ 11:39
    Sebastiaan Janssen
    0

    Event handles fire on the events to which you tie them... so AfterSave, AfterPublish etc. 

    If you want to "fire" something in your own custom classes, have a look at /base.

  • Gna Andrew Cross 14 posts 34 karma points
    Sep 30, 2010 @ 11:59
    Gna Andrew Cross
    0

    The dlls (all) available in the umbraco bin folder will read the actions in the currently running umbraco page.

    If it is handled in any of the dll, then the function will be executed

    It does not require any explicity combine with the pages

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Sep 30, 2010 @ 16:57
    Sebastiaan Janssen
    0

    Are you talking about UserControls here? Can you show a simple example maybe? I feel that we're talking about different things here.. 

  • Gna Andrew Cross 14 posts 34 karma points
    Oct 01, 2010 @ 09:37
    Gna Andrew Cross
    0

    I have created a dll in the VS.NET 2005 to publish the tweet in my twitter blog. There are no errors in it.

    The dlls are pasted in the Umbraco bin folder. The dll is not user control but contains only classes withe events handled at the constructor like this;

    public tweetOnPublish()
            {
                Document.AfterPublish += new Document.PublishEventHandler(Document_AfterPublish);
            }

            void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
            {
                       // Business Logic

            }

    My requirement is:

    1. I have two datatypes in the document called tweet (check box) and message (textstring).

    2. If the tweet box is checked, the event available in the dll should be invoked to publish the tweet in my twitter.

    Just would like to know how the class file event is linked with the checked event of the umbraco content?

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 01, 2010 @ 09:47
    Sebastiaan Janssen
    0

    Okay, good, I understand now. It's pretty easy from here on out, you can read the properties with getProperty just do something like this:

    void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
            {
                     if (sender.getProperty("tweet") == "1")
    {

    //Send tweet

    }

            }

  • Gna Andrew Cross 14 posts 34 karma points
    Oct 01, 2010 @ 10:23
    Gna Andrew Cross
    0

    The greatest threat here is; if I have more than one dll, all the dlls will capture the events of a document. If any matches found then only execute the business logic related with it. Will not affect the performance?

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 01, 2010 @ 10:38
    Sebastiaan Janssen
    0

    Sure, if you fire many events it will start to suffer. You can put events in a new thread though, if you want.

Please Sign in or register to post replies

Write your reply to:

Draft