Realtime WYSIWYG Editor

Last modified by Admin on 2024/10/28 17:53

pencilAdds support for real-time WYSIWYG (rich-text) editing in XWiki.
TypeXAR
CategoryOther
Developed by

XWiki Development Team

Active Installs11
Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Standard (16.2.0RC1+)

Compatibility

Since 13.9RC1

Installable with the Extension Manager

Description

Adds support for real-time WYSIWYG (rich-text) editing in XWiki. It provides a CKEditor plugin that performs real-time synchronization of the edited content between the users editing the same wiki page.

realtimeWysiwygEditor.png

The editor is using the Netflux API for real-time communication between the users participating in the editing session, and the ChainPad algorithm to ensure convergence between the changes made by each user. The actual rich text editing is done with the help of the CKEditor Integration.

This editor supersedes the Visual Realtime Collaborative Editor extension.

Usage

Real-time WYSIWYG editing is implemented as a CKEditor plugin that is bundled in XWiki Standard and XWiki 16.9.0+ enabled by default. If you upgrade from an older version of XWiki where the CKEditor configuration has been customized from the wiki administration, or XWiki 16.2.0+ if you use an older version of XWiki, you can enable real-time editing by unchecking the "xwiki-realtime" plugin from the list of "Disabled Plugins" in the CKEditor administration section, and save.

XWiki <16.2.0 Note that the Realtime WYSIWYG Editor was initially implemented as a separate editor that you had to bind to the wiki syntax data type in order to use it. You could do that from the "Editing / WYSIWYG Editor" administration section by changing the "Default WYSIWYG Editor".

Rendering Macros

XWiki 16.2.0+

Rendering macro output is not synchronized between editors because it may differ from user to user (e.g. based on the current user access rights). We synchronize the macro parameters (and content) and the macro is re-rendered (server-side) whenever they change. In other words, when a remote change is received:

  • if it inserts a new macro call or if it modifies any of the existing macro parameters (including content) that are not editable inline then we re-render the entire content
  • otherwise we just apply the change client-side

Note that modifying macro parameters inline doesn't trigger a re-render of the content. On the other hand, modifying macro parameters through the Macro Wizard modal will trigger a re-render for all the other users participating in the realtime session.

Script Macros

XWiki 15.10.12+, 16.4.1+, 16.6.0+

Although you can insert script macros (e.g. Velocity) while editing in realtime, they will not necessarily be executed with your (the current user) rights, but rather with the rights of the co-editor with the least script access rights that made the most recent change in the current realtime session. Basically, the realtime WYSIWYG editor keeps track of all the users that have made changes in the current realtime session (even if they left), and from this it remembers the last author with the least script access rights, setting it as effective author when re-rendering or saving the content. Let's give an example:

  • Take 3 users: Alice (programming right), Bob (script right), Carol (no script right)
  • Page "Test" was last saved by Alice, so with programming right
  • Bob and Carol edit the "Test" page in realtime
  • Bob inserts a script macro
    • Bob becomes the last author with the least script rights (effective author of the realtime session)
    • the script macro is executed twice:
      • once for Bob, with only script right
      • once for Carol, without script right (so the script macro execution fails), because although Carol hasn't made any changes yet, the script macro is executed on her behalf, and she has less script rights than the current effective author of the realtime session
  • Carol types some text => becomes the new effective author of the realtime session
  • Bob edits the script macro => Carol remains effective author of the realtime session because she has less script access rights.
    • the script macro is executed twice:
      • once for Bob, without script right (so the script macro execution fails) because Carol, the current effective author of the realtime session, doesn't have script right
      • once for Carol, without script right (so the script macro execution fails) because she is the current effective author of the realtime session, and she doesn't have script right
  • Carol leaves the realtime session
  • Bob edits the script macro again => Carol remains effective author of the realtime session even if she left
    • the script macro is executed once, for Bob, without script right, so it fails, because the current effective author of the realtime session is still Carol

Wiki Syntax Source

XWiki 15.10.12+, 16.4.2+, 16.6.0+, 16.7.0+

Editing directly the source wiki syntax is now possible by clicking the Source button. When editing the source wiki syntax, the realtime session is interrupted temporarily. Once the user is done editing the source wiki syntax, the editor re-joins the realtime session automatically if it is safe to do so.
If the user wants to re-join the realtime session anyway, they can click the "Allow Realtime" Checkbox.

Limitations

Here's a list of known limitations:

  • XWiki <15.10.12, <16.4.2, <16.6.0, <16.7.0 Editing directly the source wiki syntax is disabled for now as it can create problems. See XWIKI-20191.
  • Changes made outside the real-time session can lead to a merge conflict when auto-save is performed, which sometimes needs to be fixed manually. See XWIKI-21554.
  • The autosave groups changes made by multiple users and gives credit to only one of them.
    • You can't know, by looking at the document history, what changes each user has made in the realtime session
    • The document history doesn't show all the users that made changes during a realtime session because the autosave is triggered randomly for any of the users that make changes (and the user for which the autosave is triggered is recorded as author in the document history).
  • Auto-save can create lots of document revisions (even though it is triggered only when there are unsaved changes).
  • Undo / redo is not limited to the current user changes (it takes into account all changes made to the edited document, by all users). See XWIKI-22217.
  • Clustering is currently not supported.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Dependencies

Dependencies for this extension (org.xwiki.platform:xwiki-platform-realtime-wysiwyg-ui 16.9.0):

Get Connected