签入评论未存储在文档库中
我在 SharePoint 2007 中的 spfile 对象上检查评论时遇到问题。 不存储 itemadding、itemadded、itemupdating 和 itemupdated 事件接收器中具有自定义内容类型和自定义代码的自定义 doclib 上的 checkincomments。
我找到了有关此问题的以下链接 http://social.technet.microsoft.com/Forums/en-SG/sharepointgeneral/thread/e7c42f6b-1dab-419a-aee6-010845b31ea0
和 http://www.theblackknightsings.com/HowToChangeCheckinCommentAfterSave.aspx
但我不想进行直接更改在数据库中,所以我没有尝试最后一个链接解决方案。
在itemupdating事件中,您可以通过properties.AfterProperties["vti_sourcecontrolcheckincomment"]获取注释。在 itemupdated 中,此属性为空。
因此,在第一个喜欢之后,我将评论存储在 itemupdating 中的一个自定义内容字段中,从 itemupdated 中获取它并创建一个禁用 eventfiring 的 file.CheckIn("mycomment", SPCheckinType.OverwriteCheckIn) 。
当我第二次将文件上传到文档库并将版本增加一(启用主要版本控制)时,itemupdating 和 itemupdated 会被触发两次。
在第二个 itemupdated 后,异步 itemupdated 似乎尚未准备好,我得到一条信息,表明该文件当前正在由我自己使用。所以更新失败。
有没有更简单的方法来确保自定义文档库中的签入注释正确存储?
事件第二次触发时的解决方案是什么?
任何帮助都会很棒!
i got a problem with checkincomments on a spfile object in SharePoint 2007.
The checkincomments on a custom doclib with custom contenttypes and custom code in the itemadding, itemadded, itemupdating and itemupdated eventreceivers are not stored.
I found the following links regarding this problem
http://social.technet.microsoft.com/Forums/en-SG/sharepointgeneral/thread/e7c42f6b-1dab-419a-aee6-010845b31ea0
and
http://www.theblackknightsings.com/HowToChangeCheckinCommentAfterSave.aspx
But i dont want to make direct changes in the database so i haven't tried the last links solution.
In the itemupdating event you can get the comment by properties.AfterProperties["vti_sourcecontrolcheckincomment"]. In itemupdated this property is empty.
So following the first lik i store the comment in one of the custom content fields in itemupdating, get it from there in itemupdated and make a file.CheckIn("mycomment", SPCheckinType.OverwriteCheckIn) with disabled eventfiring.
When i upload a file to the document library a second time and increase versions by one (major versioning enabled), itemupdating and itemupdated are fired twice.
After the second itemupdating the asynchronous itemupdated seems not to be ready and i get an information that the file is currently in use by myself. So the update fails.
Is there any easier way to make sure that checkincomments in a custom documentlibrary are stored correctly?
Whats the solution for the second time the events fire?
Any help would be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过几天的研究和测试,我终于找到了答案:
http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/ffed71b1-d255-4da3-90c7-537540c27a36
这有帮助!
I have found the answer finally after days of research and testing:
http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/ffed71b1-d255-4da3-90c7-537540c27a36
this helps!