Is it possible to get Oxygen XML Editor to update the revised date on a DITA document when it's saved?
The Plugins SDK: http://www.oxygenxml.com/oxygen_sdk.html#Developer_Plugins contains a sample Plugin Type called WorkspaceAccess.Such a plugin is notified when the application starts.
@Override public void applicationStarted(final StandalonePluginWorkspace pluginWorkspaceAccess) { pluginWorkspaceAccess.addEditorChangeListener(new WSEditorChangeListener(){ //An editor was opened @Override public void editorOpened(URL editorLocation) { final WSEditor editorAccess = pluginWorkspaceAccess.getEditorAccess(editorLocation, PluginWorkspace.MAIN_EDITING_AREA); if(editorAccess != null){ editorAccess.addEditorListener(new ro.sync.exml.workspace.api.listeners.WSEditorListener(){ //Editor is about to be saved @Override public boolean editorAboutToBeSavedVeto(int operationType) { if(EditorPageConstants.PAGE_AUTHOR.equals(editorAccess.getCurrentPageID())){ WSAuthorEditorPage authorPage = (WSAuthorEditorPage) editorAccess.getCurrentPage(); AuthorDocumentController controller = authorPage.getDocumentController(); try { //Find the revised element AuthorNode[] nodes = controller.findNodesByXPath("//revised", true, true, true); if(nodes != null && nodes.length > 0){ AuthorElement revised = (AuthorElement) nodes[0]; //Set the modified attribute to it... controller.setAttribute("modified", new AttrValue(new Date().toString()), revised); } } catch (AuthorOperationException e) { e.printStackTrace(); } } //And let the save continue.. return true; } }); } } }, PluginWorkspace.MAIN_EDITING_AREA); }