从 Office 客户端保存时,未在内容类型中设置文档 ID
我有一个困扰我很长时间的问题。这个问题在测试环境中出现,但在我的开发环境中却没有出现。
我有一个文档库模板。在事件处理程序中,我附加了多个内容类型(它们全部继承自基本内容类型,而基本内容类型又继承自 Document)。基本内容类型具有自定义文档模板,以及在内容类型定义的 xmldocuments 中定义的事件处理程序。
站点中已启用 Doc-ID 功能。
将文件上传到文档库时,会按预期为该文档分配一个文档 ID。但是,当从 Word 保存文件时,文档 ID 为空。显然该值是在项目上设置的,因为随后更改项目的内容类型时,doc-ID 会显示一个数字,表明它是在第一次保存文件时分配的。将内容类型设置回原始值时,文档 ID 仍显示在视图中。
澄清一下:这不是项目内容类型的 ID 字段,而是由 SharePoint 2010 中的 doc-ID 功能创建的 Doc-ID。
您知道为什么在提升 Word 中的值时未设置此值吗?
I have a problem that i've struggled with for a long time. This problem manifests itself in the test environment, but not in my dev environment.
I have a document library template. In a event handler I attach several content types (which all inherit from a base content type which in turn inherits from Document). The base content type has a custom document template, and event handlers defined in xmldocuments on the contenttype definition.
The Doc-ID feature is switched on in the site.
When uploading a file to the document library, the document is assigned a document ID as expected. When saving a file from Word however, the doc-ID is blank. Apparently the value is set on the item, because when changing the content type of the item afterwards, the doc-ID appears with a number indicating that it was assigned when the file was first saved. When setting the contenttype back to the original value, the Doc-ID remains displayed in the view.
To clarify: This is not the ID field of the Item content type, but the Doc-ID that is created by the doc-ID feature in SharePoint 2010.
Any ideas to why this value is not set when promoting values from Word?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案似乎在于网站集中的基本文档内容类型。激活 document-id 功能后,事件处理程序将作为 xmldocuments 添加到内容类型定义中。创建常规文档库时,库中的内容类型将从该内容类型继承,从而获取事件接收器的副本。
我的具有自定义内容类型的自定义文档库不是从网站集文档内容类型继承的,而是从基本文档内容类型 (
0x0101
) 继承的,并且没有获取事件接收器的副本。将 xmldocuments 复制到我的基本内容类型中似乎可以解决问题。
It seems that the solution lied in the base Document content type in the site collection. When the document-id feature is activated, event handlers are added to the content type definition as xmldocuments. When a regular document library is created, the content type in the library inherits from this content type, and thus gets a copy of the event receivers.
My custom document library with custom content types did not inherit from the site collection document content type, but rather from the base document content type (
0x0101
), and did not get a copy of the event receivers.Copying the xmldocuments into my base content type seems to do the trick.