Copied to clipboard

Flag this post as spam?

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


  • Tobias 16 posts 61 karma points
    May 12, 2009 @ 15:37
    Tobias
    0

    Actionhandler creating published "folders"

    I have an action handler which creates "folders" in the Umbraco content tree when an item is saved/published.

    Creating a structure like:
    --2009
    ----05
    ------01
    --------theItem


    However when I try to publish the folders programmatically they do not get any "link to document" and from investigations it seems like the documentCache isnt updated.

    Doing:
    [code]umbraco.library.UpdateDocumentCache(Id);[/code]

    Works fine in Umbraco version 4.

    But I want to deploy this on a 3.0.2 version umbraco installation.
    When I try the same code on that server I get:

    [code]System.MissingMethodException: Method not found: 'Void umbraco.content.UpdateDocumentCache(Int32)'.
    [/code]

    Is there any equivalent in version 3.0.2?

    I have tried:
    [code]
    umbraco.library.UpdateDocumentCache(Id);
    umbraco.content.UpdateDocumentCache(Id);
    umbraco.library.RefreshContent();
    [/code]

    And all is "missing" and does not work.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 12, 2009 @ 15:59
    Dirk De Grave
    0

    Hi,

    v3.x doesn't know about those 'new' publishing methods.
    In v3.x, you' use:

    Publish() and PublishSingleNode()

    First function prepares a node for publishing, the second performs the actual publish and refreshes the data!

    Hope this helps.

    Regards,
    /Dirk


  • Tobias 16 posts 61 karma points
    May 13, 2009 @ 13:27
    Tobias
    0

    Yes, it worked!

    Thank you for the solution.

    I was thinking of modifying the actionhandler so it can be used for different versions of umbraco.
    I saw that the documentObject has a property named "version". Is this the umbraco version or just the version of the object? And also as it is a guid how do I know what version this Id corresponds to?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 13, 2009 @ 13:59
    Dirk De Grave
    0

    It's version of the object (also used in rollback scenarios)

    umbraco version can be found as it's stored in web.config. Not sure if it's available as public property, otherwise use ConfigurationManager to get the umbraco version.

    Cheers,
    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft