Copied to clipboard

Flag this post as spam?

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


  • Petr Snobelt 923 posts 1535 karma points
    Apr 27, 2012 @ 19:16
    Petr Snobelt
    0

    Change parent in specified time

    Hi,

    I need to move item from one parent to another at specified time - specified by DatePicker with time property.

    Is it possible?

     

    Simple example: Article with "archive at" property should be moved from news to archive folder.  My scenario is hard to explain, but I need to move item to another folder as soon as possible after value of "archive at" property is reached.

     

    Thanks for help

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 27, 2012 @ 21:40
    Tom Fulton
    0

    Hi Petr,

    I've done something similar before using a scheduled task which called an ASPX page or /base/ extension - the code here would check the children of a node for a date property and move to a different folder when the date had passed.  Would something like this meet your needs?  It wouldn't necessarily be immediate depending on the time chosen but rather would happen whenever you have the task scheduled to run.

    -Tom

  • Petr Snobelt 923 posts 1535 karma points
    Apr 27, 2012 @ 22:10
    Petr Snobelt
    0

    Hi Tom,

    thank you for suggestion. I cannot use task scheduler, because app is on shared hosting, and I have not access to task scheduler. I know there are some workaround for "web based task scheduler" (http://haacked.com/archive/2011/10/16/the-dangers-of-implementing-recurring-background-tasks-in-asp-net.aspx) but I hope I miss some simple solution.

  • Petr Snobelt 923 posts 1535 karma points
    Apr 27, 2012 @ 22:24
    Petr Snobelt
    0

    It looks like umbraco has it's own scheduler http://our.umbraco.org/wiki/install-and-setup/scheduled-tasks :-)

    Is there anyone who know if is it possible to add tasks by code, for example in publish event? And if it is possible to run task in specified time?

     

    Or should I use something like this - http://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/

    I can use save event to set cache to expire at specified time, and callback function can move page to another parent.

    (But when app starts/restart I must read all items and re-set it.)

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 27, 2012 @ 22:43
    Tom Fulton
    0

    Yep, you can use Umbraco's built in scheduled tasks as you found.  There's even a package with a nice GUI to configure them, and will also email you the results:  http://our.umbraco.org/projects/developer-tools/taskscheduler

    I'm not sure about setting the tasks programatically on publish, I'm sure you could but personally I would just have one task that runs and checks all the nodes globally.

    Not too sure about the other solution you posted though I'm sure that could work as well

    -Tom

Please Sign in or register to post replies

Write your reply to:

Draft