How to save xml using oxygen aplet
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 1
- Joined: Tue Jul 22, 2014 8:53 am
How to save xml using oxygen aplet
Hi,
We have setup oxygen applet in our local system and deploy in tomcat. We want to save xml after edit xml by using applet.
http://www.oxygenxml.com/demo/AuthorDem ... -dita.html
In Frequently Asked Questions they are given below comments
"The save operation could be implemented either in Javascript by requesting the XML content from the Applet or in Java directly working with the Author component. You would be responsible to send the content back to the CMS."
How to implement these in our oxygen applet. Sample code would be more helpful.
Regards,
Mohd Masroor
We have setup oxygen applet in our local system and deploy in tomcat. We want to save xml after edit xml by using applet.
http://www.oxygenxml.com/demo/AuthorDem ... -dita.html
In Frequently Asked Questions they are given below comments
"The save operation could be implemented either in Javascript by requesting the XML content from the Applet or in Java directly working with the Author component. You would be responsible to send the content back to the CMS."
How to implement these in our oxygen applet. Sample code would be more helpful.
Regards,
Mohd Masroor
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: How to save xml using oxygen aplet
Post by alex_jitianu »
Hello,
First of all, using EditorComponentProvider.getWSEditorAccess() you get access to the following API:
1. ro.sync.exml.workspace.api.editor.WSEditorBase.save() - this methods opens an output stream to the URL of the editor and saves in it. The protocol must support output writing. You said you have deployed the applet inside a Tomcat server. Does the edited files come from the same server? As far as I know Tomcat supports WebDAV. If these files are hadled by Tomcat's WebDAV servlet, then just by using this WSEditor.save() API you will save the document.
2. ro.sync.exml.workspace.api.editor.WSEditorBase.createContentReader() and ro.sync.exml.workspace.api.editor.WSEditorBase.createContentInputStream()
2.1 You can use this API from the Java code. Maybe from an action on the toolbar. What you do next with the reader is up to you. Maybe use a PHP script to upload the content to the server. For example something like:
http://bytes.com/topic/java/answers/720 ... quest-java
Or maybe just use the PUT method over HTTP.
2.2 You can create a method in your javax.swing.JApplet implementation that uses these methods and returns the content as a String. Next, by Invoking Applet Methods From JavaScript Code you can write Java script that invokes this method, gets the content and does something with it. Maybe on the Tomcat server you have a Servlet that can save a resource. In this case you could use an AJAX request to send data to the servlet.
Best regards,
Alex
First of all, using EditorComponentProvider.getWSEditorAccess() you get access to the following API:
1. ro.sync.exml.workspace.api.editor.WSEditorBase.save() - this methods opens an output stream to the URL of the editor and saves in it. The protocol must support output writing. You said you have deployed the applet inside a Tomcat server. Does the edited files come from the same server? As far as I know Tomcat supports WebDAV. If these files are hadled by Tomcat's WebDAV servlet, then just by using this WSEditor.save() API you will save the document.
2. ro.sync.exml.workspace.api.editor.WSEditorBase.createContentReader() and ro.sync.exml.workspace.api.editor.WSEditorBase.createContentInputStream()
2.1 You can use this API from the Java code. Maybe from an action on the toolbar. What you do next with the reader is up to you. Maybe use a PHP script to upload the content to the server. For example something like:
http://bytes.com/topic/java/answers/720 ... quest-java
Or maybe just use the PUT method over HTTP.
2.2 You can create a method in your javax.swing.JApplet implementation that uses these methods and returns the content as a String. Next, by Invoking Applet Methods From JavaScript Code you can write Java script that invokes this method, gets the content and does something with it. Maybe on the Tomcat server you have a Servlet that can save a resource. In this case you could use an AJAX request to send data to the servlet.
Best regards,
Alex
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