Cannot use SharePoint feature to deploy content types using content type hub functionality when using XML elements

*** Update 11/05/11 ***
Over the last few weeks I have been contacted regarding this post and had contradicting reports that you are in fact able to create a feature to deploy content types to a content hub without the need for the feature to be enabled on each subscribing site collection.
My original issue experienced was also replicated by others once I’d posted this issue so this seems a strange one as since both of us are unable to recreate the issue.
Upon retesting the issue I can confirm that you are able to deploy a feature to a content type hub without the need to enable the feature on subscribing site collections.
Thanks to Chakkaradeep Chandran for following up on this and feeding back his findings.
*** Original Post ***
I’ve recently stumbled across a restriction of using the content type hub in SharePoint 2010 and I am a little surprised by its behaviour. From a quick search around there was very little discussing this so thought I’d post a blog on my findings.
So the plan was to leverage the new content type publishing feature in SharePoint 2010 alongside programmatically deploying site columns and content types using a feature to simplify deployments. Admins and developers of MOSS 2007 will recall that to deploy content types to multiple site collections easily required a feature creating with the necessary customisations. A downside to this was that every time you needed to update the content type you had to redeploy the feature with the updates.
An assumption on my part with the new SharePoint 2010 hub was that when you create a feature to deploy content types all you needed to do was to enable that feature on the content type hub and publish this out to subscribing site collections. Unfortunately it doesn't seem to work this way as subscribing site collections do not receive the published content types and looking at the error log on the receiving site collection states that it it requires the custom content type feature to be enabled which defeats the object as we will be back to the MOSS 2007 scenario mentioned above.
So some thoughts around options available to use to deploy content types to the content hub for successful publishing:
  • Raise it with Microsoft
  • Create a PowerShell script that can receive a maintainable XML input file to update the content types on the hub.
  • Not sure if this is possible but if the feature could be enabled on the subscribing site collection and have a dependency on the ‘Content Type Hub’ feature before deploying the content types.
Thanks to Chris O’Brien for confirming this for me on Twitter. As always I welcome your comments / feedback / findings on this.
*** Update 30/11/2010 ***
After posting my blog entry a great SharePoint community member Nick Hadlee posted a comment with his initial thoughts / frustrations and kindly shared further finding’s based on a quick test he carried out.
So to explain further the way the feature I described above was deployed was using an XML file which requires no code.
Nick pointed out that if you created a code based deployment of the content types using a feature receiver this works. This is effectively the same as using the UI to enter content types / columns.
So to conclude there is a workaround to deploy content types using a feature however this requires coding rather than the XML format.
I did have a thought around enabling the feature on all site collections and then seeing if any updates from the Hub were published however I’m sure this will get messy in the long run as updates and changes are applied.
Credit to Nick Hadlee for his input and also my client who I’m currently working with who has helped in investigating this.
*** Update 10/01/2011 ***
Nick Hadlee has thankfully posted his workaround which can be found here. Again thanks Nick for following this up and hope its useful.

13 comments:

Nick Hadlee said...

I read that title and then the article with my mouth agape.

I think this has some really bad implications on how Document Management solutions can be designed for SharePoint 2010. I would love to know what Microsofts recommendations are around the use of features/solutions and the Content Type hub...

Thanks for sharing Paul but I wish you were sharing better news.

Paul Grimley said...

@Nick thanks for the feedback - comments always welcome, sorry it wasn't the news you wanted but better to know it than not!

Nick Hadlee said...

Hi Paul - Absolutely agree its better to know what limitations we have to work with. This has intrigued me so Ive just done some minimal/rapid testing.

Results-so-far: I managed to get the content type publishing to work with a feature if the feature creates a content type via the features event receiver/OM.

This still isn't as nice as declarative XML however I like the idea of at least being able to keep everything within a feature. Have you tried this option?

Paul Grimley said...

Thanks Nick, updated blog to reflect your comments

Ashkan Jabbari said...

Thanks for sharing Paul, after this I am struggling to see the value of using Content type hub; after all, all it does, is to create a cab package ready for a timer job to do the sync and it only sync associations, not the actual components (e.g. workflow)

since any update needs to be applied to the original wsp package and redeployed, there is nothing stopping you redeploying the solution to all site collections....

Paul Grimley said...

@Ashkan I too am struggling with the lack of functionality with the content type. Nick (Hadlee) tells me he has a hybrid solution which I'm looking forward to hearing more on. Hopefully this can relieve some of the frustration at this apparent shortfall.

Nick Hadlee said...

Hi Paul - Sorry it took a bit of time to get my post written but I finally got it done. http://nickhadlee.wordpress.com/2011/01/08/making-features-that-deploy-content-types-compatible-with-the-content-type-hub/

Paul Grimley said...

Thanks Nick, added link to your blog from the main body.

Chakkaradeep Chandran said...

Hi Paul,

I am able to successfully deploy and publish content types via WSP packages, whether using CAML or server object model or client object model. I can also confirm that others who have tried the same can also publish the same.

I think in your case, there might have been some other dependencies that might have stopped you from publishing content types deployed via feature.

More here - http://blogs.msdn.com/b/chaks/archive/2011/02/09/content-type-hub-limitations.aspx

Paul Grimley said...

Hi Chakkaradeep

I've recently been speaking to Nick (Hadlee) about this and he mentioned he couldn't replicate this issue that both he and I discovered back in November last year.

I'm interested to know what CU level you are successfully able to deploy using WSP's and the CT Hub as I recall the above blog issue being tested against August 2010 CU.

Nicks testing was also independant of mine as well so I'm wondering whether a fix has been released in a later CU.

Thanks
Paul

Chakkaradeep Chandran said...

Hi Paul,

Mine was a clean install - no CUs - just fresh install.

Thanks,
Chaks

Paul Grimley said...

Hi Chaks

I've managed to get some time to re-test the scenario and can confirm I no longer receive any issues and the content types publish no problem. I have updated my blog accordingly and thank you for your feedback and findings.

Many Thanks
Paul

David said...

Hi Chaks,

I'm attempting to deploy my content types to my hub and syncronize to subscribing sitecollections in the same web app. I'm getting different results in different environments. One syncs just fine w/out issue. two others have pre-sync issues with half of the content types. Was there a solution that you found to get this working consistently?

Currently running build: 14.0.6109.5002

Thanks,

David

Post a Comment