Realtime WYSIWYG Editor
| Adds support for real-time WYSIWYG (rich-text) editing in XWiki. |
| Type | XAR |
| Category | Other |
| Developed by | |
| Active Installs | 6 |
| Rating | |
| License | GNU Lesser General Public License 2.1 |
| Bundled With | XWiki Standard (16.2.0RC1+) |
| Compatibility | Since 13.9RC1 |
Table of contents
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.

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.
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".
Realtime toolbar
XWiki 17.3.0+, 16.10.6+
When editing in realtime, the standard form action toolbar is replaced with the dedicated realtime editing toolbar which provides the following features:
- the Done button allows you to save and return to view mode; XWiki 17.9.0+, 17.4.7+, 16.10.13+ there is no revision created if there are no content changes, meaning that the user is taken to view mode without saving if the content has not been modified since the last (auto)save; the Done button is followed by a dropdown menu that allows you to:
- summarize your changes before saving and returning to view mode
- leave the realtime collaboration
- the connection status, visible only while (re)connecting to the realtime session or when disconnected
- the list of users collaborating on the same page (visible only when connected to the realtime session)
- the autosave status
- the Recent Versions dropdown, which provides the option to summarize and save intermediary (milestone) versions

Summarize Changes
XWiki 17.3.0+, 16.10.6+
Both the Done dropdown menu and the Recent Versions dropdown menu provide an entry to summarize the changes, if version summaries are enabled from the wiki administration (which is the default). The difference is:
- Summarize & Done: summarize the changes and return to view mode; you can also choose to end the editing with a minor or major version (if minor edits are enabled from the wiki administration, which is the default)
- Summarize Changes: summarize the changes and continue editing

The Changes tab is there to help you review and summarize the changes.

Collaborators
XWiki 17.3.0+, 16.10.6+ The first 4 collaborators are listed directly on the toolbar, while the rest are available in a dropdown menu. For each collaborator we show the user avatar and the username abbreviation. You can click on a collaborator to see where that user is typing (the content is scrolled to that location).
Autosave
XWiki 17.3.0+, 16.10.6+
The autosave status displayed on the realtime editing toolbar has 3 possible states:
- Unsaved: when there are unsaved changes
- Saving: when the content is currently being saved
- Saved: when there are no unsaved changes
The autosave is always enabled when editing in realtime. Changes are saved once per minute, approximately. The autosave is performed on behalf of one of the users that made changes since the last save (chosen randomly). This user becomes the author of the created page revision, that you can see in the page history. Check the Limitations section below for additional information.
XWiki 17.9.0+, 17.4.6+, 16.10.13+
If you have unsaved changes, because the autosave hasn't been triggered yet, and you:
- navigate to a different page
- or close the current browser tab or window
- or switch to a different browser tab or window (especially on mobile devices)
then the editor will make sure those changes are:
- pushed to the other collaborators that remain in the realtime editing session, so the autosave can be triggered for them
- and also preserved in the browser's session storage, so that they can be restored when you get back
Note that the page you stopped editing can later diverge from the local unsaved changes that are kept in your browser's session storage, which is why the editor will try to integrate those unsaved changes next time you edit again that page, by doing a 3-way merge. This merge can sometimes fail, when there is a conflict, in which case your unsaved changes will be lost. For this reason it's best if you use the Done button to leave the editing session.
Recent Versions
XWiki 17.3.0+, 16.10.6+
You can select a version from the "Recent Versions" dropdown to see how the content looked like in that version.

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
- the script macro is executed twice:
- 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.
Enabling / Disabling
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.
Similarly, if you need to disable it, you can check the "xwiki-realtime" plugin from the list of "Disabled Plugins" in the CKEditor administration section, and save.
Limitations
Here's a list of known limitations:
- 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).
- XWiki <15.10.12, <16.4.2, <16.6.0, <16.7.0 Editing directly the source wiki syntax was not supported and disabled
- XWiki <16.10.16, <17.4.8, <17.10.2 Undo / redo was not limited to the current user changes (it took into account all changes made to the edited document, by all users). See XWIKI-22217.
- XWiki <16.10.16, <17.4.8, <17.10.1 Clustering was not supported. The workaround was to disable the Realtime feature.
Troubleshooting
Failing to connect to the editing session
Realtime editing uses WebSockets to synchronize the changes. If you have an HTTP proxy in front of XWiki you need to make sure the proxy is properly forwarding the WebSocket requests (e.g. ws://<server>/xwiki/websocket/xwiki/netflux) to XWiki. You can find some sample HTTP proxy configuration in the Administration Guide.
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:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Prerequisites
The realtime synchronization is performed through a WebSocket connection which means you need to make sure that:
- the servlet engine running XWiki supports WebSocket connections (JSR 356)
- the proxy in front of the servlet engine properly forwards WebSocket upgrade requests; see for instance:
Dependencies
Dependencies for this extension (org.xwiki.platform:xwiki-platform-realtime-wysiwyg-ui 18.4.0):
- org.xwiki.platform:xwiki-platform-realtime-ui 18.4.0
- org.xwiki.platform:xwiki-platform-rendering-macro-velocity 18.4.0
- org.xwiki.platform:xwiki-platform-rendering-macro-include 18.4.0
- org.xwiki.platform:xwiki-platform-uiextension-api 18.4.0
- org.xwiki.platform:xwiki-platform-edit-default 18.4.0
- org.xwiki.platform:xwiki-platform-webjars-api 18.4.0
- org.xwiki.platform:xwiki-platform-skin-skinx 18.4.0
- org.webjars:requirejs 2.3.7
- org.xwiki.platform:xwiki-platform-realtime-wysiwyg-webjar 18.4.0