Before getting into the details of content type hub let us
take a step back and think why content type hub is introduced and what was
available in MOSS 2007.
Let us say you have created a content type in web application
1 and now you need to reuse that content type in web application 2.
so here you
do not have any options other than recreating the same content type in another
web application 2 when we worked with MOSS 2007.
But now with SharePoint 2010 we can create one specific web
application which serves as a content type publisher and other web applications
consumes those content types as a consumer from the main web application which
is considered as a content type hub.
So content type hub is nothing but a dedicated web
application which contains all the content types that want to reuse across many
web applications and serves as a hub - the publisher.
Content type hub publishes and other web application
consumes.
The advantage is you can make a change in content type at
the hub level and you can push down those changes at all the web applications
where they are consumed.
Let us see it in action how we can create content type hub
and how we can consume it from the web application.
We first need to create web application and top level site
which will serve as a publisher content type hub.
Now click on the manage service applications in applications
management.
Locate for managed metadata service and click on properties.
Scroll down and enter the site collection URL that you have
just created.
Now come back to the previous screen and this time select
the managed metadata service connection. This is listed just below the option
which you selected earlier and then click on properties again.
and this brings to
the screen where you need to select all options.
Now let's get back to the site collection site that we have
created earlier - the content type hub site collection.
Open the site in browser, go to the site settings then
galleries and sites content types.
Create one content type. I
have one content type called order.
Now check for an option manage publishing for this content
type on content type settings page.
Publish must have selected by default, click on ok button. as you can see right now
last publish date is empty.
You can go back and check the publish date. It must be set
this time.
Now we need to move our eye to timer jobs. There are two
times jobs of interest.
1) Content Type Hub
2) Content Type Subscribe
Go to monitoring - timer job definition
As you can see you have one content type hub timer job which
is for the publisher and you have other subscriber timer jobs for all web
applications which can subscribe / consume that hub.
So go ahead and click on hub, click on run now. Click on the
respective subscriber for web application from where you want to consume the
content type, click on run now.
Again make a note that we are doing this manually only
because we want to see the immediate change.
Now let's go to a site collection of consumer web
application.
Go to a site settings and then to site content type.
You will see the content types from content type hub
appearing here and can be used throughout web application.
Go back to the content type hub, add one more site column.
call it price. keep update all content type inheriting from this content type
checked.
Now go to the content type settings page. again click on
manage publish for this content type. this time you would find republish
button. Click on republish.
go ahead and run those two services again.
Go back to the consumer site collection and see that new
column is also appearing in the list.
I hope this helps and you now have fair understanding of
content type hub.
No comments:
Post a Comment