Absolute url is localhost if ws called through share proxy
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2011 10:20 AM
Hello, I created a simple webscript that find a node based on the nodeRef provided as argument and display its download url.
Javascript:
In order to get the absolute url, I used within the template the following code:
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.
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.
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2011 10:46 AM
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
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