User intercation in custom protocol handler
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 1
- Joined: Thu Sep 28, 2017 5:04 pm
User intercation in custom protocol handler
I don't believe what I am about to describe is possible, but I'vbe been asked to try and implement it anyway, so a definative answer from you guys would be great.
I have a custom protocol handler that loads a file via a webservice when oxygen is opened with an appropriate URL. When the file is saved the custom protocol handler attepts to write the content back to the webservice. This will sometimes fail, e.g. if the server has gone down between openeidn and saving ghrt edocument. In these casees the handler creates a temporary local file and saves the updated document here. If the same document is later opened from the web service the the content of this local file is used by preference. This all worksa fine and has ssuccesfully be through test.
The users have now requested that when this local file is created, or used when opening a document, that a warning dialog be shown to the user. I don't believe that this is possible; can you either confirm this or give me some idea how I might go about it?
Many thanks,
I have a custom protocol handler that loads a file via a webservice when oxygen is opened with an appropriate URL. When the file is saved the custom protocol handler attepts to write the content back to the webservice. This will sometimes fail, e.g. if the server has gone down between openeidn and saving ghrt edocument. In these casees the handler creates a temporary local file and saves the updated document here. If the same document is later opened from the web service the the content of this local file is used by preference. This all worksa fine and has ssuccesfully be through test.
The users have now requested that when this local file is created, or used when opening a document, that a warning dialog be shown to the user. I don't believe that this is possible; can you either confirm this or give me some idea how I might go about it?
Many thanks,
-
- Posts: 9451
- Joined: Fri Jul 09, 2004 5:18 pm
Re: User intercation in custom protocol handler
Hi,
From the protocol handler you can show a warning dialog, for example you can do something like:
or use the usual swing "JOptionPane" to show the message. I used " SwingUtilities.invokeLater" because I did not want the dialog popping up and blocking the current thread operation.
Another possibility (only for the save operation) would be that when the save operation fails, you throw an IOException in your implementation of OutputStream in which Oxygen is writing content. And Oxygen will show an error when it catches the IOException on its side.
Regards,
Radu
From the protocol handler you can show a warning dialog, for example you can do something like:
Code: Select all
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace().showWarningMessage("Some message here");
}
});
Another possibility (only for the save operation) would be that when the save operation fails, you throw an IOException in your implementation of OutputStream in which Oxygen is writing content. And Oxygen will show an error when it catches the IOException on its side.
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