Sharepoint:所有子站点的迭代性能是否可以承受?
我需要创建一个功能,该功能将迭代网站集的所有子网站,并向每个子网站添加一些示例内容(示例内容=新页面、图像、文档,可能还有一些列表)。 有一个使用递归循环访问站点的解决方案(可以找到 这里)。
所以我问:
- 你们中有人实施过类似的事情吗?也许是以不同的方式?
- 这样的迭代的表现如何?
我真的不能说网站集中可以存在多少个子网站,因为此功能应该在更多项目中使用。 但我想子站点的数量不应超过 100 个左右。
I need to create feature which will iterate through all subsites of site collection and add some sample content to each of them (sample content=new pages,images,documents,possibly some lists). There is solution that uses recursion to loop through sites (it can be found here).
So i'm asking:
- Did any of you implemented something similar, maybe in different way?
- What was the performance of such iteration?
I can't really say how many subsites can be present in site collection, since this feature should be used in more projects. But i guess the number of subsites shouldn't excess 100 or such.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是执行站点和 Web 部件循环的一种非常常见的方法。
100个子站点的速度不会有问题。 如果您进行大量处理会减慢速度,那么它确实很快。
需要注意的一件事是项目的处置,如果您保持打开状态或不关闭,您可能会耗尽 WFE 的所有内存,特别是如果很多用户同时重新加载页面。
请参阅http://www.sharepointnutsandbolts.com/2008 /06/disusing-sharepoint-objects-what-they.html 和 http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss -3-0-dispose-patterns-by-example.aspx 例如,他们也有处置工具 http://blogs.msdn.com/sharepoint/archive/2008/11/12/announcing-spdisposecheck-tool-for -sharepoint-developers.aspx
That is a very common method of performing looping of sites and web parts.
Speed with 100 sub-sites will not be a problem. It is really quick, if you do alot of processing that can slow it down.
The one thing to watch is the disposal of items if you leave the open or don't close you can suck all the memory from the WFE, especially if alot of users reload the page at the same time.
See http://www.sharepointnutsandbolts.com/2008/06/disposing-sharepoint-objects-what-they.html and http://blogs.msdn.com/rogerla/archive/2008/02/12/sharepoint-2007-and-wss-3-0-dispose-patterns-by-example.aspx for examples they also have the disposal tool at http://blogs.msdn.com/sharepoint/archive/2008/11/12/announcing-spdisposecheck-tool-for-sharepoint-developers.aspx
您可以查看我给 这个问题。 我想我已经为那段代码使用了正确的处置模式。
You can look at the answer I gave to this question. I think I've used the correct dispose patterns for that piece of code.
如果您需要对大型结构进行只读循环,这里有一个很酷但有点不传统的方法:
http://hristopavlov.wordpress.com/2008/10 /20/一种非常快速的获取网站集合网络结构的方法/
If you need to do a read-only loop through a big structure, here's a cool, yet a bit untraditional, way of doing it:
http://hristopavlov.wordpress.com/2008/10/20/a-very-fast-method-to-get-the-site-collections-web-structure/