获取多页面会议工作区的页面
我目前对多页会议工作区模板进行了一些测试,以检查它是否符合我们作为项目基本模板的需求。
您可能知道,多页面会议工作区旨在能够管理单个工作区中的多个日期,并显示仅与特定日期相关的页面或应在每个日期出现的页面。
如果您使用 SharePoint Designer 检查多页面会议工作区,您可以看到有一个包含工作区所有页面的库。 每个日期显示的页面都存储在根文件夹中,仅在单个日期显示的页面存储在以相应日期命名的文件夹中。
现在我们来谈谈我的问题。 为了设置每个日期显示的单个页面的权限,我遍历页面库以查找要更改权限的页面。 奇怪的是,该库的 ListItemCollection 假装包含我期望它包含的页数。 但是,当我迭代该集合时,它只返回附加到实际日期的页面。 它既不返回应在每个日期显示的页面,也不返回其他日期的页面。
我已经尝试使用 SPSecruity.RunWithElevatedPrivilges() 并模拟系统帐户来获取页面。 我还尝试通过命令行应用程序获取它们,而不使用任何上下文信息。 对象模型似乎也遵循这样的行为:您只能获取与特定日期相关的项目。
那么,无论实际日期如何,我怎样才能获取多页会议工作区的所有页面???
I currently do some testings on the multipage meeting workspace template to check whether it fit our needs to be the base template for our projects.
As you might know, a multipage meeting workspace is designed to be able to manage several dates within a single workspace and to display either pages that are only related to a certain date or pages that should appear on every date.
If you examine a multipage meeting workspace with SharePoint Designer you can see that there is a library which contains all the pages of the workspace. Pages that are displayed on every date are stored in the root folder, pages that are only displayed on single dates are stored in folders which are named with the according date.
So now we come to my problem. In order to set the permission for a single page that is displayed on each date, I iterate over the page library to find the page I want to change the permissions on. Strangely, the ListItemCollection of the library pretend to contain the number of pages I expected it to contain. But when I then iterate over the collection it only returns the pages that are attached to the actual date. Neither does it return the pages which should be displayed on every date nor the pages for the other dates.
I have already tried to get the pages by using SPSecruity.RunWithElevatedPrivilges() and with impersonation as the system account. I've also tried to get them via a command line application without using any context information. It seems as the behavior, that you can only get the items which are related to a certain date, is also followed by the object model.
So how could I get all pages of a multipages meeting workspace regardless of the actual date???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在工作区创建时刻捕获事件,并在事件中以编程方式设置权限。 您可能想了解有关 事件接收器 或 以编程方式设置权限。
您提到的那些页面是添加到名为“会议系列”的列表中的项目
替代文本 http://img22.imageshack.us/img22/8963/ss20090528181724.png< /a>
它包含以下字段:
替代文本 http://img22.imageshack.us/ img22/351/ss20090528181819.png 替代文本 http://img22.imageshack .us/img22/7857/ss20090528181852.png
来自 1 项的示例数据(未按提到的列的顺序排列):
You can catch an event on workspace creation moment and at the event set permissions programmatically. You may want to know more about event receivers or setting permissions programmatically.
Those pages you mentioned are items added to a list called "Meeting Series"
alt text http://img22.imageshack.us/img22/8963/ss20090528181724.png
It contains following fields:
alt text http://img22.imageshack.us/img22/351/ss20090528181819.png alt text http://img22.imageshack.us/img22/7857/ss20090528181852.png
Example data from 1 item (not in tat order as columns are mentioned):
仅当用户尝试访问此类事件的页面时才会创建它们。 这是设计使然,我发现的唯一解决方案是尝试通过网站(或某些仿真)访问页面,然后尝试通过代码访问它们。
关于 Flo 的评论,我在 Microsoft Sharepoint 2007 Development unleashed(sams,ISBN 0-672-32903-4)上找到了来源。 第 101 页上说:
如果您找到其他方法,请发布它,这将为我们节省很多精力!
The pages for this kind of events get created only when a user tries to access them. This is by design, and the only solution I found was to try and access the page via the website (or some emulation) and then try to access them by code.
Regarding Flo's Comment, I fount the source for this on Microsoft Sharepoint 2007 Development unleashed (sams, ISBN 0-672-32903-4). on p 101 says:
If you find another way, please post it It will save us lots of effort!!!