views:

562

answers:

4

Hello,

I'm using EpiServer CMS 5R2 on a new project. I've been tasked with creating a CustomPageProvider to link to an existing back end store which we don't have control of. However looking at the sample provider (XmlPageProvider) it appears that the provider is responsible for maintaining the meta information that EpiServer needs for example (from the examples.xml document):

<page id="10011" parent="10010" pagetypeid="3" versionid="1" security="Everyone:Read;Administrators:Create,Edit">
  <property name="PageGUID">35a988fe-2bc1-4e45-a41f-3a009a660551</property>
  <property name="PageTypeID">3</property>
  <property name="PageWorkStatus">4</property>
  <property name="PageFolderID">118</property>
  <property name="PageTypeName">[Public] Standard page</property>
  <property name="PageMasterLanguageBranch">en</property>
  <property name="PageLanguageBranch">en</property>
  <!---- SNIP! ---->
  <property name="Heading">A subpage</property>
  <property name="MainBody"><p>an external subpage</p></property>
  <property name="SecondaryBody"><p>second body</p></property>
  <property name="MetaAuthor">John Doe</property>
</page>

I'm a little concerned by this as I would prefer EpiServer takes care of this. This is a high volume website and it would be nice if my services didn't have to contain an extra data store in order to maintain this information, there will be cacheability concerns to say the least.

So, questions:

  1. Is a custom page provider the right tool for the job?

  2. If so, is there a way to push this responsibility back onto EpiServer?

  3. If not, can you give me any recommendations on how best to approach storing this data? As it is over and above what will be coming from our data source.

Much appreciated!

Robert Stevenson-Leggett

+1  A: 

Got this from my question at the EpiServer CMS forum: http://world.episerver.com/Forum/Pages/thread.aspx?id=27574&amp;pageIndex=1

RE:Custom Page Providers Post by: Johan Björnfot on 03 February 2009, 13:43:28

You do not have to store any meta information in your backend storage. There is helper methods in PageProviderBase, e.g. InitializePageData (sets metadata properties) and SetPropertyValues (sets meta and/or custom proeprties) that helps you with initialization of PageData objects.

So the answers to your questions:

  1. It sounds like PageProvider could fit well for your purpose.

  2. Use InitializePageData to handle MetaDatas (InitializePageData will set default values for meta properties e.g. status to published and so on). If you however want to set dome other meta data property value than the default ones e.g. status (Publish etc.) you can do that by calling SetPropertyValues afterwards.

  3. If additional data needs to be stored outside backing storage there are several options for this (custom table in db, filebased etc.). Which one to use is dependent on your environment, type of data to store etc.

Rob Stevenson-Leggett
+1  A: 

To use Custom Page Provider requires an enterprise license as well which many customers don't have. Just so you don't forget to check with the customer on that issue...

Not worried about that, big client - they have multiple enterprise licences.
Rob Stevenson-Leggett
+1  A: 

You still have to deal with managing page guids, id's and urls - which can be tricky with external data stores. Look up the MappedPageProvider - it takes care of all that for you.

Allan Thraen
+1  A: 

Page providers are a great way of piping in data from an external data source and they sound asthough they may be appropriate in your case.

That said, I'd be careful here as there is quite a lot of plumbing that you have to put in place and you have to take considerable care over performance for large data sources.

It's important to understand exactly when and how EPiServer asks for page data - i.e. when it uses the page cache and when it tries to hit the data source. Ultimately you will have to cache quite a lot of information about your pages in a format that can be efficiently searched, particularly if the link to your data source is relatively slow.

There's a pretty comprehensive discussion about this here: EPiServer page providers and performance.

Jakob Runhem