Skip to content

Instantly share code, notes, and snippets.

@natecavanaugh
Last active December 24, 2015 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natecavanaugh/6884739 to your computer and use it in GitHub Desktop.
Save natecavanaugh/6884739 to your computer and use it in GitHub Desktop.
Add the ability to invoke a service with composite requests with Liferay 6.1
Liferay.Service.invoke = function(payload, success, failure){
A.io.request(
'/api/jsonws/invoke',
{
cache: false,
data: {
cmd: A.JSON.stringify(payload),
p_auth: Liferay.authToken
},
dataType: 'json',
on: {
failure: failure,
success: function(event) {
if (success) {
var data = this.get('responseData');
success.apply(this, [data, event]);
}
}
}
}
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment