Copied to clipboard

Flag this post as spam?

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


  • Sa 118 posts 152 karma points
    Nov 03, 2009 @ 14:31
    Sa
    0

    IPackageAction?

    hi folks.,

    Any detailed example as how to use IPackageAction?

    Thank you

  • Chris Koiak 700 posts 2626 karma points
    Nov 03, 2009 @ 14:45
    Chris Koiak
    1

    Have a look at

    http://our.umbraco.org/wiki/reference/packaging/package-actions

    and the codeplex page also has some good documentation

    http://packageactioncontrib.codeplex.com/

     

     

  • Sa 118 posts 152 karma points
    Nov 04, 2009 @ 06:17
    Sa
    1

    Do i have to create a class file and implement IpackageAction or just add <Action></Action>  in the umbraco's

    Developer->Packages->Create Package( package Actions tab)?

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Nov 04, 2009 @ 08:40
    Dirk De Grave
    1

    Sam,

    you need to create a class that implements the IPackageAction interface.

     

    Cheers,

    /Dirk

  • Chris Houston 533 posts 977 karma points MVP admin c-trib
    Nov 04, 2009 @ 10:15
    Chris Houston
    0

    Sam,

    What are you actually trying to achieve? Do you really need to implement your own package action or are you trying to use the current package actions? Also as Chris Koiak pointed out, have a look at the Package Action Contrib which also has some additional useful package actions.

    Cheers,

    Chris

  • Sa 118 posts 152 karma points
    Nov 04, 2009 @ 12:31
    Sa
    0

    Thanks for replying folks.,

    i would like to have clear idea as how to use Alias(),SampleXml(),Execute(string packageName, System.Xml.XmlNode xmlData) methods in ipackageActions

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Nov 04, 2009 @ 12:50
    Dirk De Grave
    3

    Sam,

    Alias is a unique name for a package action, as it's used to identify package actions by the packager.

    SampleXml simply returns a 'sample xml' snippet as to how the package action should be included when creating the action (through the packager interface). It serves as primary documentation for a package action

    Execute is the package action method that gets executed when installing a package. So if you've included an additional package action (through the packager interface), then the packager will pick up that action and call its Execute method (Packager uses reflection to find all classes that implement IPackageAction). Execute() method takes a xml fragment, which is the xml code snippet you'd add when creating a package

    For example: Assume you've created your own http handler and would like to add automate the installation. In that case, you'd need to add some xml code snippet to the packager interface

     <Action runat="install" undo="true/false" alias="AddHttpModule" position="beginning/end" name="TimingModule" type="Timer, TimingModule" />

    For more info on action attributes, see this wiki page.

    Each action may add additional xml elements (either as attribute or child elements), the packager will pass that xml fragment to the Execute() method

     

    Hope this helps.

    Regards,

    /Dirk

     

  • Sa 118 posts 152 karma points
    Nov 06, 2009 @ 11:40
    Sa
    0

    thank you Dirk.,

    Is it possible to give many <Action runat="install"> in  public System.Xml.XmlNode SampleXml()..

    any example code ?

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Nov 06, 2009 @ 13:40
    Dirk De Grave
    0

    Sam,

    I don't think that would make sense (attho it might be possible). A package action is supposed to execute a single task, and thus requires a single Action node. SampleXml is for documentation purposes only as well.

    Example code to be found on Codeplex (see Chris' reference)

    Hope this helps.

    Regards,

    /Dirk

  • Sa 118 posts 152 karma points
    Nov 07, 2009 @ 05:58
    Sa
    0

    thank you..

    what is custom installer (.ascx based) ?

    how to use it?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies