How to implement collaborative editing log recording

For instance, when multiple people are editing a document simultaneously, I want to keep track of who added or deleted what. Essentially, I’m aiming to track document changes. Would it be more feasible to achieve this by adding listeners in Python or by intercepting data with WebSockets on the frontend?

Which Approach is More Feasible?

  • Python Listeners (Backend): This is generally a safer and more stable approach if you have access to the Collabora Online backend or are comfortable working with PyUNO. It centralizes the change tracking and makes it easier to secure and store the logs. This approach is preferable in environments where you need control over the document lifecycle or want to ensure integrity.
  • WebSocket Interception (Frontend): This can be simpler to implement in environments where you don’t have backend access or if you want to quickly log changes made by multiple users in real time. However, security and performance concerns could arise in production settings.

Thanks,
Darshan

@darshan Thank you for your response. We prefer to implement using Python listeners (backend). However, when adding events such as XEventListener, XPasteListener, XModifyListener to the document (XSCRIPTCONTEXT.getDocument()), the event parameters do not provide specific change details, such as the content of the document before and after the modification. Could you please tell us from which object we can read this change information?

Did you see the built-in track changes functionality? See Track Changes

@vmiklos Thank you for your reply. This is the user’s operation document. Do you have any development documents? Which class interfaces can read this information?

The ultimate source of information when it comes to reading info with the UNO API is the ODF export in many cases. :slight_smile:

See the code around here: