cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Connector - Prompt for overwrite via ChangeToken

Former Member
0 Kudos

Hi Experts.

I am implementing the ABAP Connector for SAP Mobile Documents.

I have a use-case, where we are using editable documents, and are implementing the method SetContentStream, for providing a URL endpoint for the server to store to document content.

This is working fine.

However I would like to address the situation where 2 users have been off-line and both have edited a particular document.

In the signature of the SetContentStream method a ChangeToken will be passed, and I am guessing that I need to check this against my previously sent ChangeToken (via getObject/getChildren).

I also guess that if I cannot validate this changetoken I should return an Exception.

In case User 1 uploads the document first, then user 2 should be presented with a warning that a newer version already exists (has been updated in the meantime).

Can anybody help me with the details on how to make this work ?

Thanks,

Søren Hansen.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Søren,

You already covered most of it. When the client accesses an object, the server provides the change token in the cmis:changeToken property (if the client asked for it and server supports change tokens).

When a client changes an object (updates properties, sets new content, etc.) and includes the change token in the request the server should check if this change token matches the current change token of the object. If it does, the object hasn't changed since the client accessed the object and the update can be performed. If it doesn't match the server should return a updateConflictException. That signals the client that another user has modified the object in between. It's then up to the client to refresh the object, just override the other users changed (by retrying the update request without change token), or giving up.

Regards,

Florian Müller