Adding listener to save button
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 16
- Joined: Mon Jan 27, 2020 6:26 pm
Adding listener to save button
Hi,
I need to call a WS after each document saving. What is the best way to do it?
I found a WSEditorListener that provides editorSaved method. Should I create un plugin to implement it?
Should I be inspired by this plugin? -> https://github.com/oxygenxml/web-author ... sAccess.js
Regards.
Alper
I need to call a WS after each document saving. What is the best way to do it?
I found a WSEditorListener that provides editorSaved method. Should I create un plugin to implement it?
Should I be inspired by this plugin? -> https://github.com/oxygenxml/web-author ... sAccess.js
Regards.
Alper
-
- Posts: 16
- Joined: Mon Jan 27, 2020 6:26 pm
Re: Adding listener to save button
I solved my problem.
Best regards
Code: Select all
public class AfterSaveActionExtension implements WorkspaceAccessPluginExtension {
private static final Logger logger = LogManager.getLogger(AfterSaveActionExtension.class);
public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess) {
WebappPluginWorkspace ws = (WebappPluginWorkspace) pluginWorkspaceAccess;
ws.addEditingSessionLifecycleListener(new WebappEditingSessionLifecycleListener() {
@Override
public void editingSessionStarted(String id, AuthorDocumentModel model) {
model.getWSEditor().addEditorListener(new WSEditorSaveListener());
}
});
}
private final class WSEditorSaveListener extends WSEditorListener {
@Override
public void editorSaved(int var1) {
logger.info("Document saved. Ready to be sent to Manager.");
// TODO: Call manager WS
}
}
public boolean applicationClosing() {
return true;
}
}
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service