Apache OpenOffice (AOO) Bugzilla – Issue 32784
Document Model Changes should fire Events
Last modified: 2013-02-24 21:06:42 UTC
Trying to use OpenOffice.org as a Client for Collaborative Editing of Text Documents, I missed a possibility to register something like a ChangeListener to the Document Model. I was able to write a Proof-of-Concept loading a Document from a Collaborative Editing Server (a research project of my university), and then keeping the different Document Models on the Server and on the Client (OOo) in sync by monitoring user input with a com.sun.star.awt.XKeyHandler and updating the OOo Document Model with com.sun.star.text.XTextCursor. But monitoring every possible user interaction is an ugly way to do it, and leads to a lot of work being done twice. Therefore, it would be nice to be able to register a ChangeListener to the Document Model, which would send Events on changes to the Model only. There are several Universities researching in the field of Collaborative Editing, so I guess it would help others as well. Using OpenOffice.org as a Client is very attractive, since it provides most of the Client Funcionality "for free".
SW->f_specker: what is wrong with the css.util.XModifyBroadcaster that can be queried at the document and enables you to add a ModifyListener ?
With a ModifyListener, I only get informed that something has changed, but not what the actual change was (please correct me if I'm wrong). What I would like is to query the EventObject about the change, so I don't have to search the whole Document Model to find out what has changed. Something like "inserted Char 'a' at position 527" or "changed style of paragraph 3 to 'Headline'" would be a killer. Sorry I didn't write it that clear the first time. <background> In the project I'm woking on, documents are stored on the server side, with clients connected either synchronously or asynchronously. In synchronous mode, every user interaction is directly written down to the server. In async mode, these change propagations are grouped to reduce network load and latency. But even in async mode, it is neccessary to monitor every change to the document model on the client side. Since there might be a lot of changes within a short period of time (e.g. fast typing), every millisecond needed to monitor these changes counts. An EventObject that describes the actual change would help a lot to reduce the overhead of this monitoring. </background>
sounds like a reasonable feature :-)