A.4. Using VSeWSS to Build Content Types

A content type is analogous to a class in object-oriented programming, and it's a major addition to SharePoint 2007. Content types allow the definition of a data diagram with associated metadata (columns), workflows, event receivers, and associated SharePoint listform pages. Although you can define content types directly on a SharePoint site via your browser, on the ctypenew.aspx page VSeWSS offers an Item Wizard that enables you to build and deploy more complex content types. (See Figure A-4.)

The first step is to define a parent, or base, for the new content type (see Figure A-5).

Figure A.5. Figure A-5

The new content type will then inherit the base ancestral attributes of its parent, such as whether the content type is a list type or a library type. Here is a list of parent content types supported by VSeWSS:

  • Announcement

  • Contact

  • Discussion

  • Document

  • Event

  • Folder

  • Issue

  • Item

  • Link

  • Picture

  • Task

  • WikiDocument

  • XMLDocument

Once the new content type is defined, it can be used as the parent for further derivations. This is handy, because you can then easily propagate attributes from parent to child in what OO programmers call an "inheritance tree." Furthermore, updates to parent content types can be propagated to derived child content types through update operations.

A.4.1.

A.4.1.1. Building the Custom Content Type

When building a new content type, the ...

Get Professional SharePoint® 2007 Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.