Tuesday, November 18, 2008

Imtech StsAdm Commands v1.0.0.0 - OCDExportList

A nice to use tool is Imtech STSAdm Commands. When you'll install it you'll be able to use a custom command in stsadm: OCDExportList. This command is somehow the equivalent of SharePoint Solution Generator for exporting list definitions. I had some problems to use SharePoint Solution Generator (SSG) after I installed Visual Studio 2008, so I couldn’t use this tool any more. After a little search on the Internet a have found this tool and I've started to use it. I found that it is very easy to use and very light. With this tool I can export list definitions (after you customize them on SharePoint) and use them in my own content types (a very useful thing to do).
How to use it:
I created a bat file with the following content:

@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm"
@SET DEPLOY=D:\Projects\_Generated Code\
@SET URL="http://localhost"
@SET NAME=MyList
%STSADM% -o ocdexportlist -url %URL% -name "%NAME%" -dir "%DEPLOY%%NAME%"

This export the list definition file (schema.xml) and the appropriate list files (NewForm.aspx, EditForm.aspx, etc.) in the D:\Projects\_Generated Code\MyList folder. Then you just have to copy the entire folder in your solution in Visual Studio under your feature folder and you're ready to deploy it as a new content type.
The release for this tool is located here: http://www.codeplex.com/tmt/Release/ProjectReleases.aspx?ReleaseId=10875
Some other information about it is here: http://blog.mastykarz.nl/export-list-definition-free-stsadm-command/