Friday, 24 February 2012

Working List Defination

Elements.xml


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{9814D5C4-1A49-42A7-8229-06288E2E4C3F}" Name="ActionID" Type="Text" DisplayName="ActionID" Required="TRUE"></Field>
<Field ID="{271C7377-6800-4CD8-8120-D794BA90B023}" Name="Title" Type="Text" DisplayName="Title" Required="TRUE"></Field>
<Field ID="{FAE223E3-D53F-4886-9021-286C96728696}" Name="AssignedTo" Type="UserMulti" DisplayName="Resp" Required="False"></Field>
<Field ID="{A31215AF-BCD1-401D-899F-F6B2A7F77AAD}" Name="InitiatedDate" Type="DateTime" Format="DateOnly" DisplayName="InitiatedDate" Required="TRUE">
<Default>[today]</Default>
</Field>
<Field ID="{CFEE2340-8D7F-4BE9-8FE7-15DA5A255B50}" Name="TargetDate" Type="DateTime" Format="DateOnly" DisplayName="TargetDate" Required="FALSE">
<Default></Default>
</Field>
<Field ID="{E40F6006-2A64-43B9-B11F-BADD96C1ECCE}" Name="ClosedDate" Type="DateTime" Format="DateOnly" DisplayName="ClosedDate" Required="FALSE">
<Default></Default>
</Field>
<Field ID="{50B78056-F0B3-4B5B-B71F-DABD97E8D49F}" Name="Comments" Type="Note" DisplayName="Comments" Required="FALSE" NumLines="5"></Field>
<Field ID="{21D31AC1-2959-4794-84F5-C5C2CC48D06D}" Name="SubjectID" Type="Lookup" DisplayName="SubjectID" List="Lists/SubjectList" ShowField="SubjectID" Required="TRUE"></Field>

<ContentType
ID="0x0100A5D7A562B9B440FEBA25E181C4A3A098"
Name="ActionList"
Group="Action Content Type"
Description="Action List"
Version="0">
<FieldRefs>
<FieldRef ID="{9814D5C4-1A49-42A7-8229-06288E2E4C3F}" />
<FieldRef ID="{271C7377-6800-4CD8-8120-D794BA90B023}" />
<FieldRef ID="{FAE223E3-D53F-4886-9021-286C96728696}" />
<FieldRef ID="{A31215AF-BCD1-401D-899F-F6B2A7F77AAD}" />
<FieldRef ID="{CFEE2340-8D7F-4BE9-8FE7-15DA5A255B50}" />
<FieldRef ID="{E40F6006-2A64-43B9-B11F-BADD96C1ECCE}" />
<FieldRef ID="{50B78056-F0B3-4B5B-B71F-DABD97E8D49F}" />
<FieldRef ID="{21D31AC1-2959-4794-84F5-C5C2CC48D06D}" />
</FieldRefs>
</ContentType>

<!-- Do not change the value of the Name attribute below.
If it does not match the folder name of the List Definition
project item, an error will occur when the project is run. -->
<ListTemplate
Name="ListDefinition1"
Type="10001"
AllowDeletion="TRUE"
DisallowContentTypes="FALSE"
BaseType="0"
OnQuickLaunch="FALSE"
SecurityBits="11"
Sequence="410"
DisplayName="ActionList"
Description="My Action List Definition"
Image="/_layouts/images/itgen.gif"/>
</Elements>


Schema.xml



<?xml version="1.0" encoding="utf-8"?>
<List EnableContentTypes="TRUE" xmlns:ows="Microsoft SharePoint" Title="ActionList" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/ActionList-ListDefinition1" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x0100A5D7A562B9B440FEBA25E181C4A3A098" />
<ContentTypeRef ID="0x01">
<Folder TargetName="Item" />
</ContentTypeRef>
<ContentTypeRef ID="0x0120" />
</ContentTypes>

<Fields>
<Field ID="{9814D5C4-1A49-42A7-8229-06288E2E4C3F}" Name="ActionID" Type="Text" DisplayName="ActionID" Required="TRUE" ></Field>
<Field ID="{271C7377-6800-4CD8-8120-D794BA90B023}" Name="Title" Type="Text" DisplayName="Title" Required="TRUE"></Field>
<Field ID="{FAE223E3-D53F-4886-9021-286C96728696}" Name="AssignedTo" Type="UserMulti" DisplayName="Resp" Required="False"></Field>
<Field ID="{A31215AF-BCD1-401D-899F-F6B2A7F77AAD}" Name="InitiatedDate" Type="DateTime" Format="DateOnly" DisplayName="Initiated Date" Required="TRUE">
<Default>[today]</Default>
</Field>
<Field ID="{CFEE2340-8D7F-4BE9-8FE7-15DA5A255B50}" Name="TargetDate" Type="DateTime" Format="DateOnly" DisplayName="TargetDate" Required="FALSE">
<Default></Default>
</Field>
<Field ID="{E40F6006-2A64-43B9-B11F-BADD96C1ECCE}" Name="ClosedDate" Type="DateTime" Format="DateOnly" DisplayName="ClosedDate" Required="FALSE">
<Default></Default>
</Field>
<Field ID="{50B78056-F0B3-4B5B-B71F-DABD97E8D49F}" Name="Comments" Type="Note" DisplayName="Comments" Required="FALSE" NumLines="5"></Field>
<Field ID="{21D31AC1-2959-4794-84F5-C5C2CC48D06D}" Name="SubjectID" Type="Lookup" DisplayName="SubjectID" List="Lists/SubjectList" ShowField="SubjectID" Required="TRUE"></Field>

</Fields>
<Views>
<View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitleNoMenu"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
</ParameterBindings>
</View>
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="ActionID"></FieldRef>
<FieldRef Name="LinkTitle"></FieldRef>
<FieldRef Name="AssignedTo"></FieldRef>
<FieldRef Name="InitiatedDate"></FieldRef>
<FieldRef Name="TargetDate"></FieldRef>
<FieldRef Name="ClosedDate"></FieldRef>
<FieldRef Name="Comments"></FieldRef>
<FieldRef Name="SubjectID"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID"></FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
</View>
</Views>
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
</MetaData>
</List>


ListInstance's Element.xml


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Title="ActionList"
OnQuickLaunch="TRUE"
TemplateType="10001"
Url="Lists/ActionList"
Description="My List Instance">
<Data>
<Rows>
</Rows>
</Data>
</ListInstance>
</Elements>

No comments:

Post a Comment