Try our conversational search powered by Generative AI!

Build an automatic archiving job.

Vote:
 

A customer of mine wants me to build an automatic archivingh job for their news-pages. When a news-page has passed it's stop published-date they want to move that page to a specific Month-folder in the three-structure (for example: If a page has it's stop published date 2011-01-24 that page should be moved to the january-container under the 2011-container in the three structure). They know that they can asign wich archive each page should be archived to themself but they want it to be all automatic.

My first thought was to asign every pages ArchiveLink dynamicly in code behind but I noticed that the ArchiveLink-property is read-only so I had to try a different approach.

Is there a way to make the ArchiveLink-property wrtiable, or do anyone here have any other good pointers on how I should resolve this task?

#47243
Jan 20, 2011 12:31
Vote:
 

Rather than assigning the property on each page, use a property on the container (I assume that news pages are in, if not a single, just a few containers). This should pont to the root of the archive. It could also be a dynamic property.

If needed you can make your property look like the standard property (but preferably only available on containers) and hide the original archive property by using the trick Anders mentions in this forum thread: http://world.episerver.com/Templates/Forum/Pages/thread.aspx?id=46551

Then of course you have to store some setting for the page type to use for the container pages, as a property on the start page/settings page, key in appSettings etc. Then create a scheduled job which finds expired pages and reads the dynamic property (or traverses the tree to find the container page's property) to get the info where to move the page. Add some logic for finding/creating the year and month containers.

#47244
Jan 20, 2011 13:09
Vote:
 

You could do it the other way around

Every month create a new month page, and move pages to that month page.

 

#47245
Jan 20, 2011 13:39
Vote:
 

automagily ofcourse :)

#47246
Jan 20, 2011 13:39
Vote:
 

The PageArchiveLink doesn't appear to be read only? Have you tried using CreateWritableClone if you are trying to update a page property programmatically?

You could always hook into the Published event on the news page type and set the PageArchiveLink link based on the end publish date. It just needs to ensure that the archive/year/month structure exists before setting the link.

It becomes fully automatic and uses the standard archive function...

#47248
Jan 20, 2011 15:14
Vote:
 

Alexander, at Epinova we have a custom module that does exactly what you need - archives pages into a year/month structure with a scheduled job. This module is in use in several of our production sites. It will be available shortly on epicode or codeplex, in the mean time I can send you the files you need. Email me at arild.henrichsen@epinova.no if you're interested!

#47314
Jan 24, 2011 8:59
Vote:
 

Thanks for the input! You've given me a lot of good information and pointers. I'm going to try the module that Arild spoke about.

#47316
Jan 24, 2011 9:26
Vote:
 

Hey Arlid, the module you use seems pretty cool any idea on when it will be published onto EPiCode ?

Thanks

Minesh

#48726
Feb 14, 2011 11:13
Vote:
 

Minesh - send your email address to me (arild.henrichsen@epinova.no) and I'll send you the module. Haven't had time to upload to EPiCode.

#48727
Feb 14, 2011 11:18
Vote:
 

For reference - the Epinova.DateTreeArchive custom archiving module I mentioned above is now available at https://www.coderesort.com/p/epicode/wiki/Epinova.DateTreeArchive

#50436
May 02, 2011 15:01
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.