- Part 1 – The Tools
- Part 2 – Exporting the Site
- Part 3 – Exporting the Lists
- Part 4 – Exporting the Site Columns and Content Types
- Part 5 – Wrap Up
If nothing else, this blog post will win the award for longest title that I’ve written yet. Joking aside, It’s time to put one of the finishing stones in place for this series. So far we’ve exported the site and lists, now it’s time for the site columns and content types. The tool we’ll be using this go around is the Imtech Fields Explorer. The process is fairly straight forward so let’s dive in.
Launching the field explorer tool, you’ll first be prompted to specify your SharePoint site URL and click Open. You’ll see entries for this site’s content types, site columns, and lists. Strangely (at least in the v126.96.36.199 version I’m using) I am not able to export lists. Not sure if this is intended functionality or just features yet to be implemented. Either way, select the content types and site columns to be exported. You can also view detailed information about the individual entries, similar to other products such as SharePoint Manager.
Now that you’ve got your output files, open them alongside your WSPBuilder solution. The Columns.xml file is fairly simplistic. It will detail all of the properties and metadata used to define a site column. Copy all of the <Field> elements into the elements.xml file of a feature for deploying your content types (a blank feature in WSPBuilder will suffice.) I’ve only chosen one column for the example below, but you’ll more than likely have many more.
Next open the Content Types.xml file. For content types, so far I’ve found only the <Content Type> elements to be necessary while the <XmlDocuments> elements can be left out. If anyone knows the <XmlDocuments> to be required for some reason let me know. Copy the <Content Type> elements and their child elements into the same elements.xml file as above. The <FieldRef> elements will link to the <Field> elements via the GUID.
Now if you remember from the end of part 3 of this series we talked about needing to add in the content type and site column definitions to our list definition’s schema.xml file as well. So while we’re copying these definitions into the elements.xml file above, also add them to the appropriate schema.xml files for your lists. Only the content types and site columns belonging to that list definition will need to be copied over. In the end you’ll have something similar to the below example for the list schema.xml file.
And with that we’ve reached the final step of our exporting process. I’ll be putting together a wrap up post on some caveats that I’ve run into thus far and other things to look out for along the way. I’ll also do a quick bit on actually deploying the site template for use. Thanks for reading along so far. Post any comments or questions you have. Until next time.