cancel
Showing results for 
Search instead for 
Did you mean: 

Document creation handler succeeds from UI but fails from CMIS document creation

Steven_Huwig1
Star Contributor
Star Contributor

What needs to be done in order to avoid the following error from a operation event handler?

 org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentVersion$VersionNotModifiableException: Cannot set property on a version:

My code works correctly when documents are created from the UI -- it sets additional metadata based on web service call results, similar to the external web service example on the Nuxeo blog.

However when I attempt to use cmislib's createDocument call, the VersionNotModifiableException error is returned when Document.Save is called on the modified object.

Is there something I should be doing in my Operation, or some special property or set of properties I should be setting on the createDocument call?

1 REPLY 1

Steven_Huwig1
Star Contributor
Star Contributor

I solved this issue by filtering the event in Nuxeo Studio to only fire when "Current document is: Mutable Document."

I guess the CMIS createDocument must fire off multiple events for document creation, one containing a live document and one containing a version? Is this expected behavior?

Getting started

Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.