使用 OpenCMIS 获取 Alfresco 扩展属性
我正在编写一个基于 OpenCMIS 的应用程序,它从 Alfresco 3.3 中提取一些数据。
它可以与标准 CMIS 属性配合使用,例如cmis:name
或cmis:contentStreamMimeType
;但是,我无法访问 Alfresco 特定属性,这些属性作为“Alfresco 扩展”出现在 CMIS AtomPub 提要上:
<cmisra:object>
<cmis:properties>
<cmis:propertyString propertyDefinitionId="cmis:name" displayName="Name" queryName="cmis:name">
<cmis:value>test document</cmis:value>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:contentStreamMimeType" displayName="Content Stream MIME Type" queryName="cmis:contentStreamMimeType">
<cmis:value>text/html</cmis:value>
</cmis:propertyString>
...
<alf:aspects>
...
<alf:properties>
<cmis:propertyString propertyDefinitionId="cm:description" displayName="Description" queryName="cm:description">
<cmis:value>This is just a test document</cmis:value>
</cmis:propertyString>
</alf:properties>
</alf:aspects>
</cmis:properties>
</cmisra:object>
有没有什么方法可以使用 OpenCMIS 获取 cm:descripcion
的值?
我的猜测是,我需要使用 DocumentType
接口而不是 Document
,然后调用其 getExtensions()
方法。但我不知道如何获取 DocumentType 的实例。
任何帮助将不胜感激。
问候
编辑:虽然 Florian 的答案已经为我解决了,但我刚刚意识到我也可以使用 CMIS SQL 获取这些属性的值:
select d.*, t.*, a.*
from cmis:document d
join cm:titled t on d.cmis:objectid = t.cmis:objectid
join cm:author a on d.cmis:objectid = a.cmis:objectid
where t.cm:description like ...
I'm writing an OpenCMIS based application, which extracts some data from Alfresco 3.3.
It works fine with standard CMIS properties such as cmis:name
or cmis:contentStreamMimeType
; however, I can't access Alfresco especific properties, which are present on the CMIS AtomPub feed as "Alfresco extensions":
<cmisra:object>
<cmis:properties>
<cmis:propertyString propertyDefinitionId="cmis:name" displayName="Name" queryName="cmis:name">
<cmis:value>test document</cmis:value>
</cmis:propertyString>
<cmis:propertyString propertyDefinitionId="cmis:contentStreamMimeType" displayName="Content Stream MIME Type" queryName="cmis:contentStreamMimeType">
<cmis:value>text/html</cmis:value>
</cmis:propertyString>
...
<alf:aspects>
...
<alf:properties>
<cmis:propertyString propertyDefinitionId="cm:description" displayName="Description" queryName="cm:description">
<cmis:value>This is just a test document</cmis:value>
</cmis:propertyString>
</alf:properties>
</alf:aspects>
</cmis:properties>
</cmisra:object>
Is there any way in which I can get the value of cm:descripcion
, with OpenCMIS?
My guess is that I need to use the DocumentType
interface instead of Document
, and then call its getExtensions()
method. But I don't know how to get an instance of DocumentType.
Any help would be really appreciated.
Regards
Edit: altough Florian's answer already worked out for me, I've just realized that I can get these properties' values with CMIS SQL, too:
select d.*, t.*, a.*
from cmis:document d
join cm:titled t on d.cmis:objectid = t.cmis:objectid
join cm:author a on d.cmis:objectid = a.cmis:objectid
where t.cm:description like ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
恐怕 OpenCMIS 高级 API 还无法访问所有扩展。它在我们的待办事项清单上。目前,您必须使用低级 API。
像这样的东西应该有效:
I'm afraid the OpenCMIS high-level API cannot access all extensions yet. It's on our to-do list. For now, you have to use the low-level API.
Something like this should work: