O'Reilly logo

Professional SharePoint® 2007 Development by Tom Rizzo, Adam Buenz, J. Dan Attis, Matt Ranlett, Brendon Schwartz, Eli Robillard, Jeff Julian, John Alexander, John Holliday

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11.2. Defining Metadata Using Content Types

Metadata is the fuel that drives document management in SharePoint 2007, and the best way to work with document metadata is to define a content type. There are many benefits to using content types; the main one being that content types allow us to specify the custom fields needed to manage a document as it moves through the different stages of its lifecycle.

Solution developers are used to working with classes and objects, and properties and methods, where each class defines the properties and methods for instances of that class. They then create objects to represent instances of each class and invoke methods on those objects to apply business rules that retrieve or modify the state of the properties associated with each instance. Building document management solutions will be much easier if you can map the core elements (document, metadata, repository, etc.) onto familiar abstractions like class and object that you are used to working with.

SharePoint 2007 content types provide just such an abstraction. The content type acts as a sort of document class, defining the columns and event receivers that comprise each instance. The columns are like properties, and the event receivers are like methods. Take it one step further and say that the ItemAdding event receiver acts as a constructor, and the ItemDeleting event receiver acts as a destructor for each document instance.

The first step in defining a new content type is to determine from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required