Cannot save documents opened in Oxygen author component
Oxygen general issues.
-
- Posts: 24
- Joined: Tue Jun 05, 2012 10:34 am
Cannot save documents opened in Oxygen author component
Hi again,
I have some troubles using oxygen author component (AuthorComponentProvider), i can't save documents using keyboard action CTRL+S.
I have implemented a custom action (with CTRL+S mnemonic) accessible in a toolbar to save the content of my document, this works fine only if the cursor is outside my document content.
Otherway, if the cursor is inside my document content (ie : in oxygen component), this seems the action is handled by something else (i think this is something from oxygen), and this throws me the error : "Cannot save the file. protocol doesn't support output"
I load my document using this code coming from demo :
When i open a document, the arguments values are :
xmlSystemId = file:/C:/authorNeo/DM-Sample/A350/DMC-BRAKE-AAA-DA1-00-00-00AA-041A-A_001-00_EN-US.XML
xmlContent = null
Is there anything i'm doing wrong?
I have some troubles using oxygen author component (AuthorComponentProvider), i can't save documents using keyboard action CTRL+S.
I have implemented a custom action (with CTRL+S mnemonic) accessible in a toolbar to save the content of my document, this works fine only if the cursor is outside my document content.
Otherway, if the cursor is inside my document content (ie : in oxygen component), this seems the action is handled by something else (i think this is something from oxygen), and this throws me the error : "Cannot save the file. protocol doesn't support output"
I load my document using this code coming from demo :
Code: Select all
private void setDocument(final String xmlSystemId, final Reader xmlContent)
throws AuthorComponentException {
final Exception[] ex = new Exception[1];
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
// Installs a document modification listener.
try {
authorComponent
.load((xmlSystemId != null && xmlSystemId.trim()
.length() > 0) ? new URL(xmlSystemId)
: null, xmlContent);
} catch (Exception e) {
ex[0] = e;
}
return null;
}
});
if (ex[0] != null) {
throw new AuthorComponentException(ex[0]);
}
}
xmlSystemId = file:/C:/authorNeo/DM-Sample/A350/DMC-BRAKE-AAA-DA1-00-00-00AA-041A-A_001-00_EN-US.XML
xmlContent = null
Is there anything i'm doing wrong?
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Cannot save documents opened in Oxygen author component
Hi Benoit,
Here's the problem:
The action map of the Author swing component contains a binding for the component's own "save" operation. When the focus is in the component, that action is called instead of yours.
We'll remove in the next version of the component the binding of the save action from the component code. In the meantime, you can remove the action from the action map using the code:
Actually the default "save" would work quite nicely but Oxygen saves to a resource by opening an URL connection like and the default SUN implementation for the "file" URL protocol does not allow saving to it. In a standalone version of Oxygen the SUN "file" protocol handler is overwritten by ours and it works there but for the component we do not overwrite any installed URL stream handlers.
Regards,
Radu
Here's the problem:
The action map of the Author swing component contains a binding for the component's own "save" operation. When the focus is in the component, that action is called instead of yours.
We'll remove in the next version of the component the binding of the save action from the component code. In the meantime, you can remove the action from the action map using the code:
Code: Select all
JPanel panel = (JPanel) authorComponentProvider.getEditorComponent();
panel.getActionMap().remove("File__File_Save");
Code: Select all
new URL("file://path/.../to.xml").openConnection().getOutputStream()....
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Cannot save documents opened in Oxygen author component
Hi Benoit,
Yes it will. We plan to release 14.2 in February (in a couple of weeks).
The most important component improvement in 14.2 will be that it will be possible to edit XML content with the component in multiple pages (Text/Grid/Author). Of course the API will allow the developer to decide the pages that should be used for this.
Regards,
Radu
Yes it will. We plan to release 14.2 in February (in a couple of weeks).
The most important component improvement in 14.2 will be that it will be possible to edit XML content with the component in multiple pages (Text/Grid/Author). Of course the API will allow the developer to decide the pages that should be used for this.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 24
- Joined: Tue Jun 05, 2012 10:34 am
Re: Cannot save documents opened in Oxygen author component
I've just seen your reply, this is a really good news! really awesome!
We had this requirement in our roadmap, i hope it will be quite easy for us to integrate this nice improvement.
Thanks for your good support,
Benoît
We had this requirement in our roadmap, i hope it will be quite easy for us to integrate this nice improvement.
Thanks for your good support,
Benoît
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