Copied to clipboard

Flag this post as spam?

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


  • MK 429 posts 906 karma points
    Apr 10, 2014 @ 09:43
    MK
    0

    Adding Actions to the Package Action tab

    Hi there,

    Ive added a few package actions that should add keys to the appsetting in umbraco 7.1.1  web.config with no success.

    The package is installed but no keys are added to the web.config.

    Any idea on how to make it work?

    Regards,

    Moshe

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Apr 10, 2014 @ 09:58
    Dennis Aaen
    2

    Hi Moshe,

    DonĀ“t know if this documentation could be any help at a version 7 or if you have seen this?.

    http://our.umbraco.org/wiki/how-tos/packages-and-projects/package-action-samples

    /Dennis

  • Kim Dahlberg 1 post 71 karma points
    Nov 20, 2018 @ 12:55
    Kim Dahlberg
    0

    That link is removed, I found this instead https://our.umbraco.com/Documentation/Reference/Packaging/

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 10, 2014 @ 10:11
    Jan Skovgaard
    0

    Hi Moshe

    Try the link Dennis posted above - If you need some inspiration you can perhaps get some by having a peak at the source code of the installer for exponent cropup http://cropup.codeplex.com/SourceControl/latest#Eksponent.CropUp.UmbracoIV/Installer/AddHttpModule.cs

    Can't remember if it adds a key to the appsettings part though but I think that the concept is illustrated in the source you just need to change the element where it needs to be added.

    Hope this helps.

    /Jan

  • MK 429 posts 906 karma points
    Apr 11, 2014 @ 13:42
    MK
    0

    Hi,

    Many thanks for your reples!

    Dennis, Ive tried that with no success.

    Jan, Also tried your link but also here I wasnt able to get it right. It seems as if the Execute methos is not being called.

    any idea?

    Regards,

    Moshe 

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Apr 14, 2014 @ 13:38
    Richard Soeteman
    0

    Hi,

    I think the action is already in PackageAction contrib? http://packageactioncontrib.codeplex.com/ but 9 out of 10 times it's the xml that is wrong when you run into issues. Check and double check if the xml is correct.

    Cheers,

    Richard

  • Harvey 28 posts 122 karma points
    Dec 02, 2015 @ 12:03
    Harvey
    0

    Sorry to drag up an old topic, but there is a really limited amount of documentation on this subject.

    The link that Dennis Aaen gave us (http://our.umbraco.org/wiki/how-tos/packages-and-projects/package-action-samples) has a link to a package action tester (tswe.pat_4.0.0.zip). However, this package action tester does not work in later versions of Umbraco (tested on Umbraco 7.2.8) because of a missing core util that has been deprecated (GitHub link to missing util).

    There is a newer package action tester that can be found here (works on 7.2.8). This package action tester tests to see if the XML is valid - it will return an error if the XML is not valid. However, it won't test to see if the action is a valid action.

    If we take a look at the current Umbraco documentation (here), we can see what package actions are available. Unfortunately, pretty much all of the actions in the documentation (that Dennis Aaen linked us to) don't exist in the current Umbraco core.

    Running:

    <Action runat="install" alias="addApplication" appName="testAppName" appAlias="testAppAlias" appIcon="testAppIcon" />
    

    in the package action tester, will create the following line in the applications node in the applications.config found in the Config folder of an Umbraco installation.

    <add alias="testAppAlias" name="testAppName" icon="testAppIcon" sortOrder="17" />
    

    So, I guess this shows that package actions can be used to run changes on the site.

    Going back to the link that Dennis Aaen gave us to the extra documentation, there is a link to some extra actions. If you download the DLL from that project and put it into your Umbraco site, then run the following action through the tester:

    <Action runat="install" undo="true" alias="AddAppConfigKey" key="TestKey" value="TestValue" />
    

    Then the following key will be added to the appSettings in the web config:

    <add key="TestKey" value="TestValue" />
    

    I have just tested and found that if you package that DLL into your package (jn the Package Files tab when creating your package through Umbraco), then add the actions to the Package Actions tab, you will be able to use the extra actions that the DLL adds.

    I hope this helps anyone trying to figure out how to use package actions when creating a package!

  • Harvey 28 posts 122 karma points
    Dec 02, 2015 @ 12:09
    Harvey
    0

    If anyone is interested in adding further package actions to their package, I recommend doing what Merchello has done.

    https://github.com/Merchello/Merchello/tree/c252625d56d0966d3d274a5fac3550b6359c9b37/src/Merchello.Web/PackageActions

Please Sign in or register to post replies

Write your reply to:

Draft