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

A.5. Building a Custom Content Type Using VSeWSS

The content type that the policy management site will use will have several custom fields defined that will appear in the available site columns' page after they are provisioned (see below table). Each of the fields that is being created will be referenced by the content type in the <FieldRefs> node (See Listing A-6) by using the ID and Name that is provided within the <Field> element of in Policies.Field.xml (see Listing A-7). When you define the content type using VSeWSS, it will generate the contenttype.xml and the contentype.fields.xml file, already providing a sample field element that can be used as a boilerplate for further field integration.

Element Field (Column) NameField (Column) TypeField Description
Policy IDNumberRelevant Policy ID
Policy NameSingle Line of TextFriendly Policy Title
Effective Policy DateDate and TimeDate of Policy Enforcement

The following code defines the policy library content type with the ancestral attribute of the content type (0x0101, in this case, specifying a document library), the content type description attributes, the content type references to the three custom fields as defined by the Policies.Field.xml (see Listing A-7), and associated SharePoint listform pages for interacting with the policy library (see Listing A-6).

Example A.6. Policies.xml (policies content type)
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!--document library ancestral ...

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