cancel
Showing results for 
Search instead for 
Did you mean: 

Absolute url is localhost if ws called through share proxy

alarocca
Champ in-the-making
Champ in-the-making
Hello, I created a simple webscript that find a node based on the nodeRef provided as argument and display its download url.

Javascript:
var node = search.findNode(args.nodeRef);
model.downloadUrl = url.context + node.url;

In order to get the absolute url, I used within the template the following code:
${absurl(downloadUrl)}

Now if I call my webscript using the alfresco context (http://myserver:8080/alfresco/service/myws?nodeRef=…) the download url is correct (http://myserver:8080/alfresco/d/d/…).
While if the websscript is called using the share proxy (http://myserver:8080/share/proxy/alfresco/myws?nodeRef=…)
the download url is uncorrect (http://localhost:8080/alfresco/d/d/…).

I would like to use the share proxy based url since the webscript is a share custom document library action.
1 REPLY 1

mikeh
Star Contributor
Star Contributor
Then you need to build the front part of the URL in the Share tier rather than on the Repository (or pass the Share part of the URL in as an argument).

As there can be multiple Share instances for each Repository instance, it's impossible for the Repository to calculate the Share URL you're looking for in every case.

Thanks,
Mike