Dear Konstantin,
The Web Author client does not know that the server model has changed unless it asks for the specific information.
I have added an issue for your request and it should be available in the next maintenance build (about 3 weeks from now).
The new API will allow you to synchronize the content of the client with the content of the document from the server.
The API is already available in version 18 but it's
not documented and it
doesn't work with full-tags sentinels mode.
You can test it right now by calling the editor.restoreContent() method using javascript [1].
You can save a reference to the editor instance by listening for the EDITOR_LOADED event:
Code: Select all
(function () {
goog.events.listen(workspace, sync.api.Workspace.EventType.EDITOR_LOADED, function(e) {
// Save the editor for later use.
var editor = e.editor;
});
// At a later time, when you need to restore the content of the client editor, you can call:
try {
editor.restoreContent();
} catch (e) {
// Note: The method will throw a benign error in version 18 so you might want to wrap it inside a try-catch
}
})();
If you are developing a plugin for Web Author, you only need to add a javascript file to a web folder inside your plugin and it will be loaded into the Web Author.
[1] -
https://www.oxygenxml.com/maven/com/oxy ... index.html
Regards,
Gabriel