Page 1 of 1

ZOHO Collaboration not working - Lost Update

PostPosted:Wed Jun 25, 2014 4:11 pm
by Catscratch
Hi,

I successfully integrated ZOHO into openkm. It's working. Means I can open a document in ZOHO, change something and save it back to openkm.

But the collaboration is not working. If two or more users simultanously open the same document in ZOHO, everyone is editing it for himself. So one user can't see changes made by another user. Furthermore, if the users save their documents, the user who saves at last, wins. This means, if user 1 saves the document and afterwards user 2 saves the document, changes done by user 1 are overwritten.

Do you have any idea whats going wrong? Do you create a document copy for every user? Usally the users should all redirected to the same document instance in ZOHO. Seems like this is not happening.

Regards

Re: ZOHO Collaboration not working - Lost Update

PostPosted:Fri Jun 27, 2014 6:48 pm
by jllort
I think you are seeing into the popup the zoho url.

You can take a look at the code from here:
http://sourceforge.net/p/openkm/code/HE ... Popup.java
http://sourceforge.net/p/openkm/code/HE ... n/servlet/

Re: ZOHO Collaboration not working - Lost Update

PostPosted:Fri Jul 11, 2014 11:16 am
by Catscratch
I didn't found the point where you put the document into the zoho popup. Where does it happen? There must be a point where you give the zoho service an url or InputStream or something else.

Thanks!

Re: ZOHO Collaboration not working - Lost Update

PostPosted:Sat Jul 12, 2014 5:38 pm
by jllort

Re: ZOHO Collaboration not working - Lost Update

PostPosted:Mon Jul 14, 2014 8:04 am
by Catscratch
Thanks for the hint.

I found the problem. It's in the sendToZoho-method. There you indeed create a copy of the document (tmp file) which you give to ZOHO. But instead of using the actual copy if another user also wants to edit the same document with ZOHO, you create another copy. That's the problem.

So if a copy already exists you try to generate other files until a new copy could be created.
createTempFile ->
Code: Select all
do {
     f = TempDirectory.generateFile(prefix, suffix, tmpdir);
} while (f.exists());
I think it would be good to check if there is already an open copy and if so, then don't create a new one, but use the open one an push the second user into the session of the first who created the copy. That's the only way to allow collaboration.

Re: ZOHO Collaboration not working - Lost Update

PostPosted:Thu Jul 17, 2014 9:22 am
by jllort
The problem comes when both tries to save the document, is that ?

Re: ZOHO Collaboration not working - Lost Update

PostPosted:Thu Jul 17, 2014 11:05 am
by Catscratch
No, the problem is, that both edit a different copy of the same document and therefore it is not collaborative.

The problem, that the second user, who saves, overrides the changes made by the first one, is simply a result since there are two different copies of the same openkm document.

But you can solve the problem by not allowing different copies. So if a user wants to edit a document in ZOHO which was already copied by another user, the new user should NOT get another copy, but the same copy the first user created. So the same ZOHO session. You can simply check this, if you lock/checkout the document, when the first user opens it in ZOHO. Now, when another user tries to edit it in ZOHO you can see, that there is already an edit session open, because the document is still locked/checked out.

Re: ZOHO Collaboration not working - Lost Update

PostPosted:Fri Jul 18, 2014 5:18 am
by jllort
Add a ticket at http://issues.openkm.com with the link of this forum post and we'll do as soon as possible. Will not be done until 1-2 months. If you provide us the patch will go faster ( take only as a suggestion ) but during july and august will not be possible doing it

Re: ZOHO Collaboration not working - Lost Update

PostPosted:Fri Jul 18, 2014 8:59 am
by Catscratch