Ext.namespace('Zarafa.plugins.mdm.data'); /** * @class Zarafa.plugins.mdm.data.MDMResponseHandler * @extends Zarafa.core.data.AbstractResponseHandler * * MDM specific response handler. */ Zarafa.plugins.mdm.data.MDMResponseHandler = Ext.extend(Zarafa.core.data.AbstractResponseHandler, { /** * @cfg {Function} successCallback The function which * will be called after success request. */ successCallback : Ext.emptyFn, /** * @cfg {Function} failureCallback The function which * will be called after a failed request. * This callback is optional and currently unused. */ failureCallback : Ext.emptyFn, /** * Device information from Z-Push's soap call, * @param {Object} response Object contained the response data. */ doInfo : function(response) { this.successCallback(response); /* if(response.status != true && this.failureCallback != null) { this.failureCallback(response); } else { this.successCallback(response); }*/ }, /** * Call the successCallback callback function if device was successfully removed from * z-push server. * @param {Object} response Object contained the response data. */ doRemove : function(response) { if(response.remove){ this.successCallback(); } }, /** * If wipe request response was successful, show informative message. * @param {Object} response Object contained the response data. */ doWipe : function(response) { if (response.wipe === true) { container.getNotifier().notify('info.mdm', _('Mobile Device Manager'), _('Wiping device', 'plugin_mdm')); } else { container.getNotifier().notify('info.mdm', _('Mobile Device Manager'), _('Password incorrect', 'plugin_mdm')); } }, /** * If resync request response was successful, show informative message. * @param {Object} response Object contained the response data. */ doResync : function(response) { if (response.resync === true) { container.getNotifier().notify('info.mdm', _('Mobile Device Manager'), _('Full resync in progress', 'plugin_mdm')); } } }); Ext.reg('mdm.responsehandler', Zarafa.plugins.mdm.data.MDMResponseHandler);