Thursday, September 24, 2009

SharePoint: Add Documents to a Quick Deploy job!

In a SharePoint publishing site, users have the option to put a page into a Quick Deploy job. Every 10 minutes or so, the Quick Deploy job runs and items in it will get deployed to the target server. In my case, I publish from the Staging server to a Production server.

Sometimes, you may have something in a document library that gets referenced by a page that's not in SharePoint. SharePoint won't know to put your library items (documents, images, etc.) into a Quick Deploy job. So, it'd be nice if we had a way to add things from a document library to a Quick Deploy job.

I found this (thanks man!) which describes the gist of how to do this (I had to tweak the code a bit to make it work), then I created my own Feature and .wsp file to actually implement this.

You can use this or modify it, etc. I make absolutely no guarantees and am not responsible if something goes completely wrong for you. It seems to be working for me so far, and I'm pretty happy with it. In all, it's a really small chunk of code, so you should be able to read it and figure out what it's doing.

I've put my .wsp and code on CodePlex.

After running the install.bat file, you will of course have to go to Central Admin - Operations - Solution Management, click the quickdeploydoc.wsp and deploy it to the site of your choice. Then, you'll have to go to that site, Site Actions - Site Settings - Modify All Site Settings, Site Collection Administration, Site collection features to activate "Quick Deploy Doc Feature". I believe you can also script out those last parts, but I was trying to be rather generic since I don't know your particular setup.

Also, I use WSPBuilder inside Visual Studio 2008. It's a great tool for auto-geneating the manifest and creating the .wsp file for you.