08-01-2014 07:10 AM
### get-ticket.get.desc.xml
<webscript>
<shortname>Get current ticket</shortname>
<description>Returns a valid ticket for the currently logged in user</description>
<url>/auth/get-ticket.js</url>
<url>/auth/get-ticket.json.ftl</url>
<format default="js">extension</format>
<authentication>user</authentication>
<transaction>none</transaction>
</webscript>
### get-ticket.get.js
function main() {
model.sessionTicket = session.getTicket();
}
main();
### get-ticket.get.json.ftl
<#escape x as jsonUtils.encodeJSONString(x)>
{
"ticket": "${sessionTicket}"
}
</#escape>
Alfresco.util.Ajax.jsonGet(
{
url: Alfresco.constants.PROXY_URI + "/auth/getTicket.json",
successCallback:
{
fn: function(response)
{
try {
var json = JSON.parse(response.serverResponse.responseText);
var ticket = json["ticket"];
if (ticket.substring(0, 6) == "TICKET") {
clipboardData.setData("Text", ticket);
} else {
}
} catch (e) {
}
},
scope: this
},
failureCallback:
{
fn: function(response)
{
},
scope: this
}
});
08-04-2014 04:25 AM
08-04-2014 04:27 AM
08-05-2014 01:48 AM
11-16-2015 11:30 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.