cancel
Showing results for 
Search instead for 
Did you mean: 

get ticket in dashlet

boneill
Star Contributor
Star Contributor
Hi All,

I have read a few posts about how to use a connection to connect to webscripts that need user authentication.  I am not trying to do this.

I am building a list of links in my dashlet that connect to an external app.  I want the link to include the currently logged in users ticket so the app can store it during a process and use it to call back to alfresco.

My ftl for the dashlet has following code:

<a href="http://www.seedim.com.au/docs?alf_ticket=${ticket}" target="_blank" >Test Client Ticket<a/>

So I want to set a ticket in the js controller.  How do I get a ticket in a dashlet.  I have tried

  
var ticket = session.getTicket();
   model.ticket = ticket;

Which does not work as session seems to be undefined (or at least not have a getTicket() method.

Any pointers on how to get a user ticket in a dashlet?

Regards
1 REPLY 1

matjazmuhic
Champ on-the-rise
Champ on-the-rise
You don't need a ticket.

When you call in your javascript controller alfresco webscripts in share you can use connectors.

Sample:

var connector = remote.connect("alfresco");
var results = connector.call("/url/to/your/webscript?parameter=something");
results = eval("("+results+")");