Friday, 28 September 2012

Using SharePoint 2010 feature upgrades to update existing sites.

One of my clients has a large SharePoint application, used for managing cases. As each case is raised, a new SharePoint site is provisioned and there, collaborators work together to move the case through to a resolution. Ultimately, the SharePoint site is used as the collaboration portal, the document store, and to surface an MVC application that provides the bulk of the functionality and process management through K2 workflow.

The system does a lot more than that, but for the purposes of this post, that’s enough background. Suffice it to say, it’s 3+ years old now and contains ten’s of thousands of case sites, and they need some changes.

Two of these changes are actually what I’d imagine are quite common scenarios. They need to;

  • Create some new functionality, and provision a new web part on all existing case sites (and have the new web part on new one’s too of course)
  • Add a new page to all case sites, with another set of web parts.

I wasn’t sure how to do this initially. If you know me, you’re aware that my speciality is application development, so the MVC part of this project, and I know enough SharePoint to get by, but this one had me stumped for a day.

The structure of the SharePoint solution is quite straight forward – for a case site, we have;

  • A “case site” site definition.
  • Several “features” associated with the site definition (not stapled, just each feature activated through the site definition).
  • One of these features contains a module, which provisions the pages of the case site and the web parts contained therein.


The first experiment

The first thing I tried, was just updating the page provisioning module to add the web parts. As I figured, this failed – it worked fine for new sites, but existing sites didn’t have the new web parts added to them, so I started reading up on the feature upgrade capabilities of SharePoint. I found these articles useful:


Solving it

So, armed with my new-found knowledge (ha), I finally got this working. In my next post I’ll address two scenarios, and provide all the source code that demonstrates the approach I settled on.

  • Adding a web part to a sharepoint page, and upgrading the one’s already in use.
  • Adding a new page to a sharepoint site, and adding it to existing sites.

No comments:

Post a Comment