Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / source / data / HttpProxy.js
diff --git a/source/data/HttpProxy.js b/source/data/HttpProxy.js
deleted file mode 100644 (file)
index 06fd9a5..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.data.HttpProxy\r
- * @extends Ext.data.DataProxy\r
- * An implementation of {@link Ext.data.DataProxy} that reads a data object from a {@link Ext.data.Connection Connection} object\r
- * configured to reference a certain URL.<br>\r
- * <p>\r
- * <b>Note that this class cannot be used to retrieve data from a domain other than the domain\r
- * from which the running page was served.<br>\r
- * <p>\r
- * For cross-domain access to remote data, use a {@link Ext.data.ScriptTagProxy ScriptTagProxy}.</b><br>\r
- * <p>\r
- * Be aware that to enable the browser to parse an XML document, the server must set\r
- * the Content-Type header in the HTTP response to "text/xml".\r
- * @constructor\r
- * @param {Object} conn an {@link Ext.data.Connection} object, or options parameter to {@link Ext.Ajax#request}.\r
- * If an options parameter is passed, the singleton {@link Ext.Ajax} object will be used to make the request.\r
- */\r
-Ext.data.HttpProxy = function(conn){\r
-    Ext.data.HttpProxy.superclass.constructor.call(this);\r
-    /**\r
-     * The Connection object (Or options parameter to {@link Ext.Ajax#request}) which this HttpProxy uses to make requests to the server.\r
-     * Properties of this object may be changed dynamically to change the way data is requested.\r
-     * @property\r
-     */\r
-    this.conn = conn;\r
-    this.useAjax = !conn || !conn.events;\r
-\r
-    /**\r
-     * @event loadexception\r
-     * Fires if an exception occurs in the Proxy during data loading.  This event can be fired for one of two reasons:\r
-     * <ul><li><b>The load call returned success: false.</b>  This means the server logic returned a failure\r
-     * status and there is no data to read.  In this case, this event will be raised and the\r
-     * fourth parameter (read error) will be null.</li>\r
-     * <li><b>The load succeeded but the reader could not read the response.</b>  This means the server returned\r
-     * data, but the configured Reader threw an error while reading the data.  In this case, this event will be \r
-     * raised and the caught error will be passed along as the fourth parameter of this event.</li></ul>\r
-     * Note that this event is also relayed through {@link Ext.data.Store}, so you can listen for it directly\r
-     * on any Store instance.\r
-     * @param {Object} this\r
-     * @param {Object} options The loading options that were specified (see {@link #load} for details)\r
-     * @param {Object} response The XMLHttpRequest object containing the response data\r
-     * @param {Error} e The JavaScript Error object caught if the configured Reader could not read the data.\r
-     * If the load call returned success: false, this parameter will be null.\r
-     */\r
-};\r
-\r
-Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, {\r
-    /**\r
-     * Return the {@link Ext.data.Connection} object being used by this Proxy.\r
-     * @return {Connection} The Connection object. This object may be used to subscribe to events on\r
-     * a finer-grained basis than the DataProxy events.\r
-     */\r
-    getConnection : function(){\r
-        return this.useAjax ? Ext.Ajax : this.conn;\r
-    },\r
-\r
-    /**\r
-     * Load data from the configured {@link Ext.data.Connection}, read the data object into\r
-     * a block of Ext.data.Records using the passed {@link Ext.data.DataReader} implementation, and\r
-     * process that block using the passed callback.\r
-     * @param {Object} params An object containing properties which are to be used as HTTP parameters\r
-     * for the request to the remote server.\r
-     * @param {Ext.data.DataReader} reader The Reader object which converts the data\r
-     * object into a block of Ext.data.Records.\r
-     * @param {Function} callback The function into which to pass the block of Ext.data.Records.\r
-     * The function must be passed <ul>\r
-     * <li>The Record block object</li>\r
-     * <li>The "arg" argument from the load function</li>\r
-     * <li>A boolean success indicator</li>\r
-     * </ul>\r
-     * @param {Object} scope The scope in which to call the callback\r
-     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.\r
-     */\r
-    load : function(params, reader, callback, scope, arg){\r
-        if(this.fireEvent("beforeload", this, params) !== false){\r
-            var  o = {\r
-                params : params || {},\r
-                request: {\r
-                    callback : callback,\r
-                    scope : scope,\r
-                    arg : arg\r
-                },\r
-                reader: reader,\r
-                callback : this.loadResponse,\r
-                scope: this\r
-            };\r
-            if(this.useAjax){\r
-                Ext.applyIf(o, this.conn);\r
-                if(this.activeRequest){\r
-                    Ext.Ajax.abort(this.activeRequest);\r
-                }\r
-                this.activeRequest = Ext.Ajax.request(o);\r
-            }else{\r
-                this.conn.request(o);\r
-            }\r
-        }else{\r
-            callback.call(scope||this, null, arg, false);\r
-        }\r
-    },\r
-\r
-    // private\r
-    loadResponse : function(o, success, response){\r
-        delete this.activeRequest;\r
-        if(!success){\r
-            this.fireEvent("loadexception", this, o, response);\r
-            o.request.callback.call(o.request.scope, null, o.request.arg, false);\r
-            return;\r
-        }\r
-        var result;\r
-        try {\r
-            result = o.reader.read(response);\r
-        }catch(e){\r
-            this.fireEvent("loadexception", this, o, response, e);\r
-            o.request.callback.call(o.request.scope, null, o.request.arg, false);\r
-            return;\r
-        }\r
-        this.fireEvent("load", this, o, o.request.arg);\r
-        o.request.callback.call(o.request.scope, result, o.request.arg, true);\r
-    },\r
-    \r
-    // private\r
-    update : function(dataSet){\r
-        \r
-    },\r
-    \r
-    // private\r
-    updateResponse : function(dataSet){\r
-        \r
-    }\r
-});
\ No newline at end of file