Tuesday, 17 July 2012

Difference between List Definition, List Template and List Instance in SharePoint 2010


 List Definition:

A list definition defines a schema for a SharePoint list. It contains information on what views are being used, which columns and content types are being used, and other metadata information.

List Template:

A list template can either be created by end users through the SharePoint user interface using an existing list as a pattern or using an existing list instance. If based on a user-created list it is called a custom list template. A custom list template includes everything that defines the list, including list columns and site columns used by the list, content types used by the list, views defined for the list, and so on.

Tips

A list template may sound like a list definition but they are effectively the same thing, a pattern for a SharePoint list. They differ mainly in how they are created:
- A list templates are created in SharePoint or SharePoint designer.
- A list definitions in Visual Studio.

List Instance:



The ListInstance element specifies default data with which to provision the given list type

This element maps to the Listelement previously located within the Configuration element in Onet.xml.

The following example shows the contents of an XML file in which the ListInstance element is used to specify default data for a list instance.


<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   <ListInstance 
      Id="WssAdminTasks" Title="Administrator Tasks" 
      Description="Create an Administrator Tasks list to track a group of admin work items."
      TemplateType="1200" Url="Lists/AdminTasks">
      <Data>
         <Rows>
            <Row>
               <Field Name="Action">/_admin/globalemailconfig.aspx?Source=/default.aspx, Configure Outgoing E-Mail Settings</Field>
               <Field Name="Description">Specify the SMTP e-mail server to use for alerts and administrator notifications.</Field>
               <Field Name="Title">Outgoing e-mail settings</Field>
               <Field Name="SystemTask">True</Field>
               <Field Name="Priority">01</Field>
               <Field Name="Service">SMTP</Field>
            </Row>
         </Rows>
      </Data>
   </ListInstance>
</Elements>

No comments:

Post a Comment