Inconvenient programmatically provisioning Web Part instances

Back in October last year I started working with programmatically provisioning Web Part instances. The challenging part was that the assemblies containing the Web Parts’ code were located in the bin directory of the target Web Application. The custom STSADM command I was using for that purpose wasn’t able to resolve the Web Part type. Back then I have found a way to deal with it which I though was a working solution. Unfortunately: just last week I have stumbled upon the same situation: again.

Inconvenient programmatically working with SharePoint users (SPWeb.EnsureUser)

According to the Windows SharePoint Services (WSS) v3 SDK the SPWeb.EnsureUser(String) method is all you need while programmatically working with users. Using nothing more than the login name it checks for you whether the particular user exists in the current web and adds it if required. Within a single line of code it retrieves for you a proper reference to a user no matter the membership/role provider. While it’s really that simple while working in the scope of your SharePoint Web Application, things get slightly more challenging when used in combination with a custom code outside of the HttpContext.

Imtech SharePoint Gems: SPUrlExpressionBuilder

Recently, while working on a SharePoint solution I have rediscovered the SPUrlExpressionBuilder class – one of the many hidden gems of SharePoint 2007. After some research it turned out to be more than the URL tokenizer we know from WSSv3.

Export Publishing Pages to Features – Imtech OCD Export Page v1.0.0.0

Recently I have found that you could actually provision Publishing Pages using the declarative markup of Features. Right after that discovery I have found that you could benefit of that functionality in quite a few scenario’s, like provisioning test content wrapped in Features. The biggest downside against provisioning Publishing Pages would be having to generate the XML manually. To simplify the process I have decided to create a tool which would export the existing Publishing Pages to Feature XML. Guess what: the tool is ready now and you can take a test drive.

Inconvenient Control Adapters

Control Adapters are a great way to modify the presentation layer of any control out there: no matter whether it’s sealed or internal. And while they are pretty easy to setup you can find yourself spending a couple of hours if somehow they seem not to be applied…