convert document on open
Oxygen general issues.
-
- Posts: 2
- Joined: Mon Jun 10, 2013 1:04 pm
convert document on open
We want Oxygen to automatically transform a xml document to another structure on opening it in Author.
After editing, on saving, Oxygen must then reconvert the document to its original structure.
How can we achieve this?
After editing, on saving, Oxygen must then reconvert the document to its original structure.
How can we achieve this?
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: convert document on open
Hi,
Could you elaborate a bit on the use-case?
One possibility would be to implement a custom protocol plugin using our Plugins SDK:
http://www.oxygenxml.com/oxygen_sdk.htm ... er_Plugins
The SDK contains a sample custom protocol implementation called "cproto" which wraps over existing local files and adds a special "Browse" action to the toolbar. So you could take a look at that.
Basically you would implement an URL Handler for URLs like "cproto://path/to/file.xml". When opening such an URL Oxygen would call you to obtain an input stream for it and when saving Oxygen would call you to save the edited content and you could save something else in the actual file.
Other possible alternatives:
Implement an Open Redirect plugin extension (sample also in the Plugins SDK). Basically when Oxygen would want to open the file from the local disk you could intercept that and request Oxygen to open a different file (for example a temporary file dynamically created by you in the same folder with the modified XML content). Then on save, if you implement a Workspace Access plugin type you could add a save listener on each opened editor and receive events that the document has been saved. Then you would take the content of the temporary file, convert it and save it over the original file.
Regards,
Radu
Could you elaborate a bit on the use-case?
One possibility would be to implement a custom protocol plugin using our Plugins SDK:
http://www.oxygenxml.com/oxygen_sdk.htm ... er_Plugins
The SDK contains a sample custom protocol implementation called "cproto" which wraps over existing local files and adds a special "Browse" action to the toolbar. So you could take a look at that.
Basically you would implement an URL Handler for URLs like "cproto://path/to/file.xml". When opening such an URL Oxygen would call you to obtain an input stream for it and when saving Oxygen would call you to save the edited content and you could save something else in the actual file.
Other possible alternatives:
Implement an Open Redirect plugin extension (sample also in the Plugins SDK). Basically when Oxygen would want to open the file from the local disk you could intercept that and request Oxygen to open a different file (for example a temporary file dynamically created by you in the same folder with the modified XML content). Then on save, if you implement a Workspace Access plugin type you could add a save listener on each opened editor and receive events that the document has been saved. Then you would take the content of the temporary file, convert it and save it over the original file.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Mon Jun 10, 2013 1:04 pm
Re: convert document on open
Hi Radu,
Thanks for your quick reply.
Basically users will:
a. browse a filesystem to select an existing xml document
b. create a new xml-document and save to filesystem.
In both cases, the xml content structure of the editable document is different from the document which is opened/saved, in order to maximize a userfriendly experience.
If I understand you correctly, there are several ways to achieve our goal.
I'll contact our developers and share your suggestions with them.
Regards,
Thanks for your quick reply.
Basically users will:
a. browse a filesystem to select an existing xml document
b. create a new xml-document and save to filesystem.
In both cases, the xml content structure of the editable document is different from the document which is opened/saved, in order to maximize a userfriendly experience.
If I understand you correctly, there are several ways to achieve our goal.
I'll contact our developers and share your suggestions with them.
Regards,
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