Monday, 03 Dec 2007
Monday, 03 Dec 2007
One of the highest voted issues in Calc is #8811# (Allow multiple users to edit the same spreadsheet through workbook sharing), which has currently 143 votes. After some evaluation we decided to give this feature a try. Before we start with the implementation I'd like to present some conceptual ideas.
Concept
The basic idea is to allow multiple users to edit a shared spreadsheet document simultaneously. The concept is rather simple and a non-server based solution, that means no document versioning, no access control, no messages, tasks and discussions. The granularity for sharing is the whole spreadsheet document.
A shared spreadsheet document will be identified by its shared status. The shared status can be stored as shared property in the document settings, as top level entry in the document file or in a separate file next to the document file.
If a user opens a shared spreadsheet document a temporary copy of the document file is created. The user works on the temporary copy, that means no exclusive write lock is required while editing the document. When the user saves the document, all changes made in the temporary copy will be merged into the shared file. During this merge process an exclusive write lock on the shared file is required. If there are merge conflicts during the merge process, e.g. two users have edited the same cell, the merge conflicts must be resolved interactively by the user. Probably the existing 'Accept or Reject Changes' dialog can be reused.
Merge Process
The whole merge process is based on the existing change tracking functionality, that means while editing a shared spreadsheet document change tracking must be enabled. Each document, that means the shared file and all temporary copies have its internal change tracking list, which consists of all recorded change actions. When merging, the change tracking list of the temporary copy must be synchronized with the change tracking list of the shared file. In order to achieve this the following steps are necessary for merging:
Although this procedure may look complicated it guarantees that the change tracking lists stay synchronized.
File Locking
As the evaluation showed, file locking is not working reliable cross platform, e.g. it's possible to have a write lock on the same file via Samba from Windows and via NFS from Linux/Solaris. As this problem won't be fixed in the short term on the operating system level, we decided to implement file locking on document level ourselves. The idea is to write a lock file next to the document file, which contains the information which user has locked the file.
Restrictions
As the whole merge process is based on the change tracking, only those change actions can be merged, which are recorded. Unfortunately when change tracking is switched on some of Calc's functionality is not enabled (e.g. Sorting, DataPilot, etc.) and some of Calc's functionality is enabled but not recorded (e.g. cell formatting and drawing layer actions) and therefore lost during the merge process. The main problem seems to be, that the cell formatting information gets lost during merging. This can hopefully be improved in future
versions.
Comments
Can you let us know under which document formats this initial new functionality will be available?
Thanks
Posted by Steve Meckling on December 03, 2007 at 02:41 PM CET #
Thanks Guys - this missing functionality has prevented widespread adoption of OO within our organisation. Will be great to see it working.
Posted by Roger Greenwood on December 04, 2007 at 09:07 AM CET #
The plan is to support this feature for the ODF file format.
Posted by Thomas Benisch on December 04, 2007 at 09:12 AM CET #
will this also fix the file locking issues for writer and other components of OOo? Which target milestone do you think is possible?
Posted by Christoph Lutz on December 04, 2007 at 04:32 PM CET #
Hopefully various file locking issues of OpenOffice.org are solved with writing a lock file next to the document. We will try to have this feature in OOo 3.0, but I don't want to promise anything. One never knows how many problems we have to solve.
Posted by Thomas Benisch on December 04, 2007 at 04:44 PM CET #
Just want to clarify a bit here.
User1>opens doc.
their temp file is created
User2>opens doc.
their temp file is created
? will the original user get any type of notification?
User1>closes file
user1 temp file is merged with original file asking to accept or reject changes.
User2>close file
temp file is merged with the new shared file, and is asked to accept or reject changes showing the data that user 1 entered, not the original data, if they both changed a cell.
Posted by Shari Smith on December 21, 2007 at 10:08 PM CET #
Sounds like a good first step. I think that the restrictions noted are significant. Is the temp file merged with the original file each time the user saves it, or only when the user closes the file? You could end up with multiple users making frequent saves, each overlapping and therefore each getting prompted to accept or reject another user's intermediate save. Good luck.
Posted by Jim Baldauf on December 22, 2007 at 02:09 AM CET #