Friday, November 04, 2011

Content Syndication Hubs and SharePoint 2010

Ever create a great document library, have all the columns set exactly the way you wanted to have them, and then wished you had them across the entire farm? I could just template the library, you say! Sure you could! :) So you spend the afternoon making the template, and copying it to all the sites you need. As you finish the last one and push your chair back from the desk and reach for that Snicker's bar, your boss stops by and asks how much trouble it would be to change the Comment field to a Multiple Line text field from a Single Line text field, change the Start field from a Single Line text field to a Date and Time field, and add a new field called OriginationLocation that would be a Single Line text field?

"On all those sites? By close of business today? Sure, I can get them done", you think. As you chew your candy bar, you wish you these three columns had been defined before you made that list template. Each library will now need to be changed individually or deleted and recreated with a new template. Oh well, there goes the rest of the day. How could this have been avoided? By using the Content Syndication Hub and SharePoint 2010! Let me illustrate this by rolling back the clock, and replaying this scene at MY desk.

I wander out of the elevator, eyes barely open, coffee steaming from my mug. "Wonder what today will bring," I mumble as I drop my lunch off and hang my coat up. As I enter my cubicle, I see my mohawked cubemate sitting in front of his computer, load balancing the virtual servers. "Morning!" I call out as I put my purse in the drawer, slide my ID card into my computer and enter my PIN. "Anything?" "Nope," he replies, "All quiet." "Good, I think," as I settle down and open up my browser. I click open a few tabs. First, I hit Central Admin, then I hit my CSH - Content Syndication Hub.

New custom content type - I pull out the list of fields needed. There are 23 fields needed. No problem. On the Content Syndication Hub, I go to Site Actions->Site Settings->Site Columns. From here I look at the columns I need to make. Hmm. Six of these are going to be hidden columns used only for transferring data by a console app being written by one of our developers. No one by he and I will see them. I think I will cluster them together in a group called TFR Columns so that they are easy to find. I create each one as a custom site column and make sure that the column type is TFR_Column. I mark each one as Hidden. Okay, six down.

What else do I have? Ten are related to Finance and will likely be used again for other Finance libraries, better put them in a cluster too. I create each one of those and make sure that the column type is Finance. Sixteen down and seven left to go. Those are just generic custom columns. That'll do for them.

Now that I have created all the needed columns, it is time to make my content type. I go to Site Actions->Site Settings->Site Content Types. I give my new Content Types its name - MN Document, based on the regular Document content type. Then I "add from existing site columns" and add all of the columns that I just created. Then I Manage Publishing for my content type, and click the Publish so that my content type will be sent the next time content types are published. Great now to actually publish it.

Over to Central Administration, I go to Monitoring->Timer Jobs and I run the Content Hub and the Content Subscriber jobs. Now, all the sites that are on those web applications have access to my new Custom Content Type - MN Document!

I go to each of my site collections, go to advanced settings, enable content management, and add my new content type, add it to the libraries where it is needed (and delete the plain document content type if I want the new content type to be the only one in the library.) I am done.

As I push my chair back from the desk and reach for my tea bags, intent on a nice hot cup of cranberry-fennel tea, my boss stops by and asks how much trouble it would be to change the Comment field to a Multiple Line text field from a Single Line text field, change the Start field from a Single Line text field to a Date and Time field, and add a new field called OriginationLocation that would be a Single Line text field?

"On all those sites? By close of business today? Sure, I can get them done", I say, "No problem. I will have it done in 30 minutes. Just let me grab a cup of tea." I saunter into the kitchen and pour boiling water over my tea bag and honey. I watch as the bright red color swirls out of the bag and into the water. Mesmerized, I just stand there for a moment, then I remember that I have work to do. I walk back to my desk and put my ID card back into the computer and log my PIN back in, and switch back to the Content Syndication Hub. I click on my new custom content type, MN Document. I make the changes my boss mentioned. After checking them over, I click on the Manage Publishing for my content type, and click the Republish option.

I go back to Central Adminitration, and head back to the timer jobs. I rerun the Content Hub and the Content Subscriber jobs. Then I refresh the browser that has my first library. Sure enough, the changes to my content type are showing. I check each library on each site that is using my MN Document. Yep, all of them are now showing the change. Well, that was easy.

My tea has now fully steeped and the flavor is at its best. I lean back and take a big sip. My update is done; I should probably send my boss an email. You know, let him know I am done. Well, it can wait until I am done with my tea.

No comments: