cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS Create document

Vincent_B
Champ on-the-rise
Champ on-the-rise

Hi there,

I would like to create a document by CMIS call. I'm calling URL by CURL and i passed this kind of file:

<atom:entry xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"
                    xmlns:cmism="http://docs.oasis-open.org/ns/cmis/messaging/200908/"
                    xmlns:atom="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/">
    <atom:title><?php echo $title ?></atom:title>
    <atom:summary><?php echo utf8_encode($description) ?></atom:summary>
    <cmisra:content>
            <cmisra:mediatype><?php echo  $contentType ?></cmisra:mediatype>
            <cmisra:base64>
            </cmisra:base64>
    </cmisra:content>
    <cmisra:object>
            <cmis:properties>
                    <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
                            <cmis:value>cmis:document</cmis:value>
                    </cmis:propertyId>
            </cmis:properties>
    </cmisra:object>

</atom:entry>

My url was fine and my document was created. I can update metadata no problems. However i have two entries for this document in Hierarchy table. One entry is ok but for another one parentid is NULL. So when i'm deleting definitly good one is deleted and disapear, but another one with parentid to NULL is always there. I have a lot of ghost datas and my database is growing up. Sameway if i'm using CMIS Workbench, two entries in hierarchy table. I also tested with those1 examples.

I made a script that delete ghost and purge database. Do you have any ideas for creating only one document with CMIS call? My Nuxeo version is 5.8.

Thanks in advance,

1 ACCEPTED ANSWER

rg1_
Star Contributor
Star Contributor

Please see Versioning for details regarding how versioning works in Nuxeo. The behavior you are seeing is expected. A CMIS createDocument operation creates both a "Working/Live Copy" document and an "Archive Version" document in Nuxeo. The following is extracted from the above documentation:

"In other systems than the Nuxeo Platform, the Check In operation that creates a new version removes the Working Copy, whose role has been fulfilled. This is not the case in the Nuxeo Platform, where the Working Copy remains in a special Checked In state. In these other systems, the Check Out operation can also be invoked on a Version to create a new Working Copy (this assumes that there is no pre-existing Working Copy in the system). This kind of operation will be made available in future versions of the platform but is not present at the moment."

Also, if you are invoking cmis client operations from curl, you might find the browser binding significantly more convenient than the atompub binding.

View answer in original post

1 REPLY 1

rg1_
Star Contributor
Star Contributor

Please see Versioning for details regarding how versioning works in Nuxeo. The behavior you are seeing is expected. A CMIS createDocument operation creates both a "Working/Live Copy" document and an "Archive Version" document in Nuxeo. The following is extracted from the above documentation:

"In other systems than the Nuxeo Platform, the Check In operation that creates a new version removes the Working Copy, whose role has been fulfilled. This is not the case in the Nuxeo Platform, where the Working Copy remains in a special Checked In state. In these other systems, the Check Out operation can also be invoked on a Version to create a new Working Copy (this assumes that there is no pre-existing Working Copy in the system). This kind of operation will be made available in future versions of the platform but is not present at the moment."

Also, if you are invoking cmis client operations from curl, you might find the browser binding significantly more convenient than the atompub binding.