2

I am studying List Definition in sharepoint 2010.I have two files one schema.xml and another elements.xml

elements.xml

<ContentType ID="0x0101005CF0DB5B6075417a8664EFD23835C831"
           Name= "SCORM Content type"
           Group="Solutions" V2ListTemplateName="doclib" BaseType="0x0101"
           Description="This is the Content type for SCORM Library."
           Version="0">
    <FieldRefs>
<FieldRef Name="CourseName" ID="{B0884BE9-EE9D-4ae0-97E7-67AA0902A7FA}" />
</FieldRefs>
</ContentType>
   <ListTemplate
    Name="doclib"
    Type="1116"
    BaseType="1"
    OnQuickLaunch="FALSE"
    SecurityBits="11"
    Sequence="110"
    DisplayName="SCORM Library"
    Description="Library to store SCORM courses."
    Image="/_layouts/images/itdl.png"
    NewPage= "SL/Pages/XSLnew.aspx"
    Category="Libraries"
    DocumentTemplate="101"/>

Schema.xml

<ContentTypes>
  <ContentTypeRef ID="0x0101005CF0DB5B6075417a8664EFD23835C831">
    <Folder TargetName="Forms/Document" />
  </ContentTypeRef>
  <ContentTypeRef ID="0x0120" /> 
</ContentTypes>

 <Fields>    
 <Field ID="{B0884BE9-EE9D-4ae0-97E7-67AA0902A7FA}" Type="Text" Name="CourseName" DisplaceOnUpgrade="TRUE" DisplayName="Course Name" XName="TemplateUrl" Filterable="TRUE" Sortable="TRUE" Hidden="FALSE" FromBaseType="TRUE" PITarget="mso-infoPathSolution" PIAttribute="href" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="CourseName"/>
 </Field>
  </Fields>

why we are adding ContentTypeRef? why its ID is 0x0120?why Type="1116" in ListTemplate?

1 Answer 1

3

Separating each question.

Your Id of the <ContentTypeRef ID="0x0120" /> specifies a reference to a content type to associate with the lis you are creating through the list definition. In particular, you are telling to associate Folder Content Type.

By the other hand in the Elements.xml, type="1116" is wrong because doesn't exist (take a look here

If you want to add a Document Library you should write type="101"

This is the list of tpyes for ListTemplate Element

GenericList Custom list. Value = 100.

DocumentLibrary Document library. Value = 101.

Survey Survey. Value = 102.

Links Links. Value = 103.

Announcements Announcements. Value = 104.

Contacts Contacts. Value = 105.

Events Calendar. Value = 106.

Tasks Tasks. Value = 107.

DiscussionBoard Discussion board. Value = 108.

PictureLibrary Picture library. Value = 109.

DataSources Data sources for a site. Value = 110.

WebTemplateCatalog Site template gallery. Value = 111.

UserInformation User Information. Value = 112.

WebPartCatalog Web Part gallery. Value = 113.

ListTemplateCatalog List Template gallery. Value = 114.

XMLForm XML Form library. Value = 115.

MasterPageCatalog Master Page gallery. Value = 116.

NoCodeWorkflows No Code Workflows. Value = 117.

WorkflowProcess Custom Workflow Process. Value = 118.

WebPageLibrary Wiki Page Library. Value = 119.

CustomGrid Custom grid for a list. Value = 120.

SolutionCatalog Solutions. Value = 121

NoCodePublic No Code Public Workflow. Value = 122

ThemeCatalog Themes. Value = 123

DataConnectionLibrary Data connection library for sharing information about external data connections. Value = 130.

WorkflowHistory Workflow History. Value = 140.

GanttTasks Project Tasks. Value = 150.

Meetings Meeting Series (Meeting). Value = 200.

Agenda Agenda (Meeting). Value = 201.

MeetingUser Attendees (Meeting). Value = 202.

Decision Decisions (Meeting). Value = 204.

MeetingObjective Objectives (Meeting). Value = 207.

TextBox Text Box (Meeting). Value = 210.

ThingsToBring Things To Bring (Meeting). Value = 211.

HomePageLibrary Workspace Pages (Meeting). Value = 212.

Posts Posts (Blog). Value = 301.

Comments Comments (Blog). Value = 302.

Categories Categories (Blog). Value = 303.

Facility Facility. Value = 402

Whereabouts Whereabouts. Value = 403

CallTrack Call Track. Value = 404

Circulation Circulation. Value = 405

Timecard Timecard. Value = 420

Holidays Holidays. Value = 421

IMEDic IME (Input Method Editor) Dictionary. Value = 499

ExternalList External. Value = 600

IssueTracking Issue tracking. Value = 1100.

AdminTasks Administrator Tasks. Value = 1200.

HealthRules Health Rules. Value = 1220

HealthReports Health Reports. Value = 1221

8
  • for adding document type we have to add DocumentTemplate="101" in ListTemplate tag.From my limited knowledge 1116 is a new type of list definition we are creating.Is this correct?
    – anish
    Oct 9, 2013 at 6:44
  • Right. With this number (1116) you are creating a Custom List definition but not a document library. My recommendation is to begin from 10000
    – Alvmad
    Oct 9, 2013 at 6:47
  • Method i followed is to create a custom list definition from document library list template.Is my thoughts right?
    – anish
    Oct 9, 2013 at 6:51
  • If you want the same behaviour that a Document Library you should modify your type by 101 instead of 1116 but your method is right
    – Alvmad
    Oct 9, 2013 at 7:01
  • 1
    There is no difference. Each attribute is used for different scopes. In fact DocumentTemplate is only used when BaseType="1" The base type represents the default schema, for lists created from the definition: 0 -- GenericList, 1 -- DocumentLibrary, 3 -- DiscussionBoard, 4 -- Survey, 5 -- Issue
    – Alvmad
    Oct 9, 2013 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.