0

I have a Java (Apache Tomcat) based web application which allows user to write code in browser in different languages like (c, c++, java) and compile and execute them on server. The server security issues are handled by executing every code in chroot jail under ptrace supervision.

  • I'm using Ace editor as code editor.

I want to add another feature that is collaborative editing, name says it all.

I have seen some related questions on Stack Overflow.

So if I use code.google.com/p/google-diff-match-patch, and generate a diff every 0.5 seconds, send it to the server and pull all the other diffs and return them from the server.

  • Do you think above approach would work? Will it be feasible?

  • I have this web application ready, so i only want someone to point me in right direction so that i can integrate some java script and write some Server side code to achieve my GOAL.

  • What will be the best way to add Collaborative Editing in my web application?

Community
  • 1
  • 1
VishalDevgire
  • 4,232
  • 10
  • 33
  • 59

1 Answers1

4

I'm working on a very similar project. :)

Your solution does not handle the conflicts. You need a more sophisticate technique like operational transformation: http://en.wikipedia.org/wiki/Operational_transformation


It was the base of Google Wave that now is open source:

http://www.waveprotocol.org/protocol

http://incubator.apache.org/wave/


In Internet you can find a lot of good blogs and articles about this topic: http://www.codecommit.com/blog/java/understanding-and-applying-operational-transformation

TizianoPiccardi
  • 487
  • 4
  • 13