Search code examples
alfrescocmis

Alfresco CMIS parents query returning unexpected empty result


Context

The CMIS parent operation allows one to get the full path(s) of an object from its id.
For instance, I give /alfresco/service/cmis/s/versionStore:version2Store/i/2f4cbf7a-0f8e-4fa1-81e5-8be69eb0532e and I get /Sites/swsdp/documentLibrary/Presentations.

I have an Alfresco Community 4.2.e server.
Not sure if relevant but it is purely out-of-the-box except I enabled ChangeLog:

audit.enabled=true
audit.alfresco-access.enabled=true
audit.cmischangelog.enabled=true

What occurs

When I run a "parent" CMIS request below, I get the response below which contains zero Atom entries:

GET /alfresco/service/cmis/s/versionStore:version2Store/i/2f4cbf7a-0f8e-4fa1-81e5-8be69eb0532e/parents?includeAllowableActions=false&includeRelationships=none&includeRelativePathSegment=true HTTP/1.1
User-Agent: Apache Chemistry DotCMIS
Authorization: Basic YWRtaW46YWRtaW4=
Host: 192.168.0.66:8080
Connection: Keep-Alive

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Content-Type: application/atom+xml; type=feed;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 06 Mar 2014 06:57:46 GMT

477
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:alf="http://www.alfresco.org" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<author><name>admin</name></author>
<generator version="4.2.0 (r56674-b4848)">Alfresco (Community)</generator>
<icon>http://192.168.0.66:8080/alfresco/images/logo/AlfrescoLogo16.ico</icon>
<id>urn:uuid:2f4cbf7a-0f8e-4fa1-81e5-8be69eb0532e-parents</id>
<link rel="service" href="http://192.168.0.66:8080/alfresco/service/cmis"/>
<link rel="self" href="http://192.168.0.66:8080/alfresco/service/cmis/s/versionStore:version2Store/i/2f4cbf7a-0f8e-4fa1-81e5-8be69eb0532e/parents?includeAllowableActions=false&amp;includeRelationships=none&amp;includeRelativePathSegment=true"/>
<link rel="via" href="http://192.168.0.66:8080/alfresco/service/cmis/s/versionStore:version2Store/i/2f4cbf7a-0f8e-4fa1-81e5-8be69eb0532e"/>
<title>text1.txt Parents</title>
<updated>2014-03-05T16:32:44.359+09:00</updated>
</feed>
0

What I think should occur

For reference, the CMIS standard has an example request/response for parents.
The example response contains an Atom entry which has the path I am looking for:

<atom:entry>
    [...]
    <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/">
        <cmis:properties>
            [...]
            <cmis:propertyString queryName="cmis:path" displayName="Path" localName="cmis:path" propertyDefinitionId="cmis:path">
                <cmis:value>/My_Folder-0-0/MultifiledFolder1</cmis:value>

Question

Why is Alfresco not giving me any Atom entry?

What is wrong with my request? I am pretty sure the id refers correctly to the existing file /Sites/swsdp/documentLibrary/Presentations/test1.txt.


Solution

  • You are using a deprecated CMIS endpoint with an outdated CMIS implementation.

    Try:

    http://<host>/alfresco/api/-default-/public/cmis/versions/1.0/atom