Take the 2-minute tour ×
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It's 100% free, no registration required.

I am generating a site map page that will contain whole site structure in a tree form, An XML file will be used to store the structure and I want to update that XML file every hour, Is there any thing in Tridion to execute job in schedule?

share|improve this question
    
I'd also add that re-publishing the entire site navigation every hour will place mor load on the Publisher and possibly delay the publising of other Pages. You could dedicate a Publisher server to this page and possibly some other system Publishing actions, which would help. But, I would suggest considering an alternative approach using Dynamic Content instead of static XML. –  robrtc Nov 4 at 6:13

7 Answers 7

I think you refer to a Scheduled Publishing task. It is possible do accomplish it using CME or the API. You can get some details here Publish / Republishing - Login is required.

If what you want is a Timer, then I would recommend to create an application or service that will use the API to publish when the timer period is elapsed.

share|improve this answer
6  
Or just use the windows scheduler to start a powershell job every hour... –  Nuno Linhares Jan 17 at 2:21

Using a scheduled process running an application/powershell that contacts the core service is the easiest way to to have your sitemap updated regularly, but there are other possibilities that allow you to have your sitemap always up to date. However maybe a bit more complex.

This is an approach that worked for me in the past:

  1. create a TBB that publishes an xml binary, every time a page is published, with the information about your page. More information on how to accomplish it on this article. Note that you don't need the storage extension part explained on the article, only publishing the with your required data.
  2. Have a page in your fronted that will gather all this XML's and assemble the Sitemap on page request
  3. Probably you will also want to have a caching strategy for your sitemap
share|improve this answer

Tridion does not have a timer or task scheduler built in.

You can use Windows's Task Scheduler or your own custom service to run a task every hour. You could for example publish a sitemap page by using the Core Service. The Core Service on the Tridion Content Manager is a web service which alllows you to do virtually everything you do in the Content Manager Explorer.

In case you would generate a site map on the CD side you have a scheduled task which uses the CD API.

UPDATE: You can run a powershell script like this one from the Windows Task Scheduler. Just have a task executing your powershell -file "C:\publish-your-page.ps1".

share|improve this answer

As mentioned already, SDL Tridion does not have an inbuilt timer, so you have two options basically:

  1. Take the scheduling part outside of the CMS, and use any of the suggestions given on the other answers.

  2. Use the Scheduled Publish actions and make the Page schedule itself each time.

For #2 that means you are not scheduling it at a set time, but just from the first time it was published it would be published again an hour later.

Now you could accomplish this either via a TBB or via an Event Handler (an Event Handler would be my preferred solution). Things to look out for is the occasional republish of the item, so in the Event Handler (or TBB) code you have to check if the Page isn't already scheduled for publish, else you end up that it will be scheduled twice an hour or more eventually.

share|improve this answer

Although most of the time we generate the sitemap directly from the CMS by publishing a page, there are lots of tools that generate the sitemap directly in the delivery area. A list of available sitemap generators can be found in for instance in:

https://code.google.com/p/sitemap-generators/wiki/SitemapGenerators

Some of those have the option of:

--> Schedule the generation of the Site Map:

In that case there is no need of do anything else in the CMS, is just install and configure the generator in the delivery server

--> Kick off the generation/regeneration of the Site Map programmatic:

Using this technique brings the advantage that the Site Map is generated just in time when a command is executed. When you publish a page from the CMS you can use a deployer extension that triggers the generation of the Site Map. (Be very careful with this option as if you do massive publishing you will be kicking off the generation multiple times and could cause major performance problems)

Better you can use a deployer extension based on a rule that when you publish a certain component named "Site Map" for instance kicks off the generation of the Site Map. The "Site Map" component will generate nothing, is just used as a condition for the deployer to kick off the process. In this case the business user decides when the Site Map will be regenerated with a minimum publishing performance

With this answer I just wanted to add another perspective for handle the Site Map generation using specific tools that are designed and built for that purpose, not suggesting is the best option (You are adding more load in the delivery), but could be applicable for some customers that were using those before or have the requirement of use that in the project.

share|improve this answer

How about only using Tridion for this? You could have an event system that gets executed when you publish the sitemap xml page (or dcp).

That event system will schedule the same page (or dcp) for publishing in 1 hour from the time the first publishing took place. I would save the next publishing time in the page (or dcp) app data to avoid publishing/and scheduling more times than desired. The next time the page (or dcp) gets published, the event system will kick in again and re-schedule in on hour from "now", and so on and on and on...

This should work.

Note, if you want to have the ability to stop this behaviour you could set a metadata field in the page (or dcp) to control de frequency (manually, every hour, every day, etc...)

share|improve this answer

Some basic VB code to make a page re-schedule itself for publishing, in this case, every week but I'm sure you can adjust to suit:

'schedule the file to republish again the following week
If RenderMode = "Publish" Then      
   vNewPubDate = DateAdd("d",7,now())
   vNewDateString = DatePart("d",vNewPubDate) & "," & DatePart("m",vNewPubDate) & "," & DatePart("yyyy",vNewPubDate) & " " & DatePart("h",vNewPubDate) & ":" & DatePart("n",vNewPubDate)
   vNewPubDate =CDate(vNewDateString)
   strPublishResult = Page.Publish (publicationTarget.Id, false, false, true,vNewPubDate)
End If
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.