Any SharePoint developer will have to work with SharePoint Features at some point. Features are a great way to extend the core functionality of MOSS – in Web 2.0 speak, think of them as “plugins” and you’ll understand why they’re useful. Features can take a variety of forms – workflows being one of them. I’ve discussed in the past the usefulness of SharePoint Designer for workflow creation and eventually you’ll need to move to Visual Studio. Features (and workflows) can be designed directly in Visual Studio – support was added in 2005, but its support is further extended in 2008 – Visual Studio will generate all the required bits you need to actually get the workflow ready to be deployed to your SharePoint environment and gives you the all important debugging and code step through stuff. There’s a nice guide to the basics of workflow and Visual Studio.
In fact, there are lots of good tutorials out there on how to get going with workflow and Visual Studio but they’re all rather restricted by the same issue – how to actually deploy the Feature to SharePoint when it’s ready. There’s a rather convoluted series of stsadm commands which essentially equates to
- Add solution
- Deploy solution
- Install feature
- Activate feature
And that doesn’t cover what you need to do if you then produce a new version of your feature – redeploying solutions and deactivating features every time gets very tiresome, very quickly! Fortunately, some folks at CodePlex, have, once again, made our lives easier with the excellent Sharepoint Solution Installer. In their words:
This project is a Windows application for an eased and more user friendly installation and deployment of SharePoint 2007 solution files to a SharePoint server farm. Distribute your SharePoint solution files with this installation program instead of a raw script using STSADM.EXE to install and deploy the solution.
This incredibly handy bit of software takes care of everything required to install the .wsp (solution file) that Visual Studio 2008 handily prepares for you. Furthermore, it neatly handles updates, repairs and removals of solutions. Configuring it is a little on the fiddly side – a lot of the info it asks you to provide* is already specified elsewhere in the manifest or feature files – although it seems inevitable that future versions of the tool will find this information directly. It’s definitely possible, because the Trentacular features for SharePoint does it, but the developers of v2 of the tool have already identified some issues with this approach.
Note: Beware the Setup.exe.config file that is bundled in the v1.2.2 download – it includes a key called “FarmFeatureId”. This should actually be “FeatureId” – with the incorrect key name, your feature is not activated at the end of the process!
Stsadm is all well and good, but it’s not exactly user friendly, I prefer to limit my command line activities to my Ubuntu machines. This tool takes out all the guesswork, in a very neat little package. Sometimes the life of a software developer is just too easy…
* The items you need are
- SolutionId – in Manifest.xml
- FeatureId – in feature.xml
- FeatureScope – in feature.xml