no new version on 5.2 created documents, 6.1.1 works (cmis/webdav)

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member II

no new version on 5.2 created documents, 6.1.1 works (cmis/webdav)

Hi,

 

we upgrade our Alfresco from 5.2 to 6.1.1.

To upgrade PDF's we use the python cmis client, which work fine on new created documents in 6.1.1.

As soon we try to update a document which was created in 5.2 only the current version is updated.

Any idea how I can force to create a new major version with setContentStream?

query = "select * from cmis:document where cmis:name like '%%Drawing %s.%%' and IN_TREE('%s')" % (artnr, SITE_ID)

In 6.1.1 created document:
workspace://SpacesStore/0f57e9e1-8f89-41c3-a377-72db7ba62f2f;1.2
newdoc: <cmislib.model.Document object at 0x7ff7c30de390>

workspace://SpacesStore/0f57e9e1-8f89-41c3-a377-72db7ba62f2f;1.3
newdoc: <cmislib.model.Document object at 0x7fd19c098390>

[...]

In 5.2 created document:
workspace://SpacesStore/0f77acbb-cb31-4199-bc6c-07fe44a1e840;1.4
newdoc: <cmislib.model.Document object at 0x7ff7c30de610>

workspace://SpacesStore/0f77acbb-cb31-4199-bc6c-07fe44a1e840;1.4
newdoc: <cmislib.model.Document object at 0x7fd19c098610>

[...]


f = open(path, 'rb')
newdoc = result.setContentStream (f)
4 Replies
Active Member II

Re: python CMIS no new version on 5.2 created documents, 6,1 works

Same situation on copy (over existing) pdf via webdav, no new version.

Remove "cm:versionable" via webgui and re-add it and new versions are generated.

Any idea for an workaround?

Professional

Re: python CMIS no new version on 5.2 created documents, 6,1 works

If you want to create a new version of a document you must actually version the document, not just set the content stream.

Using cmislib, go look at:

https://chemistry.apache.org/python/docs/code.html?highlight=checkout#cmislib.domain.Document.checko...

and

https://chemistry.apache.org/python/docs/code.html?highlight=checkout#cmislib.domain.Document.checki...

Jeff

Active Member II

Re: python CMIS no new version on 5.2 created documents, 6,1 works

Hi Jeff,

 

thank you fo reply.

This is interessting, on new generated files (in 6.1.1) SetContenSstream works fine.

Try to modify my python script. Smiley Indifferent

Active Member II

Re: python CMIS no new version on 5.2 created documents, 6,1 works

Checkout a document with python is no problem, but I do not know how to checkin a new document.

Do you have a example in python for me?