Publish and Subscribe to Content Types in SharePoint 2010

Content Type Syndication is new feature that is part of the Managed Metdata service in SharePoint 2010. It solves a long-standing problem from SharePoint 2007, which is how do I create an enterprise library of content types and synchronize them amongst many different site collections. We often had to design and build solutions to work around this issue in SharePoint 2007, but now we have something that we can use out of the box. It's may not seem super intuitive in terms of setting this little gem up though, so use this posting as a guide to get you moving in the right direction.

The first thing you should do is set up a site collection that will be your uber store for content types in your enterprise. You can stray off this path and get into scenarios where you can use multiple site collections, but it's a significantly more involved process than we're going to cover today. So let's start with the basic case and say we are going to create a new site collection at https://o14. In it we're going to create three new site columns called Product Name (Single line of text), Product Description (Single line of text), and Product ID (number). Next we'll create a new content type called Product, and we'll add our three site columns to it.

Now we need to configure the Managed Metadata service application to let it know that it should be using our site collection as the hub of content type syndication. To do this, go to Central Admin and click on the Manage Service Applications link in the Application Management section. In the Manage Service Applications page you will find all the instances of Shared Service Applications that have been created in the farm. For purposes of this posting, we'll assume that you only have one instance of the Managed Metadata Service. Click on the Managed Metadata Service entry, and then click on the Properties button in the ribbon. In the properties for this service, scroll all the way to the bottom and you will see an edit box titled "Content Type hub:". Go ahead and type in the Url to the hub site collection we created for this posting: https://o14/. Also, I STRONGLY recommend that you check the box directly below it to report syndication import errors. Click the OK button to save your changes.

Now, we also need to configure the Managed Metadata service proxy for syndication. Describing what a Shared Service Application proxy is falls outside the scope of this posting, but perhaps I will cover it in a different one. It is the entry directly below Managed Metadata Service. Click on it, and then again click on the Properties button on the ribbon. Make sure you don't click on the name itself, which is a hyperlink and will take you to the term store. Just click on the row beside the name so you stay on the page and can click the Properties button. When the Properties dialog appears, you need to check the box that says "Consumes content types from the Content Type Gallery at https://o14/.", then click the OK button.

Now, if you go back to your hub site collection, and go into Site Settings and examine your "Product" content type, you'll see a new menu item in the Settings section titled Manage publishing for this content type. Go ahead and click on that link. When the publishing options page appears, make sure you check the Publish radio button then click the OK button. Now you are set to start pushing this content type out!

For your next step, create a new site collection. For our sample we'll call it https://o14/sites/mytypes. Now in our example, both site collections are in the same web application. At the web application level we're using the Managed Metadata service proxy that is going to push these content type changes out to every site collection that uses this service. So, the thing to remember here is that if you want to use this site collection in other web applications, you need to make sure that those web apps are using the same Managed Metadata service proxy.

Okay, so you go into the Site Settings for the new site collection and you don't see the Product content type - why not? Well, there are some timer jobs that need to run in order to push that content across. One timer job finds all the new content types that need to be pushed out, and another timer job actually grabs those content types and pulls them into the site. To help speed things along, go into Central Admin, click on the Monitoring section, and click on Review job definitions in the Timer Jobs section. There will be lots of jobs in there, but the first one we want to look for is the Content Type Hub job. When you find it (you may have to page through the jobs to get it), click on the job name to bring up the job properties page. In SharePoint 2010 we now have a "Run Now" button, so go ahead and click it to run the job. You should now be back at the list of jobs.

The next job we want to find will pull the content types down and is called Content Type Subscriber. Again, as I mentioned above these services can be associated with one to many web applications. You will find one instance of this job for each web application that is using the Managed Metadata service proxy. Find the job that is associated with the web application in which you created your site collections, click on it, and click the Run Now button. Give it a few seconds to complete, and now when you go into your second site collection you should see the Product content type. Nice work - you've done the really hard stuff.

Now the obvious question is okay - so how do I make updates to this content type? That really is one of the nicest parts of having a content type subscription after all. Okay, so here's what we'll do. Go back into your hub site collection and add another Site Column called Support Contact (Single line of text), then add it to your Product content type. Now, click on the Manage publishing for this content type link again. This time, click on the Republish radio button and click the OK button. To see your changes move across, run the timer jobs described above, and you should see your changes appear in your second site collection.

When things don't go right, you'll want to check the Content type service application error log. You will find this in Site Settings under the Site Collection Administration section. It is pretty good about logging errors and doing so in a verbose enough way that it can usually give you a pretty good idea of where a problem might have occurred.

Special thanks to Darin Roulston for helping me iron out some of these procedures - thanks Darin! Hope you folks enjoyed this and can go out and use this great new feature in SharePoint 2010.