cancel
Showing results for 
Search instead for 
Did you mean: 

Invoking web script from dashlet without authentication

santoso_n
Champ in-the-making
Champ in-the-making
Hi all,


I've made a simple dashlet containing a link to my web script and my web script requires user authentication.

my questions are :
1. on my ftl file, how do I refer to current url.context? (e.g. in my default installation, it is /alfresco). I've tried ${url.context}, but url isn't recognized.
2. If I click on the link on my dashlet, the browser always try to authenticate, even though I already logged in to alfresco. How do I invoke my web script without the browser request for authentication?


Thanks in advance,

Santoso
2 REPLIES 2

pmonks
Star Contributor
Star Contributor
Which URL prefix are you using in the link for your Web Script?  My guess is "/alfresco/service" or "/alfresco/s", in which case you might consider "/alfresco/wcservice" or "/alfresco/wcs" - see http://wiki.alfresco.com/wiki/Web_Script_Runtimes#Pre-defined_web_script_URL_mappings for more details.

Cheers,
Peter

santoso_n
Champ in-the-making
Champ in-the-making
Hi Peter,

Thanks a lot!! That explains why in the existing dashlet, the webscript url is "/wcs/…", which I didn't understand at the first time.

One more question Smiley Happy
my jsp refers to a free marker template :

<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>

<%– Note that this template is loaded from the classpath –%>
<r:template template="/alfresco/templates/sanz/hello.html.ftl" />

my ftl :

<p>Invoke <a href="/alfresco/wcs/sanz/hello">test</a> web script</p>

The thing is I have to hard code my context path (i.e. /alfresco), I tried to use ${url.contextPath}
but I got this error :
Error during processing of the template 'Expression url is undefined on line 4, column 22 in alfresco/templates/sanz/hello.html.ftl.'. Please contact your system administrator.

How do I get the context path value in my ftl?


Thanks,

Santoso