A.6. Using VSeWSS to Build List Definitions

VSeWSS allows innovative ways to manufacture List Definitions. You can create a new List Definition from scratch, also known as an explicit list, where only a list base type needs to be defined for VSeWSS to assimilate. You can also instantiate a new List Definition from a custom content type. If you instantiate a new list, you can consume the policy content type that was just created in order to build a new list, a very powerful feature for SharePoint development. When building a List Definition from a previously created content type, the content type you wish to base the list on is the only supplied argument (see Figure A-6).

Figure A.6. Figure A-6

The most important noticeable code difference between an explicit list and a List Definition based on a content type is located within the major definition file, schema.xml. The generated schema.xml file will define list information, such as fields and views, along with other granular list data. When building a new List Definition from an existing content type, under the <ContentTypes> parent element, in the <ContentTypeRef> child element, a reference is built into the content type GUID (see the following code).

<!-- GUID defined with the custom content type generator from VSeWSS -->
<ContentType ID="0x010100966c882da1884476bbfff3e10bbedfbb" /> <!-- Reference to custom content type GUID ...

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.