首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从clearQuest web服务器创建sharepoint站点

从clearQuest web服务器创建sharepoint站点
EN

Stack Overflow用户
提问于 2010-11-04 06:01:21
回答 2查看 581关注 0票数 1

我有一个sharepoint (在Linux上运行),并希望在创建新记录时(使用clearQuest脚本)创建一个sharepoint站点。我该怎么做--有没有什么sharepoint web服务可以用来创建站点。我认为我需要一个用于web服务的perl模块,如何将其添加到clearQuest web服务器的perl安装中?

有没有人用过这个?

EN

回答 2

Stack Overflow用户

发布于 2010-11-04 10:24:50

我没有使用过perl脚本。但看看http://sharepoint site/_vti_bin/sites.asmx webservice吧。此used服务可用于管理站点。

票数 0
EN

Stack Overflow用户

发布于 2010-11-04 10:50:30

我创建了一个用于在SharePoint (WSS3)中创建站点的自定义web服务,因为我找不到使用现有web服务来创建站点的方法。

代码看起来像这样:

代码语言:javascript
复制
[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;
    }
}

希望这能有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4092069

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档