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.
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.
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
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
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
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.
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.)
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
is working on a reply...