Showing posts with label Content types. Show all posts
Showing posts with label Content types. Show all posts

Saturday 31 May 2014

Content Type Hubs - Thoughts on running Global Content Types for an Enterprise - Part 1

Rough Notes - Publish once cleaned up

Problem: Content Types are a misunderstood and often underutilised set of functionality for syndicating metadata.  Management of the syndication's and ramifications of decisions often lead to unpleasant scenarios.

Notes:  Not a lot has changed between SP2010 and SP2013.

General if you need to reuse a content type in more than 1 site collection it is a good candidate to go into the content type hub.

It is a good idea to ensure that each DTAP environment has identical Content Types in the Content Type Hub.  Concept Search has a product that synchronises Content type across env.  So changes made in production can be pushed to pre-production and then onto your UAT environment.  Writing code to do this is fairly simple.

Concept Search is a third party solution designed to auto-classify content that’s dependent on metadata in the MMS Term Stores.

If is a good idea to have a service owner for Content Type across the enterprise, as this role is very closely related to the Taxonomy/Term store, it is a good idea for this service owner to manage both of the MMS relevant functions. 

A good break down is to work out what the required columns on all data is and this improves search considerable.  For example all document should have a country.  This could be a Term Set with Global, regions (e.g. EMIA), countries (e.g. United Kingdom) and provinces/states (e.g. )  allow each document to be tagged to a country.

I like to group Global Content Types into 2 or 3 layer namely (Enterprise CT's, Division Specific CT's and application specific CT's).  The CT's created in any of these layers inherit from the layer above.  For example, all our documents have an additional field country that applies to all documents (Enterprise global CT), at a division Marketing (A marketing medium media e.g. Newspaper) is appended.  Lastly in our contrived example we have built a specific application for tracking our marketing and this would add the fields (product Type, Audience age range) shall be added.  This allows for consistent tagging/metadata of data within an enterprise.

A good example of search working with meta data is not on the enterprise search you can add a filter on country and allow folks to easily filter down to country specific documents quickly.

How it works:
  • Site Collections can subscribe to CT in the CTH
  • CTH is a site collection
  • Site Collection consume the CT's in the CTH
MMS Term Groups are closely related to the Content Type Hub:




Wednesday 3 November 2010

Reverse Engineer Lists, Content Types and Site Columns and retrieving the CAML

Problem: You need to create deployable lists, this should be done using a feature.  You can create a lists using the UI and then get the CAML that created the list.  The code will have some hicups but it a good place to start for building your Lists based on List definitions, content types and their corresponding site columns.

Resolution:
Get the CAML and create your feature based on the declaritive CAML
http://%7bwebapplication%7d/%7Bsite%7D/_vti_bin/owssvr.dll?Cmd=ExportList&List={ListGuid}
Thanks to Sahil Malik

Read More:
http://blah.winsmarts.com/2008-2-Dev_Tip__The_SharePoint_University_of_Reverse_Engineering.aspx
http://www.synergyonline.com/blog/blog-moss/Lists/Posts/Post.aspx?ID=24

Download: SharePoint 2010 sandbox project example that creates 2 lists with a lookup field. Updated 24/03/2011


Wednesday 27 October 2010

Creating a lookup list & project field lookup using a declaritive content type

Problem: Create a list that has a lookup column and a projected field from the lookup column.
Example:
  • Some code I used to create a lookup column (Agency ID) in a list and a field to be brought in from the lookup list also (AgencyName)
  • This should be plugged into the new list's content type (AgencyContact).
  • The column being brought across also (Agency Name) needs to reference the GUID of the lookup column it relies on (Agency ID) using FieldRef.
Thanks to Paul W

Thursday 26 August 2010

Creating lookup columns and list declaratively in SP2010

Problem: When creating lists via a feature, you may want to link SharePoint 2010 lists.
Initial Hypothesis: In MOSS to link to SharePoint 2007 lists you had to do it via the UI or via a deployable feature.  The list was created declaratively using XML (CAML).   Lastly the lookup column needed to be created using a feature receiver.  As in MOSS, in SP2010 you can create a lookup column using the UI but this is not a reusable deployment method and falls prey to errors.  SP2010 allows you to create lookup lists using declarative CAML.

Resolution: Create the lists, add site columns (fields), then add the site columns to a content type and lastly generate the list definition & list instance.  Steps are detailed below:
  • In an elements file declaratively create a lookup column that uses the specified list as shown below: 

  • Add the new lookup column to a content type:
  • Your existing/create a list definition that derives from your content type.
Note: The Lookup Site column needs to specify the list it is looking up when you declare the XML.
More Info:
Creating lists declaritively in SP2010 - Post outlines creating SharePoint lists, coupled with this post you can create lists that are related using a feature to create your lists.
Available field types

Monday 16 August 2010

Using PowerShell to retrieve SharePoint site column guids

Problem: I am creating a Content Type that uses 1 of the built in site columns (field column), I need the guid of a OOTB site column.  I am looking to use the OOTB "Append-Only Comments" site column.
Resolution: Open PowerShell and execute the cmd:
$web = Get-SPweb http://demo1
write-host $web.Fields["Append-Only Comments"].Id

Tip: Don't add xml comments into declaritive content type creation, it stops the activation without any warning.