在做一個和SharePoint有關的項目時,由於對SharePoint的unfamiliar,所以客戶發了幾個尾碼為.stp的檔案將我納悶了半天,不知為何物。
按常理,只知道.stp檔案是3D 的一個標準分頁檔,需要用AutoCAD、PRO/E或SW等三維處理軟體來開啟,但看客戶給我的檔案大小非常小,應該不可能是3D檔案啊。後來Avrin告訴我stp檔案是Sharepoint裡的Template file時我才恍然大悟,孤陋寡聞,慚愧啊....
這裡的stp檔案果然是SharePoint裡的模板檔案,用於將SharePoint裡的List或site等結構儲存下來以便移植到別的SharePoint上。實際上這個stp檔案是個Cab檔案,可以強行更改其尾碼為.cab,直接開啟或解壓縮後可以看到裡面的檔案,其中有個manifest.xml的XML檔案。關於這個的具體描述在另外一篇文章《SharePoint Customization: Using WSS List Templates in SPS Areas》裡說得很詳細,可以參考。
一、匯出stp檔案
1、開啟SharePoint裡的網站,在"Site Actions"下選擇"Site Settings",然後選擇Look and Feel欄下的"Save site as template"即可;
2、在SharePoint裡開啟一個List,點擊"Settings"下的"List Settings",在“Permissions and Management”下點擊"Save List as template"即可。
二、匯入stp檔案建立Site及List
開啟SharePoint的Home頁,點擊Site Actions —> Site Settings —> Modify All Site Settings,在Galleries下選擇Site templates或List templates進入Site Template Gallery頁或List Template Gallery頁,將相應的Site stp檔案或List stp檔案上傳到Gallery。然後在建立網站或建立List時就可以選擇上傳的木板進行建立。