Programmatically creating Variation Hierarchies in SharePoint 2007

Scripting deployment of SharePoint 2007 solutions gives you numerous benefits. Not only you will be able to deploy your work in a structured and repeatable manner but it also saves you tons of time which you would otherwise spend on configuring the solution in different environments over and over again. If you’re going to automate your deployment process, you would preferably want to script it all, leaving no manual steps at all. Unfortunately it’s not always possible as both WSS and MOSS teams have protected pieces of the object model which you might need to get the job done. Luckily there are still ways to get to the protected code.

Change the WSPBuilder DeploymentTarget to WebApplication

By default WSPBuilder builds solutions with the DeploymentTarget attribute set to GlobalAssemblyCache. All assemblies provisioned by the solution will be deployed to the Global Assembly Cache (GAC) of the target web server which might not always be desirable/doable. There are a couple of ways of how to change the DeploymentTarget to the bin directory of the target Web Application.

See IDs of all available Site Definitions

While working on SharePoint solutions once in a while you need to create custom Site Definitions. It’s not easy to work with Site Definitions: they can easily get very complex and are almost impossible to debug. Unfortunately there are situations when you cannot avoid using custom Site Definitions. Is there anything we could do to make it easier to work with Site Definitions?

Provisioning Content Query Web Part querying subsites in a structured and repeatable way

Today, while working on a brand new SharePoint Web Content Management (WCM) solution, I’ve faced quite a challenge: I needed to provision a Content Query Web Part (CQWP) which would query subsites of the current site using a custom Site Definition. Each time user would create a site using that Site Definition, he would get on the home page an aggregation of the content from all underlying sites. It’s more challenging than it sounds and you won’t know it unless you had to do it yourself once.

Provisioning subclassed Content Query Web Part using Gary Lapointe’s setwebpartstate stsadm command

Stsadm is highly extensible and Gary Lapointe is one of the guys who could tell you everything about it. In order to support the deployment and administration of SharePoint solutions, Gary has created more than 130 custom STSADM commands. One of them – setwebpartstate has recently took my attention. I kept getting errors while importing a subclassed Content Query Web Part (CQWP) – until now…