Detect switch to EDIT_AS_XML_DESCRIPTION action
Posted: Fri Jan 10, 2025 7:51 pm
Hello,
We use Author web in version 27.0.0, and we are looking for an equivalent of the method :
For our desktop version, with oxygen sdk, we use this to update our available actions if we are in Author or Text mode.
I tried to add it this way :
With WSEditorSwitchTabListener extends WSEditorListener and S1000DWorkspaceAccessPluginExtension added in plugin.xml file
The listener is well added to documentModel.getWSEditor() but it does not work.
I try to find the event listener to handle it like that in javascript
But I did not find the good EventType.
Can you tell me how to do it properly ?
Thank you
Regards,
Isabelle
We use Author web in version 27.0.0, and we are looking for an equivalent of the method :
Code: Select all
WSEditorPageChangedListener.editorPageChanged
I tried to add it this way :
Code: Select all
public class S1000DWorkspaceAccessPluginExtension implements WorkspaceAccessPluginExtension {
@Override
public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess) {
WebappPluginWorkspace workspace = (WebappPluginWorkspace) pluginWorkspaceAccess;
workspace.addEditingSessionLifecycleListener(new WebappEditingSessionLifecycleListener() {
@Override
public void editingSessionStarted(String sessionId, AuthorDocumentModel documentModel) {
documentModel.getWSEditor().addEditorListener(new WSEditorSwitchTabListener(documentModel));
}
});
}
@Override
public boolean applicationClosing() {
return true;
}
}
Code: Select all
<extension type="WorkspaceAccess" class="com._4dconcept.adam.author.web.s1000d.plugin.extension.S1000DWorkspaceAccessPluginExtension"/>
I try to find the event listener to handle it like that in javascript
Code: Select all
goog.events.listen(workspace, sync.api.Workspace.EventType.EDITOR_LOADED, function (e) {
let editor = e.editor;
let editingSupport = editor.getEditingSupport();
if (editingSupport.getType() === sync.api.Editor.EditorTypes.TEXT) {
clearActions();
}
Can you tell me how to do it properly ?
Thank you
Regards,
Isabelle