How to listen to sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED event ?

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
Vince
Posts: 64
Joined: Wed Dec 03, 2014 11:25 am

How to listen to sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED event ?

Post by Vince »

Hello,

I try to customize Web Author listening the event sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED in my-framework.js :

Code: Select all

goog.events.listen(workspace, sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED, (e) => {
    console.info("extension enabled");
});
This code doesn' work.

If I listen to sync.api.Workspace.EventType.EDITOR_LOADED, it works

Code: Select all

goog.events.listen(workspace, sync.api.Workspace.EventType.EDITOR_LOADED, (e) => {
    console.info("extension enabled");
});
Why ?

I follow this guide : https://www.oxygenxml.com/doc/versions/ ... ing-option
I'm using oxygen web author version 25.1.0

Regards,
Vincent
cristi_talau
Posts: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to listen to sync.api.Workspace.EventType.BEFORE_EDITOR_LOADED event ?

Post by cristi_talau »

Hello,
The order of events during editor loading is the following:
  • BEFORE_EDITOR_LOADED is dispatched
  • File content is read from the file server
  • Framework is determined based on the content of the file
  • JavaScript code from the framework is loaded
  • EDITOR_LOADED_EVENT is dispatched
If you want to listen to BEFORE_EDITOR_LOADED you can use a plugin. The code from plugins is loaded when the application starts.

Best,
Cristian
Post Reply