Adding document types can sometimes be time consuming and cumbersome, especially if the document type has a lot of tabs and fields. So, instead of forcing you to re-enter all this information time and time again, Umbraco provides the ability to export existing document types and import them into another installation.
As shown in Figure 3-11, exporting is an easy three-step process:
The file type that Umbraco generates is saved with an extension of .udt. You can open this using any text editor like Notepad. You can manually edit the document type by altering the XML in the exported .udt file. However, doing this is not advised because system-generated IDs can get out of sync and duplicated if you are not careful.
You can do a couple of things with your shiny new exported document type. The most obvious is importing it to another installation (see the next section in this chapter) to avoid starting from scratch and retyping all your properties and tabs.
If you have custom data types defined in a given Umbraco installation and you export your document type for use with another Umbraco installation, you end up with data type IDs that do not exist in the new system. This means that you must select the appropriate data type for those properties that do not utilize standard data types.
The other benefit to exporting document types is the ability to add them to your existing source control and versioning system (such as Subversion, which is an open-source source control system available at http://subversion.tigris.org/). This feature allows you to easily revert to older versions and, more importantly, have an offsite backup in case of a disaster.
You can import a document type from an existing .udt file in a few simple steps, as shown in Figure 3-12.
The document type is now ready for you to use and alter as needed.
Exporting document types as Plain Old CLR (common language runtime) Objects is a great feature when you need to interact with content nodes from .NET user controls. Umbraco generates Plain Old CLR Objects, also known as POCOs, with or without abstractions. Exporting document types enables you to quickly bring in this code to your project and start working with the content properties. This process generates objects for all of your document types.
To generate the POCO stub files, follow these instructions: