How the Word 2007 client works

High Level Description

The Word 2007 client is an add-in which communicates with a Plutext server, to:

1. fetch a copy of the document, via WebDAV

2. replicate changes made on this client and by other users, via SOAP.

WebDAV

We use WebDAV to fetch the docx document from the WebDAV-enabled Plutext server.

So we need WebDAV support in the client.

If you put a URL such as http://dev.plutext.org:8080/plutext-server/webdav/default/ into Word 2007's File Open dialog, Word (or rather, Microsoft-WebDAV-MiniRedir? 6.0.6000, at least on Vista) does PROPFIND / three times (each of which returns 501), then a PROPFIND on /plutext-server/, before doing a GET on http://dev.plutext.org:8080/plutext-server/webdav/default/, which returns an HTML page which Word displays as a document. GreenBytes? calls this the server-discovery issue.

Not what we want.

So we use the eXo platform's WebDAV plugin for Office, which is also GPL. Thanks eXo! The procedure for setting up your development environment fetches that and patches it a little.

Content Controls

The 'unit of change' is a Word 2007 content control (an SDT in OOXML). A Plutext document is a docx document, in which all the content is placed in a series of content controls. Depending how the document is set up, there could be one per paragraph, or one for a sequence of paragraphs.

Content Control Event Handlers

The client software handles a content control exit event, and if the content has changed, communicates that back to the server via SOAP.

A change is detected if the content is different from when the content control enter event handler fired.

The relevant code is in Mediator.cs.

SOAP Web Service

Mediator.cs sets up a TimerCallback?, which periodically checks for changes on the server via a method fetchUpdates.

Updates returned by SOAP take the form of transforms. The client applies these to the local copy of the document. This is done by applyUpdates at an opportune time, for example when the user enters another content control.

Collision handling and Conflict resolution

See EndUserConflictResolution