Sharepoint学习笔记---如何找到SharePoint List的Template ID
?我們可以利用Visual Studio2010結合owssvr.dll來找到我們指定的Sharepoint List所使用的Template的ID值。
? OWSSVR.DLL實際上是一個在IIS中注冊了的ISAPI extension, 它的方法可以直接通過對/_vti_bin/owssvr.dll的Http訪問來調用. 許多Office應用程序(Word, Excel, InfoPath, SharePoint Designer等)就是通過對OWSSRV進行直接的http調用才完成于SharePoint服務器之間的遠程整合,而此處我們則要用到它來實現尋找Template ID的目的。
? 具體步驟如下(我們以確定某個WebPart Gallery的List的Template ID為例):
? 一、使用Visual Studio2010確定List 的ID
在Visual Studio的Server explorer,新添加一個SharePoint connection,令此連接指向你的Sharepoint網站,eg?? http://sp2010/.此Server explorer會給你顯示出這個Sharepoint Farm的全部結構。雖然其內容是只讀的,但對我們而言已足夠了。在此結構內,找到我們需要的Sharepoint List(此處是一個Webpart Gallery),顯示出它的Properties,在右側的屬性欄,找到ID的值(eg:9f7d064f-d9s8-62f1-8a4f-b02c9f4c259k),Copy下來備用。
?
? 二、使用OWSSVR.DLL確定Template 的ID
? 根據前面取得的List ID,使用OWSSVR來取得其Template的ID,方法是:打開IE,在URL中輸入下如下地址(還記得上面Copy的ID吧,把它放在地址的最后面):owssvr.dll
http://sp2010/_vti_bin/owssvr.dll?Cmd=ExportList&List=9f7d064f-d9s8-62f1-8a4f-b02c9f4c259k
這樣,你會取到一個 XML文檔,在此文檔中你就可以找到你想要的東西了。(如下面XML內容的紅色部分)
?
List Name="{9f7d064f-d9s8-62f1-8a4f-b02c9f4c259k}" Title="Web Part Gallery" Description="Use this Web Part Gallery to store and retrieve Web Parts. The Web Parts in this gallery are available to this site and all sites under it. To preview a Web Part, click its title." Direction="0" BaseType="1" ServerTemplate="113" Url="_catalogs/wp" HiddenList="TRUE" DisableAttachments="TRUE" FolderCreation="FALSE" AlwaysIncludeContent="TRUE" RootWebOnly="TRUE" Catalog="TRUE" AllowDeletion="FALSE" BrowserFileHandling="permissive" NoCrawl="TRUE" Version="1">
- <MetaData>
- <Views>
+ <View Name="{283335B7-DE62-4316-B3EF-14A46B17BF0F}" DefaultView="TRUE" Type="HTML" DisplayName="All Web Parts" Url="_catalogs/wp/Forms/AllItems.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ToolbarTemplate="WebPartGalleryViewToolBar" ImageUrl="/_layouts/images/wlicon.png">
?
?
?
?
總結
以上是生活随笔為你收集整理的Sharepoint学习笔记---如何找到SharePoint List的Template ID的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: TextSwitcher--文本切换器
- 下一篇: jdbc excute方法理解的误区