Creating a scheduled task in Umbraco Options
kutedawako
Posted: Saturday, December 22, 2007 10:37:51 PM
Rank: Devotee

Joined: 9/12/2007
Posts: 58
Location: Honoluu, HI
Hello,

How would you go about an create a schedule task in umbraco using C#? I plan on creating a news archive page that pulls all the news items from the news page and moves it to News archive page once the new year begins.

Can I use an action handler to do this task?
hoehler
Posted: Saturday, December 22, 2007 10:59:41 PM

Rank: Addict

Joined: 7/19/2006
Posts: 597
Location: Bad Homburg, Germany
No, an action handler reacts on actions done in the umbraco backend. So they will only perform if you, eg publish a node. One possibillity is a scheduled task defined in /config/umbracoSettings.config where you can call an url scheduled.
Code:

<scheduledTasks>
    <!-- add tasks that should be called with an interval (seconds) -->
    <!--    <task log="true" alias="test60" interval="60" url="http://localhost/umbraco/test.aspx"/>-->
  </scheduledTasks>

This was for calling an aspx from umbraco to keep umbraco live, but you can call your own node with your own ascx or you can call your own webservice. Within this webservice you can check the date time and can perfomr the actions you want.

hth, Thomas

• 2007/2008 MVP • www.thoehler.com • Bad Homburg, Germany
kutedawako
Posted: Sunday, December 23, 2007 1:04:46 AM
Rank: Devotee

Joined: 9/12/2007
Posts: 58
Location: Honoluu, HI
Thanks thomas.

I will try out your suggestions and post what I come up with :!:
jesper
Posted: Sunday, December 23, 2007 9:30:06 AM

Rank: Administration

Joined: 7/25/2006
Posts: 415
Location: vipperoed, denmark
Hj John,

Do you actually have to move the old news? In my opinion it's just another way of looking at the news and could be solved by sorting and filtering with some xslt on whatever news date you're using.

kindly,

Jesper

webbureau jesper.com doing webdesign / development / umbraco implementations / 2007&2008 MVP
SoerenS
Posted: Sunday, December 23, 2007 10:27:12 AM

Rank: Fanatic

Joined: 7/25/2006
Posts: 424
Location: Silkeborg, Denmark
Moving pages, and thus changing their URL, is a very bad thing to do when it comes to SEO and Google.

- If fx. Google manages to index your news items before they are moved to the archive, once they are moved Google will still be directing traffic to those (no longer existing) pages for a while until it discovers they are gone.

- The pages will loose any Google (pagerank) value that they have allready build up when they are moved.

- Since they are moved and the URL changes, it will be hard for people to bookmark or link to a new item.

- Google might think that both pages (the news item and the archived one) exist at the same time and then mark the newest one as "duplicate content" and never index it. So you'll run the risk of your archive never being indexed på Google.

So as Jesper says, why not just post all news items under the same node and let them stay there? And then just apply a little sorting/filtering where you need to just display the top?

/SoerenS

Brug for råd til hvordan du driver en god webshop? / Need advice on how to run an effective webshop?
kutedawako
Posted: Monday, December 24, 2007 3:45:50 AM
Rank: Devotee

Joined: 9/12/2007
Posts: 58
Location: Honoluu, HI
Thank you jesper and soeren.

I will have to redesign my page. Thanks for the valuable advice :)
imayat12
Posted: Wednesday, December 26, 2007 10:09:34 PM

Rank: Addict

Joined: 7/19/2006
Posts: 649
Location: Preston, UK
John,

I usually do news archive thing by displaying on news page first 10 news items then creating another page called news archive which lists all news items as paginated list ordered by date descending. You could do something similar but on your main news page say list all news items for the current year and on your news archive page list all not including this year.

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
kutedawako
Posted: Thursday, December 27, 2007 12:01:06 AM
Rank: Devotee

Joined: 9/12/2007
Posts: 58
Location: Honoluu, HI
Hey Ismail,

Do you have xslt samples no how you created the paginated list?

Thanks,

John:D
imayat12
Posted: Thursday, December 27, 2007 5:50:04 PM

Rank: Addict

Joined: 7/19/2006
Posts: 649
Location: Preston, UK
John,

Take a look at Doug's excellent xslt search package that has got pagination.

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.