08-11-2020 10:06 AM
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)
08-11-2020 10:18 AM
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?
08-11-2020 12:20 PM
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:
and
Jeff
08-11-2020 01:16 PM
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.
08-11-2020 02:15 PM
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?
Explore our Alfresco products with the links below. Use labels to filter content by product module.