Save to URL - REST Interface?
Are you missing a feature? Request its implementation here.
-
- Posts: 5
- Joined: Wed Apr 29, 2009 4:45 pm
Save to URL - REST Interface?
Post by ted.habermann »
Saw the "Save to URL" feature and was hoping for a REST interface... Just got FTP/DAV... Seems like there was a rest interface in the past??? Possible in the future?
-
- Posts: 2886
- Joined: Tue May 17, 2005 4:01 pm
Re: Save to URL - REST Interface?
Hello,
The 'Save to URL' has always been used for saving files to FTP/WebDAV repositories.
Can you provide more details as to what you were expecting regarding the REST interface?
Regards,
Adrian
The 'Save to URL' has always been used for saving files to FTP/WebDAV repositories.
Can you provide more details as to what you were expecting regarding the REST interface?
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 5
- Joined: Wed Apr 29, 2009 4:45 pm
Re: Save to URL - REST Interface?
Post by ted.habermann »
Adrian,
My understanding of this is a bit limited, but I would expect the interface to make a post request to a URL which would include the content of the XML. In general we would be doing this with small XML components...
This URL is a get request for a component:
http://www.ngdc.noaa.gov/docucomp/iso/8 ... 8C5AB460D1
we would like to get this URL, edit the XML, then put it back to the same URL...
Thanks,
Ted
My understanding of this is a bit limited, but I would expect the interface to make a post request to a URL which would include the content of the XML. In general we would be doing this with small XML components...
This URL is a get request for a component:
http://www.ngdc.noaa.gov/docucomp/iso/8 ... 8C5AB460D1
we would like to get this URL, edit the XML, then put it back to the same URL...
Thanks,
Ted
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Save to URL - REST Interface?
Post by sorin_ristache »
Such simple cases are already possible in Oxygen. The Open URL action allows you to get the content of that URL (a <gmd:CI_ResponsibleParty> element) and open it in an editor panel. When you want to save the modifications to the same URL just run the Save action from the toolbar button or from the shortcut Ctrl-S.ted.habermann wrote:This URL is a get request for a component:
http://www.ngdc.noaa.gov/docucomp/iso/8 ... 8C5AB460D1
we would like to get this URL, edit the XML, then put it back to the same URL...
Regards,
Sorin
-
- Posts: 5
- Joined: Sat May 08, 2010 12:15 am
Re: Save to URL - REST Interface?
Post by russ.baker »
I am the developer on this project. I'm trying to use a RESTful webservice to supply the xml and then consume it. When I was debugging my application, I clicked the "save" button, and then put breakpoints in my web service (basically an HttpServlet). The doPost method was not hit.
Is the "save" button process using a HTTP "POST" to the webservice, or what is it doing? I'm confused as to why I'm not seeing my servlet not being hit. Also, if I want to update the document, I want to be able to set values in the request header to let my RESTful webservice know what to do with the XML.
Thanks in advance
Is the "save" button process using a HTTP "POST" to the webservice, or what is it doing? I'm confused as to why I'm not seeing my servlet not being hit. Also, if I want to update the document, I want to be able to set values in the request header to let my RESTful webservice know what to do with the XML.
Thanks in advance
-
- Posts: 5
- Joined: Sat May 08, 2010 12:15 am
Re: Save to URL - REST Interface?
Post by russ.baker »
One more thing I forgot to mention. When I did use the "save" button, the response I got from Oxygen was "Cannot save file. 405 Method not allowed..." But I know that I can push xml to my url via a curl command. So I really need to know how the XML is getting pushed back to the URL that we got it from.
-
- Posts: 5
- Joined: Sat May 08, 2010 12:15 am
Re: Save to URL - REST Interface?
Post by russ.baker »
I had no trouble opening an XML document from my web service, but when I tried to run the Save action from the toolbar button, I got a "405 Bad Request" as a response. I had my debugger running on my web service that was accepting requests from the URL, and the request did not even make it to the web service.sorin wrote:Such simple cases are already possible in Oxygen. The Open URL action allows you to get the content of that URL (a <gmd:CI_ResponsibleParty> element) and open it in an editor panel. When you want to save the modifications to the same URL just run the Save action from the toolbar button or from the shortcut Ctrl-S.ted.habermann wrote:This URL is a get request for a component:
http://www.ngdc.noaa.gov/docucomp/iso/8 ... 8C5AB460D1
we would like to get this URL, edit the XML, then put it back to the same URL...
Regards,
Sorin
Is the XML sent as an HTTP POST, or is it using something else? If we're sending the XML to a RESTful web service, is there a way to place header values in the request?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Save to URL - REST Interface?
Post by sorin_ristache »
Hello,
Regards,
Sorin
The XML is sent as a HTTP PUT because it is a WebDAV client not a generic HTTP client. You can implement a small HTTP client that sends the request using HTTP POST as a custom protocol plugin that provides a Java URL handler for HTTP URLs.russ.baker wrote:Is the XML sent as an HTTP POST, or is it using something else? If we're sending the XML to a RESTful web service, is there a way to place header values in the request?
Regards,
Sorin
-
- Posts: 5
- Joined: Sat May 08, 2010 12:15 am
Re: Save to URL - REST Interface?
Post by russ.baker »
What I ended up doing was to implement the "doPut" method in my servlet, and I saw the request. Now the "doPut" method will handle my "update" requests from Oxygen.
So now that we have a way to open and update an xml file from a web service, can we implement the "doPost" method to insert a new XML document?
So now that we have a way to open and update an xml file from a web service, can we implement the "doPost" method to insert a new XML document?
-
- Posts: 5
- Joined: Sat May 08, 2010 12:15 am
Re: Save to URL - REST Interface?
Post by russ.baker »
I just ran a test to see how the XML is saved if we are trying to do an insert (new document saved to a url) and it looks like Oxygen uses the "PUT" method for inserts too.
I would like to tell the difference between the insert and update in my servlet, but I'm not seeing anything in the request that can help me. Can we use a different method (say POST) or again, put something in the request header so that we know that we are either doing an update or insert?
I would like to tell the difference between the insert and update in my servlet, but I'm not seeing anything in the request that can help me. Can we use a different method (say POST) or again, put something in the request header so that we know that we are either doing an update or insert?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Save to URL - REST Interface?
Post by sorin_ristache »
Hello,
The WebDAV client of Oxygen does not use the POST method because this method is not used by the WebDAV protocol. If you need POST you will have to implement an Oxygen plugin for your own custom protocol (for example rest:// or myHttp:// or russProto:// etc). It should be a Java protocol handler (implementation of java.net.URLStreamHandler) with a java.net.URLConnection implementation that connects to your HTTP server when asked to provide the input stream and output stream of a URL. Oxygen will get these input stream and output stream from the URL handler when a URL prefixed with the custom protocol is opened or saved in Oxygen.
Regards,
Sorin
The WebDAV client of Oxygen does not use the POST method because this method is not used by the WebDAV protocol. If you need POST you will have to implement an Oxygen plugin for your own custom protocol (for example rest:// or myHttp:// or russProto:// etc). It should be a Java protocol handler (implementation of java.net.URLStreamHandler) with a java.net.URLConnection implementation that connects to your HTTP server when asked to provide the input stream and output stream of a URL. Oxygen will get these input stream and output stream from the URL handler when a URL prefixed with the custom protocol is opened or saved in Oxygen.
Regards,
Sorin
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