SP2010 客户端对象模型:将文件上传到投放库不应用内容组织器规则
我目前正在开发一项服务,使用 SharePoint 2010 客户端对象模型以编程方式将 Excel 工作表上传到 Drop Off Library,然后设置文件的属性。这个过程运作良好。但是,投放库受内容组织者规则的约束,这些规则不适用于上传的文件。我检查了我认为可能错过的每个属性:
- ContentTypeId 已正确设置
- _ModerationStatus 已设置为 0
- 调用规则所需的两个属性已设置为有效值
- 在 ListItem 上调用更新
- 该文件在之后签入ListItem 已更新
该列表没有启用次要版本控制,因此我没有进行任何发布调用。
最令人沮丧的是,如果我使用 Web UI 编辑文档属性并在不进行任何更改的情况下将其签入,则该文件将移动到其最终位置。使用 SP2010 COM 时,我可能忽略了哪些因素导致内容组织器规则无法应用于新上传的文件?
I am currently developing a service using the SharePoint 2010 Client Object Model to programmatically upload Excel worksheets to a Drop Off Library and then set the properties on the file. This process is working well. However, the Drop Off Library is governed by Content Organizer Rules that aren't being applied to the uploaded file. I have examined every property I thought I could have missed:
- ContentTypeId is being properly set
- _ModerationStatus is being set to 0
- The two properties required to invoke the rule are being set to valid values
- Update is being called on the ListItem
- The file is checked in after the ListItem is updated
The list doesn't have minor versioning enabled so I don't make any calls to publish.
What's most frustrating is that if I edit the document properties using the Web UI and check it back in without making any changes, the file is moved to its final location. What might I have overlooked that is preventing Content Organizer Rules from being applied to newly uploaded files when using SP2010 COM?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题的最终答案是,一切确实都设置正确。然而,不能强制以编程方式评估内容管理规则。我所需的信息是由 Steve Curran 在 这个MSDN线程。
在 SharePoint 2010 管理中心的“监视”部分下,有一个“计时器作业”控制面板,其中包含“查看作业定义”项目。在此面板上,应该有一个名为“内容组织器处理”的作业。这是一项每晚的任务,将根据您在站点中建立的规则运行和清理内容。以编程方式将文件上传到投放库后,您可能会发现,如果属性设置正确,点击此作业的“立即运行”按钮将导致文件移动到其最终目的地。
解决方案是在重复计划部分下将此作业的频率从每晚进程更改为每 15 分钟执行一次(或您确定最有效的任何时间间隔)。
警告:请务必注意,如果您在文件留在投递库中且属性设置不正确时向站点管理员或邮件列表发送自动电子邮件,这些将以与作业执行相同的频率开始到达。
The ultimate answer to this question turned out to be that everything was indeed being set correctly. However, one cannot force the evaluation of content management rules programmatically. The information I required was provided by a post from Steve Curran on this MSDN thread.
In SharePoint 2010 Central Administration under the "Monitoring" section there is a control panel for "Timer Jobs" that includes an item to "Review job definitions." On this panel, there should be a job named "Content Organizer Processing." This is a nightly task that will run and clean up content according to the rules you have established in your site. After uploading a file to the drop off library programmatically, you will likely find that hitting the "Run Now" button for this job will cause the file to be moved to its final destination if the properties are set correctly.
The solution was to change the frequency of this job under the Recurring Schedule section from a nightly process to one that is executed every 15 minutes (or whatever interval you determine will work best).
A word of caution: Be certain to note that if you send automated e-mail to the site administrator or a mailing list when files are left in the drop off library that do not have their properties set correctly, these will start arriving with the same frequency as the job's execution.
这篇文章可能会有所帮助。
基本上,2010 COM 似乎不支持它,因此不幸的是,您必须解决它。
This article may help.
Basically, it does not appear to be supported in the 2010 COM so you have to work around it, unfortunately.