Image download from external source

<oXygen/> general issues.
sriram_l
Posts: 10

Image download from external source

Tue Jun 12, 2018 2:38 pm

Hi,
In Oxygen XML web Author, Is there a way to download image from external source? I tried using 'content' property of CSS by passing the absolute URL but this gets appended to the oxygen REST URL to fetch image cached.
cristi_talau
Posts: 168

Re: Image download from external source

Tue Jun 12, 2018 3:41 pm

Hello,

All images are downloaded using Web Author server as a proxy. So the URL of the image is appended to the REST URL and on the server it is extracted and downloaded and sent to the browser.

Are this images linked in the content, or are they just decorator images? If you are in the second case, a good idea would be to add them in the framework and refer them in CSS using a relative path to the CSS.

Best,
Cristian
sriram_l
Posts: 10

Re: Image download from external source

Thu Jun 14, 2018 12:41 pm

Hi Cristian,
The image is a linked in the content and I'm able to do link and display the image on editor.

but what about REST calls to external systems. How can this be done?
cristi_talau
Posts: 168

Re: Image download from external source

Thu Jun 14, 2018 6:38 pm

Hello,

So you have an image which is refered from content and which needs to be retrieved over HTTP(s) from another Web/REST server. I created a sample here: https://www.oxygenxml.com/oxygen-xml-we ... -image.xml . This is a DITA topic that uses an image served by oxygenxml.com.

Some questions to clarify the problem:
1. Is this case what you had in mind?
2. What connector are you using: Git, Sharepoint, WebDAV, something else?
3. What is the status code displayed in Dev Tools for the request made to get the image?

Best,
Cristian
sriram_l
Posts: 10

Re: Image download from external source

Mon Jun 18, 2018 10:43 am

Hi,
I've achieved what you have given as sample by exposing an image from a web server and providing its link in the content and that displayed the image.

Please find below replies to your queries:
1. Is this case what you had in mind?
[]The problem that I'm trying to solve is - the image will be from another web application and they are exposing the image through a REST web service in a base64 format.
2. What connector are you using: Git, Sharepoint, WebDAV, something else?
[]It is a JEE web application with REST web service.
3. What is the status code displayed in Dev Tools for the request made to get the image?
[]The image is retrieved using CSS url and it is 400 but what I'm looking for is handling REST web service calls.

I'm looking for a way to make calls from Oxygen web Author to backend REST web service that will handle any type of data not just image. Do I need to write backend code to handle this if so how to do it.
cristi_talau
Posts: 168

Re: Image download from external source

Mon Jun 18, 2018 12:26 pm

Hello,

So you insert an <img href="..."/> that points to a REST service that returns the image in base64 format. There are two possible solutions:
1. Implement your REST endpoint to return a PNG/JPEG image when requested by Web Author (you can use the User-Agent to identify such requests).
2. Implement a plugin for Web Author to decode this kind of images. We have an example plugin that adds support for some exotic image formats here: https://github.com/oxygenxml/web-author-imageio-plugin . It uses third-party libraries but the main idea is to implement an ImageIO plugin and integrate it in Web Author.

I would recommend the first solution.

Best,
Cristian

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 4 guests