Periodic refresh / reload of DITA Maps during background downloads – validation errors remain until manual F5
Oxygen general issues.
-
KevinGarcia99
- Posts: 5
- Joined: Fri Nov 11, 2022 7:48 pm
Periodic refresh / reload of DITA Maps during background downloads – validation errors remain until manual F5
Post by KevinGarcia99 »
Hello Oxygen team,
I’m working on an Oxygen plugin that downloads a large number of DITA resources (topics, maps, .met files) into the local project incrementally, while a root DITA map is already open in the editor.
Problem -
Even though:
Those errors disappear only after the user manually presses
File → Reload (F5).
During downloads, I experimented with several refresh approaches:
Thank you
I’m working on an Oxygen plugin that downloads a large number of DITA resources (topics, maps, .met files) into the local project incrementally, while a root DITA map is already open in the editor.
Problem -
Even though:
- all referenced files eventually exist locally,
- .met files are created,
- file actions become enabled (check-in / checkout),
- references actually resolve correctly on disk,
Those errors disappear only after the user manually presses
File → Reload (F5).
During downloads, I experimented with several refresh approaches:
- PluginWorkspace.refreshInProject(...)
- WSDITAMapEditorPage.refreshReferences()
- Closing and reopening editors
- Invoking the global File/Reload action programmatically
Thank you
-
Radu
- Posts: 9629
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Periodic refresh / reload of DITA Maps during background downloads – validation errors remain until manual F5
Hi,
We do not have a lightweight approach to go about this.
Did the "WSDITAMapEditorPage.refreshReferences()" work for you? If not then indeed you can try re-opening the file or use "ro.sync.exml.workspace.api.editor.WSEditor.reload()".
Regards,
Radu
We do not have a lightweight approach to go about this.
Did the "WSDITAMapEditorPage.refreshReferences()" work for you? If not then indeed you can try re-opening the file or use "ro.sync.exml.workspace.api.editor.WSEditor.reload()".
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
KevinGarcia99
- Posts: 5
- Joined: Fri Nov 11, 2022 7:48 pm
Re: Periodic refresh / reload of DITA Maps during background downloads – validation errors remain until manual F5
Post by KevinGarcia99 »
Hey,
Thank you, Radu, for your response on this.
I did try using refreshReferences(), but it doesn't work. Same goes for editor.reload().
Please let me know if we have other options for reload.
Thanks
Thank you, Radu, for your response on this.
I did try using refreshReferences(), but it doesn't work. Same goes for editor.reload().
Please let me know if we have other options for reload.
Thanks
-
Radu
- Posts: 9629
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Periodic refresh / reload of DITA Maps during background downloads – validation errors remain until manual F5
Hi Kevin,
The editor.reload works for me, here's some code from the sample Oxygen plugin I implemented:
I tested and using instead of the "currentDMMEditor.reload();" API above the code:
also works for me.
Here's how I test:
1) I have in the DITA Maps Manager a sample DITA Map opened with some topic references.
2) In the Finder/Windows Explorer I rename one of the referenced topics.
3) Back in Oxygen I press F5 in the DITA Maps Manager and it starts reporting the error.
4) I rename in the Finder/Windows Explorer the topic back to its original name.
5) Back in Oxygen I call the menu item that I added an the reference refreshes and the error is no longer present.
Regards,
Radu
The editor.reload works for me, here's some code from the sample Oxygen plugin I implemented:
Code: Select all
@Override
public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess) {
pluginWorkspaceAccess.addMenuBarCustomizer(new MenuBarCustomizer() {
@Override
public void customizeMainMenu(JMenuBar mainMenu) {
JMenu test = new JMenu("Test");
test.add(new AbstractAction("Refresh DMM") {
@Override
public void actionPerformed(ActionEvent e) {
WSEditor currentDMMEditor = pluginWorkspaceAccess.getCurrentEditorAccess(PluginWorkspace.DITA_MAPS_EDITING_AREA);
currentDMMEditor.reload();
}
});
mainMenu.add(test);
}
});
}Code: Select all
WSDITAMapEditorPage dmm = (WSDITAMapEditorPage) currentDMMEditor.getCurrentPage();
dmm.refreshReferences();Here's how I test:
1) I have in the DITA Maps Manager a sample DITA Map opened with some topic references.
2) In the Finder/Windows Explorer I rename one of the referenced topics.
3) Back in Oxygen I press F5 in the DITA Maps Manager and it starts reporting the error.
4) I rename in the Finder/Windows Explorer the topic back to its original name.
5) Back in Oxygen I call the menu item that I added an the reference refreshes and the error is no longer present.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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