qx.Class.define("org.argeo.security.ria.SecurityAPI", { extend : qx.core.Object, statics : { DEFAULT_CONTEXT : "/org.argeo.security.webapp", CREDENTIALS_SERVICE : "getCredentials.security", USERS_LIST_SERVICE : "getUsersList.security", USER_EXISTS_SERVICE : "userExists.security", DELETE_USER_SERVICE : "deleteUser.security", UPDATE_USER_SERVICE : "updateUser.security", GET_USER_DETAILS_SERVICE : "getUserDetails.security", CREATE_USER_SERVICE : "createUser.security", UPDATE_USER_PASS_SERVICE : "updateUserPassword.security", UPDATE_PASS_SERVICE : "updatePassword.security", ROLES_LIST_SERVICE : "getRolesList.security", CREATE_ROLE_SERVICE : "createRole.security", DELETE_ROLE_SERVICE : "deleteRole.security", /** * Standard Request getter * @param serviceName {String} The name of the service to call (without base context) * @param fireReloadEventType {String} Whether query should trigger a ReloadEvent * @param iLoadStatusables {org.argeo.ria.components.ILoadStatusables[]} Gui parts to update * @return {qx.io.remote.Request} */ getServiceRequest : function(serviceName) { var serviceManager = org.argeo.ria.remote.RequestManager.getInstance(); return serviceManager.getRequest( org.argeo.security.ria.SecurityAPI.DEFAULT_CONTEXT + "/" + serviceName, "GET", "application/json"); }, /** * * @param {qx.io.remote.Request} request * @param {Array} argumentsArray * @param {Integer} startIndex */ parseOptionalArguments : function(request, argumentsArray, startIndex){ // Attach Error listener request.addListener("completed", function(response){ var jSonContent = response.getContent(); if(typeof jSonContent == "object" && jSonContent.status && jSonContent.status == "ERROR"){ org.argeo.ria.components.Logger.getInstance().error(jSonContent.message); response.getTarget().abort(); } }); // Attach ILoadStatusables & reloadEvents if(argumentsArray.length <= startIndex) return; var serviceManager = org.argeo.ria.remote.RequestManager.getInstance(); for(var i=startIndex;i