我有一个sharepoint (在Linux上运行),并希望在创建新记录时(使用clearQuest脚本)创建一个sharepoint站点。我该怎么做--有没有什么sharepoint web服务可以用来创建站点。我认为我需要一个用于web服务的perl模块,如何将其添加到clearQuest web服务器的perl安装中?
有没有人用过这个?
发布于 2010-11-04 10:24:50
我没有使用过perl脚本。但看看http://sharepoint site/_vti_bin/sites.asmx webservice吧。此used服务可用于管理站点。
发布于 2010-11-04 10:50:30
我创建了一个用于在SharePoint (WSS3)中创建站点的自定义web服务,因为我找不到使用现有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;
}
}希望这能有所帮助。
https://stackoverflow.com/questions/4092069
复制相似问题