SharePoint 2010 获取列表全部定义方法

  http://spf06/_vti_bin/owssvr.dll?Cmd=ExportList&List=%7B220128F0-6084-45B3-9942-C29B3AF6663C%7D

  注:spf06为SharePoint网站,List=后面的字符串为想要得到的列表的GUID。

  如何获得指定列表GUID:

                

  点击:列表设置,查看浏览器地址栏中列表的GUID

                

  然后访问准备好的地址,会弹出保存owssvr.xml文件,直接在浏览器中打开,会看到如下文件:

  

 <View Name="{C539A61B-7C39-4008-81F2-DC794766301E}" DefaultView="TRUE" Type="HTML" DisplayName="相关列表名称" 
  Url
="Lists/MaterialInquiryListDetail/View1.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/generic.png"> - <ViewFields> <FieldRef Name="Attachments" /> <FieldRef Name="LinkTitle" /> <FieldRef Name="Project_ListName" /> <FieldRef Name="MaterialStandard" /> <FieldRef Name="Unit" /> <FieldRef Name="GclNumber" /> <FieldRef Name="Remarks" /> <FieldRef Name="SuggestedPrice" /> <FieldRef Name="Pricing" /> <FieldRef Name="ID_Two" /> <FieldRef Name="ListDetailState" /> <FieldRef Name="RejectionReason" /> </ViewFields> - <Query> - <GroupBy Collapse="TRUE" GroupLimit="30"> <FieldRef Name="Project_ListName" /> <FieldRef Name="RejectionReason" /> </GroupBy> - <Where> - <Eq> <FieldRef Name="ListDetailState" /> <Value Type="Text">退</Value> </Eq> </Where> </Query> <Toolbar Type="Standard" /> <XslLink Default="TRUE">main.xsl</XslLink> <RowLimit Paged="TRUE">30</RowLimit> - <ParameterBindings> <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" /> <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" /> </ParameterBindings> </View>

  这个文件我们可以看到关于这个列表和有关这个列表的视图等非常有用的配置信息。这个文件对在程序里创建视图非常有用,只需要手动创建相应视图,然后通过得到这个文件得到相关信息,最终实现同样的视图等信息。

 

posted @ 2013-08-27 20:08  浪漫的宿命  阅读(424)  评论(0编辑  收藏  举报