您的位置:首页 > 其它

sharepoint 自定列表总结

2013-10-24 15:54 204 查看

Elements.xml

<ListTemplate
Name="SPMeetingRoomBookingList"
Type="106"
BaseType="0"
Category="Tracking"
OnQuickLaunch="TRUE"
FolderCreation="FALSE"
SecurityBits="11"
Sequence="340"
DisplayName="$Resources:SPMeetingRoomBooking,spmrb_el_devicebookingtemplate"
Description="$Resources:SPMeetingRoomBooking,spmrb_el_devicebookingtemplate"
Image="/_layouts/images/itevent.png"/>
</Elements>


Name :用于指定List Definition的内部名称

Type : 是个 Integer类型值。提供这个List Template的唯一标识符。

BaseType :是个Integer值。用于为此List Template指定基本类型或默认架构,可以的值如下:
0 -- GenericList
1 -- DocumentLibrary
3 -- DiscussionBoard
4 — Survey
5 -- Issue

Category:指定列表所属的类别

OnQuickLaunch:在网站的“快速启动”栏中显示根据本List Template定义创建的List实例,一旦部署这个Solution,就可以在网站的QuickLaunch栏找到这个List实例。

SecurityBits:第一个数字控制读取权限;第二个数字控制编辑权限。

对于读取权限,有效的数字如下:
1 用户可读取所有项。
2 用户只能读取自己的项。
对于编辑权限,有效的数字如下:
1 用户可编辑所有项。
2 用户只能编辑自己的项。
4 用户不能编辑项。

Sequence : Integer值。指定排序优先级。

DisplayName:指定列表定义的显示名称。

Description:提供列表定义的说明

Image:指定指向用于表示列表的图标的 URL。

Schema.xml

<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="$Resources:SPMeetingRoomBooking,spmrb_el_bookingtemplate" Direction="$Resources:Direction;" Url="Lists/SPMeetingRoomBookingList" EnableContentTypes="TRUE" MultipleTypes="TRUE" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes></ContentTypes>
<Fields></Fields>
<Views></Views>
<Forms> </Forms>
<DefaultDescription>$Resources:camlidE14;</DefaultDescription>
</MetaData>
</List>


ContentTypes

直接引用

<ContentTypes>
<ContentTypeRef ID="0x01020072BB2A38F0DB49C3A96CF4FA8552995600B061BF2223438E45961A747BF356CAC3" />
</ContentTypes>


添加

<ContentTypes>
<ContentType>
<FieldsRefs>
<FieldRef id="">;
<RemoveFieldRef id=""/>
<FieldsRefs>
</ContentType>
</ContentTypes>


Fields

<Field ID="{8137f7ad-9170-4c1d-a17b-4ca7f557bc88}" Name="ParticipantsPicker" DisplayName="$Resources:SPMeetingRoomBooking,spmrb_lblparticipantsPicker" Type="UserMulti" List="UserInfo" Mult="TRUE" Required="TRUE" ShowField="ImnName" UserSelectionMode="PeopleAndGroups" UserSelectionScope="0" Sortable="FALSE" Sealed="FALSE" AllowDeletion="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="ParticipantsPicker" ColName="int5" />


ID需要我们指定,我们可以使用GUID工具来获取

Name就是我们给这个Site Column所指定的名字

Type 是这个Site Column所使用的字段类型,如下类型:

• Single line of text
• Multiple lines of text
• Choice (menu to choose from)
• Number (1, 1.0, 100)
• Currency ($, ¥, )
• Date and Time
• Lookup (looks up values from a list already on the site)
• Yes/No (check box)
• Person or Group
• Hyperlink or Picture
• Calculated (calculation based on other columns


Group属性是指我们把这个用户新增的Site Column放入到哪一个Site Column Group中.

DisplayName则是我们在Sharepoint UI上可以看到到此Site Column显示出来的名字。

这个节点包含 Schema.xml 文件中的列表定义或全局 Onet.xml 文件中的基本列表类型的字段定义,以指定在列表中实现的字段。

Default设置默认值

<Field ID="{9276C6E8-482B-44F2-806D-058305002A8F}" Name="shiping" DisplayName="$Resources:SPMeetingRoomBooking,MeetingShiping"  Type="Choice" Format="Dropdown" FillInChoice="FALSE"  SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Category" ColName="nvarchar16">
<Default>是</Default>
<CHOICES>
<CHOICE>是</CHOICE>
<CHOICE>否</CHOICE>
</CHOICES>
</Field>


views

定义List的视图

Forms

用于定义基列表类型中的表单集合。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: