How to Build/Request a preview/download URL for a document

Hello,

We are planning on installing Nuxeo if we can, from our (old) ERP, request/build an URL to a previously saved document, in order to preview/download it in the browser. The documents we are using are PDF.

To test, I use the VM Nuxeo server 5.5 Ubuntu/Tomcat.

So my question is : Is it possible to request/build the URL of a document, from our ERP ?

If yes, what would be the best way of doing it :

I just spend two days looking at the nuxeo documentation/forum but I didn't find the solution.

Thank you for your help.

Yohann.

0 votes

1 answers

3253 views

ANSWER



Hi,

I'd do it using the second option - you don't have to use the provided automation client, you can instead write your own using either java.net.UrlConnection or Commons-Httpclient. This would free you from using Java 5. Automation isn't really hard to use across plain HTTP.

If you want to do it using JSF urls then to download the first blob of a document I think you need to use urls such as this: http://{server}/nuxeo/nxfile/default/{document id}/blobholder:0/{file name}. I'm using this on a project and it works, however in case of errors you are redirected to the JSF UI, which is not very nice from a user's POV. Another problem with that is that users will have to authenticate prior to downloading.

0 votes



Hi ! Thank you for your help, I'll give it a try and tell you how it goes.
08/01/2012

how to avoid prior authentication to downloading. As I want to authenticate user using java instead of redirecting to login page. Is there any way to pass the credentials in url to generate token and authenticate? Please help me on this part as I am struck on this issue from a long period of time
01/14/2019