Refresh Author/Save button via Java

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
aujunior
Posts: 43
Joined: Thu Feb 16, 2023 11:00 pm

Refresh Author/Save button via Java

Post by aujunior »

Hello,

We have implemented a scheduler in our framework to trigger an internal auto-save, allowing documents to be saved in our data management system.

This customization was necessary because Oxygen's autosave does not go through the editorAboutToBeSavedVeto event.

However, we encountered an issue with the "Author/Save" button. While the auto-save works correctly, the button remains enabled.

We attempted to use the DIRTY_STATUS listener, but when saving via Java, the frontend is not updated.

We would like to know if there is a way to set the DIRTY_STATUS via Java on the backend or if there is an option to update the "Author/Save" button status via Java.

Thank you in advance.
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: Refresh Author/Save button via Java

Post by mihaela »

Hello,

There is a JAVA API available to set the editor as "modified" or "not modified":
ro.sync.exml.workspace.api.editor.WSEditorBase.setModified(boolean) [1]

If you have access to the AuthorDocumentModel (model), here is how you can set the document as "not modified":

Code: Select all

 model.getAuthorAccess().getEditorAccess().setModified(false); 
[1] https://www.oxygenxml.com/InstData/Edit ... d(boolean)

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
Post Reply