Last active
December 24, 2015 23:59
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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