[英]Getting the userinfo from specific sharepoint site using sharepoint web service
[英]creating a sharepoint site from clearQuest web server
我有一個clearQuest Web(在Linux上運行),並且想要在創建新記錄時(使用perl腳本)創建一個共享點站點。 我該怎么做-是否可以使用任何共享點Web服務來創建站點。 我相信我需要一個用於Web服務的perl模塊,如何將其添加到clearQuest Web服務器的perl安裝中?
有人對此有經驗嗎?
我沒有使用過perl腳本。 但是請查看http://sharepoint site/_vti_bin/sites.asmx
Web服務。 此Web服務可用於管理站點。
我創建了一個自定義Web服務,用於在SharePoint(WSS 3)中創建網站,因為找不到使用現有Web服務的方法。
代碼看起來像這樣:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class CreateSiteWebService : System.Web.Services.WebService
{
[WebMethod]
public string CreateSite(
string strWebUrl,
string strTitle,
string strDescription,
uint nLCID,
string strWebTemplate,
bool useUniquePermissions,
bool bConvertIfThere
)
{
SPWeb newWeb = null;
SPSite site = SPContext.Current.Site;
newWeb = site.RootWeb.Webs.Add(strWebUrl, strTitle, strDescription, nLCID, strWebTemplate, useUniquePermissions, bConvertIfThere);
newWeb.Navigation.UseShared = true;
newWeb.Update();
//try to get it to appear in quick launch:
SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;
SPNavigationNode menuNode = null;
foreach(SPNavigationNode n in nodes)
{
if (n.Title == "Sites")
{
menuNode = n;
break;
}
}
if (menuNode == null)
{
menuNode = new SPNavigationNode("Sites", site.Url + "/_layouts/viewlsts.aspx?ShowSites=1", false);
nodes.AddAsFirst(menuNode);
}
SPNavigationNode navNode = new SPNavigationNode(strTitle, strWebUrl, false);
menuNode.Children.AddAsLast(navNode);
parent.Update();
parent.Dispose();
site.Dispose();
string url = newWeb.Url;
newWeb.Dispose();
return url;
}
}
希望能有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.