Understanding Custom List Definitions in SharePoint.
Views (119)
For creating Custom List Definitions through Feature as a Provisioning Component, we need to create our Feature.xml file that would be pointing to element.xml having our List Definition.
The feature file would be something like this
<?xml version=“1.0“ encoding=“utf-8“?>
<Feature Id=“00BFEA71-DE22-43B2-A848-C05509900111“
Title=“My Custom List Feature“
Description=“This is a custom list feature“
Version=“1.0.0.0“
Scope=“Web“
Hidden=“TRUE“
DefaultResourceFile=“core“
<ElementManifests>
<ElementManifest Location=“elements.xml“ />
</ElementManifests>
</Feature>
The elements.xml would contain the following information
<?xml version=“1.0“ encoding=“utf-8“?>
<ListTemplate
Name=“CustomList“
Type=“10001“
BaseType=“0“
Sequence=“2000“
DisplayName=“My Custom List“
Description=“Creating a custom list“/>
</Elements>
Element manifest contains ListTemplate element.
Name – Name of the List. One important thing about Name attribute is that there must be a directory with the same name as value of this attribute within the feature directory which would contain schema.xml. All the information for the list would be defined in the schema.xml.
Type – List Type Identifier, for custom list types the value should be more that 10000.
BastType– Value 0 indicates that this list type is for standard list. ( 1- Document library, 3-discussion forums, 5- issue lists)
Sequence– It defines where the link would appear for the list type on the Create Page.
So we would have a folder for feature say My Custom List, this folder feature would have feature.xml,elements.xml and one more folder with name CustomList ( same as Name attribute value at elements.xml) . The CustomList folder contains schema.xml.
Schema.xml would be defining the content types, fields within the content types, views and forms for the list.
This is the basic structure of Schema.xml
<?xml version=“1.0“ encoding=“utf-8“?>
<List Title=“My Custom List“ Url=“Lists/CustomList“ BaseType=“0“>
<MetaData>
<ContentTypes></ContentTypes>
<Fields></Fields>
<Views></Views>
<Forms></Forms>
</MetaData>
</List>
In content types, we could add reference to standard as well as custom content types.
Fields- Here we need to include all fields for our referenced content type.
Views- Defining different views for the list.
Forms – We could associate our custom New, Edit or Display form. If not specified than default forms would be used.
Bye…
Posted in MOSS, SharePoint
This was originally posted here.

Like
Report
*This post is locked for comments