Chapter 10. Writing with Friends: A Collaborative Text Editor

WHAT'S IN THIS CHAPTER?

  • Learning the Operational Transformation algorithm

  • Using service discovery to probe features

  • Extending XMPP stanzas

People used to mail manuscripts back and forth to collaborate. Over the years, as technology improved, this turned into file sharing via disks and then sharing over e-mail. Technology has now reached a point where multiple people, even in large groups, can simultaneously edit the same document over the network, and the familiarity of the Web has made it both easy and common. Given your previous experience with XMPP applications, it should be no surprise to you that XMPP provides an ideal medium for collaborative document editing.

One of the latest examples of such applications is Google Wave, a rich, media-filled, collaborative space for groups of people to work on shared documents. When Google needed a protocol to facilitate such a platform, it turned to XMPP. On top of XMPP, Google has built a fantastic platform for collaborative editing based on the principles of operational transformation. It has also chosen to do its protocol design work on the Wave protocol in the open at http://www.waveprotocol.org.

In this chapter, you will build a collaborative text editor based on the same principles as Google Wave — operational transformation. Although the application is designed for collaboration between a pair of users, the underlying algorithms can be scaled to arbitrary numbers of collaborators. ...

Get Professional XMPP Programming with JavaScript® and jQuery now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.