Issue 32784 - Document Model Changes should fire Events
Summary: Document Model Changes should fire Events
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P5 (lowest) Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-10 14:21 UTC by f_specker
Modified: 2013-02-24 21:06 UTC (History)
1 user (show)

See Also:
Issue Type: FEATURE
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description f_specker 2004-08-10 14:21:36 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".
Comment 1 stephan.wunderlich 2004-08-11 09:42:24 UTC
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 ?
Comment 2 f_specker 2004-08-11 11:22:37 UTC
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>
Comment 3 stephan.wunderlich 2004-08-11 15:11:28 UTC
sounds like a reasonable feature :-)