SharePoint 2010 Cookbook: How to Customize the Document Set Content Type

SharePoint 2010 delivers a comprehensive set of document management features. In this post, we will take a closer look at how to customize the Document Set content type.

Challenge:

Using the previous post in this series, you were able to create a Document Set using the out-of-the-box template. Now you want add special properties to the entire document set that can be modified from a single location.

Solution:

As mentioned in the previous post, Document Sets are a special type of folder that can be created based on SharePoint content type. The out-of-the-box Document Set content type is fairly generic in its behavior in order to accommodate a variety of potential document sets. By modifying or creating a new content type that you can use with Document Sets, you will be able to customize a great deal of how users access and interact with the document set. You can customize a content type to add or restrict actions related to an item (or to a document set, as in our example below):

  • Share common properties between the Document Set and its documents
  • Specify which properties will be visible to end users
  • Specify retention and audit schedule
  • Attach specific workflows

In this example we will create a new Document Set specifically to handle a set of product design documents.

Customize Document Set Types

Logically, what we are trying to build is a set of Product Management work products, which include the following documents:

  • Product Design Document in Microsoft Word
  • Product Release Schedule in Microsoft Project
  • Product Presentation in Microsoft PowerPoint
  • Product Revenue and Cost in Microsoft Excel

What we want is for these documents to share the same properties:

  • Project Cost Center
  • Project Name
  • Project Manager

Customize Document Set Content Type

The first thing we need to do is to set up a content type for our documents in this new Document Set. Go to the top Site Collection > Settings page, and click on Galleries > Site columns:

1

Click on Create to add a new site column. Please note that your site administrator might have already defined a set of standard site columns that can be used across the portal. You should definitely check with your SharePoint Administrator to see if such columns already exist.

1

Add a text column for Project Name and Project ID. Add a Project Manager column using the Person data type. When you are done, it should look something like this:

1

Next, we will add a new content type for our Document Sets. Go back to the top site collection setting page and click on Galleries > Site content types:

1

You will see that there is already a default Document Set content type which shipped with SharePoint 2010 Server. Let’s add another Document Set. Click Create to add a new content type. Select the Document Set Content Types as its parent type:

1

When we build the new content type based on the standard Document Set content type, we inherit the properties (columns) of the existing, out-of-the-box Document Set content type. One of the advantages of inheriting the properties of the built-in content type is that if we later decide to change or add new properties to the base type, those changes will also be reflected in our new content type.

Let’s add our newly created site columns into this new content type. After you create the new content type, you should see its properties form. Note how you can customize additional properties for this particular content type (such as workflow settings) by clicking on the Add from existing site columns link:

1

Add the new site columns that we just created to this content type:

1

You just now create a new content type that can be used with a new Document Set. Let’s make sure our properties are working correctly. Click on the Document Set settings of the content type setting page:

10-12-2010 2-38-46 PM

There are a few settings that you can change for this Document Set content type. For example, the type of content that you allow the user to add to the document set:

1

The setting that is of particular interest to us is the ability to share properties across all documents within a document set, which can be set in this section:

1

And let’s also add those properties to the Welcome page of the Document Set.

1

We have just created a new Document Set to manage our sample product work files. Let’s see how it works. The next thing you will have to do is enable the new document set in your document library. Go to our Document Library Settings Page by select the document library, click on Library Tools > Library on the Ribbon, then click on the Library Settings icon:

1

Click Add from existing site content types to add the new Document Set that we just created above. Now, go to the document library, click on the New Document link on the Ribbon. You should be able to add the new Document Set we just created into the document library:

10-12-2010 2-38-46 PM

Notice how the new Project ID, Project Manager, and Project Name site columns are now added to the common properties of the document set:

1

And the shared properties are now reflected in the Document Set folder for all documents:

1

Note:

The Document Set content type is only available in SharePoint 2010 Server, and is not part of SharePoint Foundation 2010.

See Also: