Over the past year I have been developing a series of site collections to roll out across a global farm. Each of the collections have several sub webs and use a set of pre-defined metadata values to boost search capabilities and to ensure that all content is marked with the same values by each user. As a document management system, maintaining structure is as equally important as flexibility to meet the various differences between regional requirements.
When I started the project off there were a few requirements which I was to use. It seemed logical at the time to develop a solution package for a site collection, add the features that make it up such as document libraries, views, default pages, etc. Using a prototype site to get the general idea out and then reverse engineering to get the site definition appeared to be an easy way to get these out. I knew that I had around 25 collections to build, each with their own set of libraries and views, and particular web parts so making it as easy as possible was the go. What I would eventually find out is that although possible to reverse engineer a site, there were little problems hidden within the files that made up the solution, little things which would not work for generic use. Before I knew it I had 3 large site collections being used and a lot of features!
The first big drawback was trying to change the way a document library worked. I needed to inherit values from the parent web and maintain individuality within each sub web, I needed to update views to limit the number displayed, and most importantly, I needed to replace the way users would create sub webs and provide them with a web part to do this. Now I started to find that each change required would mean hours of work changing the XML and adding to custom lists and updating the id used. Each library needed to be deployed as a feature which meant updating once deployed was time consuming. A new way needed to be found to provision sites as the web manifest was not going to suffice any longer. It was good to build the sub web structure, but that was about all.
Time to re-think the way this can be done. I figured that there were a lot of common features used across the initial 3 collections and these would be better placed in a common solution where I could call on them when needed. The second revision also meant that using custom lists were to be removed. At the time they seemed useful but at the end of the day, having a lot of custom lists is not really a good thing. To avoid this I created a copy of the standard document library, renamed the feature and then deployed this with the common solution. I was left with only list instances as features, but still, this was too much going forward. My site definitions were repeated as well, and deploying lots of features to create list instances was also wasteful and difficult to manage. Time to re-think this yet another time.
The round of changes would be very drastic. I would continue with the common deployment of features in one solution but would really trim back the number of features to deploy. I also decided that it might be best for me to generate my own list provisioner where I could pass in the properties needed to create the list, add my event handlers when necessary, assign content types to the list and set some default values. Of course I did not stop there. I also created another feature to simply assign content types to any list I created with the ability to remove the default one which is Document, a feature to set some web properties (which I will explain later the reason behind this), my own security model (again, this will be explained later) and some other stuff to help round out the site definitions.
To help move this along I created some snippets which I could use to generate the site definitions, add the features, set the modules up and add web parts. now I was ready to provision. I started building site collections like crazy, where one collection would take around 2 months to build, deploy, debug, re-deploy, etc., it now took me only 3 hours. But there were a lot of issues with the features and the more I created site definitions, the more the features failed and had to be debugged. Even though there were several defects with the features, across several site collections the same error would appear (or very similar). After a while they disapated and I was able to produse relatively bug free sites.
So, I was happy with my process, got around half-way through building when I had a new idea. Why limit myself to the provisioning that comes with SharePoint? There had to be another easier (well, as we will see not really, but definately more robust) way to generate these sites.
It was time to find a new way to provision.
I wanted to harness the features of SharePoint, leverage the work I did in replacing the list instances, custom lists, the overall number of solutions, really encapsulate the commonality of each collection but using only generic definitions and feature code. This would be an enormous undertaking and one which if successful, would revolutionise the way we create large sites in SharePoint. Alright, that might be stretching it a bit.