协作门户审批工作流程

发布于 2024-11-01 14:21:32 字数 301 浏览 5 评论 0原文

我工作的公司最近从另一家公司接管了一个SharePoint 2007 项目。另一家公司使用协作门户发布模板创建了一个网站。由于这是一个互联网网站,这给我带来了一些问题。

默认情况下,审批工作流不会在站点的页面库上激活,并且客户端要求工作流在所有页面库上处于活动状态。问题是该网站很大,手动执行此操作将花费太长时间,而且因为它是如此之大,我无法从头开始重新创建它。

有没有办法在网站的所有页面库上激活审批工作流程?我可以更改站点定义中的某些内容吗?或者有没有办法以编程方式激活它?然后我可以创建一个控制台应用程序,它将递归地迭代站点并将工作流程附加到页面库?

The company I work for has recently taken over a SharePoint 2007 project form another company. The other company created a site using the Collaboration Portal Publishing template. Since this is an internet web site, this is causing me a couple of problems.

By default the approval workflow is not activated on the Pages Libraries of the site, and the client requires the workflow to be active on all of the Pages Libraries. The problem is that the site is massive, and doing this manually will take too long, and because it’s such a large site I can’t recreate it from scratch.

Is there a way I can activate the approval workflow on all the Pages Libraries of the site? Could I maybe change something in the site definition? Or is there a way to activate it programmatically? Then I could create a console app that will recursively iterate through the sites and attach the workflow to the Pages Libraries?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

舞袖。长 2024-11-08 14:21:32

您可以尝试使用此代码:

using (MossFramework.DocumentLibraryHelper docLibraryHelper = new MossFramework.DocumentLibraryHelper("SITENAME"))
{
   using (SPSite site = new SPSite(docLibraryHelper.MossSiteAddress))
   {
     SPWeb siteCollection = site.OpenWeb();
     siteCollection.AllowUnsafeUpdates = true;
     SPFolder folder = siteCollection.GetFolder("Document Centre");
     SPList list = siteCollection.Lists["Document Centre"];
     Guid wfBaseId = new Guid("{5703E6AC-1C65-440F-88DC-EB65F2C6DF82}");
     SPWorkflowAssociation wrkFl = list.WorkflowAssociations.GetAssociationByBaseID(wfBaseId);
     foreach (SPListItem spListItem in list.Items)
     {
       site.WorkflowManager.StartWorkflow(spListItem, wrkFl, wrkFl.AssociationData);
       // Error occurs here
     }
     site.Close();
   }
}


您可以尝试使用此

我希望有帮助

Your can try with this code :

using (MossFramework.DocumentLibraryHelper docLibraryHelper = new MossFramework.DocumentLibraryHelper("SITENAME"))
{
   using (SPSite site = new SPSite(docLibraryHelper.MossSiteAddress))
   {
     SPWeb siteCollection = site.OpenWeb();
     siteCollection.AllowUnsafeUpdates = true;
     SPFolder folder = siteCollection.GetFolder("Document Centre");
     SPList list = siteCollection.Lists["Document Centre"];
     Guid wfBaseId = new Guid("{5703E6AC-1C65-440F-88DC-EB65F2C6DF82}");
     SPWorkflowAssociation wrkFl = list.WorkflowAssociations.GetAssociationByBaseID(wfBaseId);
     foreach (SPListItem spListItem in list.Items)
     {
       site.WorkflowManager.StartWorkflow(spListItem, wrkFl, wrkFl.AssociationData);
       // Error occurs here
     }
     site.Close();
   }
}

or
You can try with this

I hope that helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文