Get Alfresco Extension Properties Using OpenCMIS

I am writing an OpenCMIS application that extracts some data from Alfresco 3.3.

It works great with standard CMIS properties such as cmis:name or cmis:contentStreamMimeType ; however, I cannot access the Alfresco properties that are present in the AtomPub CMIS channel 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 a way to get the cm:descripcion value using OpenCMIS?

I assume that I need to use the DocumentType interface instead of Document , and then call its getExtensions() method. But I do not know how to get an instance of DocumentType.

Any help would be really appreciated.

Hi


Edit: altough The Florian answer has already been developed for me, I just realized that I can get these property values โ€‹โ€‹using 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 ... 
+4
source share
1 answer

I am afraid that the high-level API OpenCMIS will not be able to access all the extensions. This is on our to-do list. For now, you should use the low-level API. Something like this should work:

 ObjectData doc = session.getBinding().getObjectService().getObject(...); org.w3c.dom.Node domNode = (org.w3c.dom.Node) doc.getProperties().getExtensions().get(0); // <alf:aspects> domNode.getFirstChild() ... 
+3
source

Source: https://habr.com/ru/post/1312214/


All Articles