2013-03-30 14:55:18 +01:00
|
|
|
/**
|
|
|
|
* ResponseHandler.js zarafa calender to ics im/exporter
|
|
|
|
*
|
|
|
|
* Author: Christoph Haas <christoph.h@sprinternet.at>
|
2016-06-20 15:04:53 +02:00
|
|
|
* Copyright (C) 2012-2016 Christoph Haas
|
2013-03-30 14:55:18 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*/
|
2016-06-20 15:48:24 +02:00
|
|
|
|
2012-12-29 19:49:24 +01:00
|
|
|
/**
|
|
|
|
* ResponseHandler
|
|
|
|
*
|
|
|
|
* This class handles all responses from the php backend
|
|
|
|
*/
|
2012-12-05 22:31:10 +01:00
|
|
|
Ext.namespace('Zarafa.plugins.calendarimporter.data');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @class Zarafa.plugins.calendarimporter.data.ResponseHandler
|
|
|
|
* @extends Zarafa.plugins.calendarimporter.data.AbstractResponseHandler
|
|
|
|
*
|
2013-03-30 14:55:18 +01:00
|
|
|
* Calendar specific response handler.
|
2012-12-05 22:31:10 +01:00
|
|
|
*/
|
|
|
|
Zarafa.plugins.calendarimporter.data.ResponseHandler = Ext.extend(Zarafa.core.data.AbstractResponseHandler, {
|
|
|
|
/**
|
|
|
|
* @cfg {Function} successCallback The function which
|
|
|
|
* will be called after success request.
|
|
|
|
*/
|
2016-06-20 15:48:24 +02:00
|
|
|
successCallback: null,
|
|
|
|
|
2013-03-30 14:55:18 +01:00
|
|
|
/**
|
|
|
|
* Call the successCallback callback function.
|
|
|
|
* @param {Object} response Object contained the response data.
|
|
|
|
*/
|
2016-06-20 15:48:24 +02:00
|
|
|
doExport: function (response) {
|
2013-03-30 14:55:18 +01:00
|
|
|
this.successCallback(response);
|
|
|
|
},
|
2016-06-20 15:48:24 +02:00
|
|
|
|
2013-03-30 14:55:18 +01:00
|
|
|
/**
|
|
|
|
* Call the successCallback callback function.
|
|
|
|
* @param {Object} response Object contained the response data.
|
|
|
|
*/
|
2016-06-20 15:48:24 +02:00
|
|
|
doList: function (response) {
|
2013-03-30 14:55:18 +01:00
|
|
|
this.successCallback(response);
|
|
|
|
},
|
2016-06-20 15:48:24 +02:00
|
|
|
|
2012-12-05 22:31:10 +01:00
|
|
|
/**
|
|
|
|
* Call the successCallback callback function.
|
|
|
|
* @param {Object} response Object contained the response data.
|
|
|
|
*/
|
2016-06-20 15:48:24 +02:00
|
|
|
doImport: function (response) {
|
2012-12-05 22:31:10 +01:00
|
|
|
this.successCallback(response);
|
|
|
|
},
|
2016-06-20 15:48:24 +02:00
|
|
|
|
2012-12-07 00:10:23 +01:00
|
|
|
/**
|
|
|
|
* Call the successCallback callback function.
|
|
|
|
* @param {Object} response Object contained the response data.
|
|
|
|
*/
|
2016-06-20 15:48:24 +02:00
|
|
|
doImportattachment: function (response) {
|
2012-12-07 00:10:23 +01:00
|
|
|
this.successCallback(response);
|
|
|
|
},
|
2016-06-20 15:48:24 +02:00
|
|
|
|
2012-12-05 22:31:10 +01:00
|
|
|
/**
|
|
|
|
* In case exception happened on server, server will return
|
|
|
|
* exception response with the code of exception.
|
|
|
|
* @param {Object} response Object contained the response data.
|
|
|
|
*/
|
2016-06-20 15:48:24 +02:00
|
|
|
doError: function (response) {
|
2012-12-05 22:31:10 +01:00
|
|
|
alert("error response code: " + response.error.info.code);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2013-03-30 14:55:18 +01:00
|
|
|
Ext.reg('calendarimporter.calendarresponsehandler', Zarafa.plugins.calendarimporter.data.ResponseHandler);
|