Alien-Web-ExtJS-V3

 view release on metacpan or  search on metacpan

share/docs/source/DataProxy.html  view on Meta::CPAN

                update  : 'changed_update.php',
                destroy : 'changed_destroy.php'
            });
        }
    }
});
     * </code></pre>
     * </p>
     */

    this.addEvents(
<span id='Ext-data-DataProxy-event-exception'>        /**
</span>         * @event exception
         * &lt;p&gt;Fires if an exception occurs in the Proxy during a remote request. This event is relayed
         * through a corresponding {@link Ext.data.Store}.{@link Ext.data.Store#exception exception},
         * so any Store instance may observe this event.&lt;/p&gt;
         * &lt;p&gt;In addition to being fired through the DataProxy instance that raised the event, this event is also fired
         * through the Ext.data.DataProxy &lt;i&gt;class&lt;/i&gt; to allow for centralized processing of exception events from &lt;b&gt;all&lt;/b&gt;
         * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.&lt;/p&gt;
         * &lt;p&gt;This event can be fired for one of two reasons:&lt;/p&gt;
         * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
         * &lt;li&gt;remote-request &lt;b&gt;failed&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * The server did not return status === 200.
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;li&gt;remote-request &lt;b&gt;succeeded&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * The remote-request succeeded but the reader could not read the response.
         * This means the server returned data, but the configured Reader threw an
         * error while reading the response.  In this case, this event will be
         * raised and the caught error will be passed along into this event.
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;/ul&gt;&lt;/div&gt;
         * &lt;br&gt;&lt;p&gt;This event fires with two different contexts based upon the 2nd
         * parameter &lt;tt&gt;type [remote|response]&lt;/tt&gt;.  The first four parameters
         * are identical between the two contexts -- only the final two parameters
         * differ.&lt;/p&gt;
         * @param {DataProxy} this The proxy that sent the request
         * @param {String} type
         * &lt;p&gt;The value of this parameter will be either &lt;tt&gt;'response'&lt;/tt&gt; or &lt;tt&gt;'remote'&lt;/tt&gt;.&lt;/p&gt;
         * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'response'&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;An &lt;b&gt;invalid&lt;/b&gt; response from the server was returned: either 404,
         * 500 or the response meta-data does not match that defined in the DataReader
         * (e.g.: root, idProperty, successProperty).&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'remote'&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;A &lt;b&gt;valid&lt;/b&gt; response was returned from the server having
         * successProperty === false.  This response might contain an error-message
         * sent from the server.  For example, the user may have failed
         * authentication/authorization or a database validation error occurred.&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;/ul&gt;&lt;/div&gt;
         * @param {String} action Name of the action (see {@link Ext.data.Api#actions}.
         * @param {Object} options The options for the action that were specified in the {@link #request}.
         * @param {Object} response
         * &lt;p&gt;The value of this parameter depends on the value of the &lt;code&gt;type&lt;/code&gt; parameter:&lt;/p&gt;
         * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'response'&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;The raw browser response object (e.g.: XMLHttpRequest)&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'remote'&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;The decoded response object sent from the server.&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;/ul&gt;&lt;/div&gt;
         * @param {Mixed} arg
         * &lt;p&gt;The type and value of this parameter depends on the value of the &lt;code&gt;type&lt;/code&gt; parameter:&lt;/p&gt;
         * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'response'&lt;/tt&gt;&lt;/b&gt; : Error&lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;The JavaScript Error object caught if the configured Reader could not read the data.
         * If the remote request returns success===false, this parameter will be null.&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'remote'&lt;/tt&gt;&lt;/b&gt; : Record/Record[]&lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;This parameter will only exist if the &lt;tt&gt;action&lt;/tt&gt; was a &lt;b&gt;write&lt;/b&gt; action
         * (Ext.data.Api.actions.create|update|destroy).&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;/ul&gt;&lt;/div&gt;
         */
        'exception',
<span id='Ext-data-DataProxy-event-beforeload'>        /**
</span>         * @event beforeload
         * Fires before a request to retrieve a data object.
         * @param {DataProxy} this The proxy for the request
         * @param {Object} params The params object passed to the {@link #request} function
         */
        'beforeload',
<span id='Ext-data-DataProxy-event-load'>        /**
</span>         * @event load
         * Fires before the load method's callback is called.
         * @param {DataProxy} this The proxy for the request
         * @param {Object} o The request transaction object
         * @param {Object} options The callback's &lt;tt&gt;options&lt;/tt&gt; property as passed to the {@link #request} function
         */
        'load',
<span id='Ext-data-DataProxy-event-loadexception'>        /**
</span>         * @event loadexception
         * &lt;p&gt;This event is &lt;b&gt;deprecated&lt;/b&gt;.  The signature of the loadexception event
         * varies depending on the proxy, use the catch-all {@link #exception} event instead.
         * This event will fire in addition to the {@link #exception} event.&lt;/p&gt;
         * @param {misc} misc See {@link #exception}.
         * @deprecated
         */
        'loadexception',
<span id='Ext-data-DataProxy-event-beforewrite'>        /**
</span>         * @event beforewrite
         * &lt;p&gt;Fires before a request is generated for one of the actions Ext.data.Api.actions.create|update|destroy&lt;/p&gt;
         * &lt;p&gt;In addition to being fired through the DataProxy instance that raised the event, this event is also fired
         * through the Ext.data.DataProxy &lt;i&gt;class&lt;/i&gt; to allow for centralized processing of beforewrite events from &lt;b&gt;all&lt;/b&gt;
         * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.&lt;/p&gt;
         * @param {DataProxy} this The proxy for the request
         * @param {String} action [Ext.data.Api.actions.create|update|destroy]
         * @param {Record/Record[]} rs The Record(s) to create|update|destroy.
         * @param {Object} params The request &lt;code&gt;params&lt;/code&gt; object.  Edit &lt;code&gt;params&lt;/code&gt; to add parameters to the request.
         */
        'beforewrite',
<span id='Ext-data-DataProxy-event-write'>        /**
</span>         * @event write
         * &lt;p&gt;Fires before the request-callback is called&lt;/p&gt;
         * &lt;p&gt;In addition to being fired through the DataProxy instance that raised the event, this event is also fired
         * through the Ext.data.DataProxy &lt;i&gt;class&lt;/i&gt; to allow for centralized processing of write events from &lt;b&gt;all&lt;/b&gt;
         * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.&lt;/p&gt;
         * @param {DataProxy} this The proxy that sent the request
         * @param {String} action [Ext.data.Api.actions.create|upate|destroy]
         * @param {Object} data The data object extracted from the server-response
         * @param {Object} response The decoded response from server
         * @param {Record/Record[]} rs The Record(s) from Store
         * @param {Object} options The callback's &lt;tt&gt;options&lt;/tt&gt; property as passed to the {@link #request} function
         */
        'write'
    );
    Ext.data.DataProxy.superclass.constructor.call(this);

    // Prepare the proxy api.  Ensures all API-actions are defined with the Object-form.
    try {
        Ext.data.Api.prepare(this);
    } catch (e) {
        if (e instanceof Ext.data.Api.Error) {
            e.toConsole();
        }
    }
    // relay each proxy's events onto Ext.data.DataProxy class for centralized Proxy-listening
    Ext.data.DataProxy.relayEvents(this, ['beforewrite', 'write', 'exception']);
};

Ext.extend(Ext.data.DataProxy, Ext.util.Observable, {
<span id='Ext-data-DataProxy-cfg-restful'>    /**
</span>     * @cfg {Boolean} restful
     * &lt;p&gt;Defaults to &lt;tt&gt;false&lt;/tt&gt;.  Set to &lt;tt&gt;true&lt;/tt&gt; to operate in a RESTful manner.&lt;/p&gt;
     * &lt;br&gt;&lt;p&gt; Note: this parameter will automatically be set to &lt;tt&gt;true&lt;/tt&gt; if the
     * {@link Ext.data.Store} it is plugged into is set to &lt;code&gt;restful: true&lt;/code&gt;. If the
     * Store is RESTful, there is no need to set this option on the proxy.&lt;/p&gt;
     * &lt;br&gt;&lt;p&gt;RESTful implementations enable the serverside framework to automatically route
     * actions sent to one url based upon the HTTP method, for example:
     * &lt;pre&gt;&lt;code&gt;
store: new Ext.data.Store({
    restful: true,
    proxy: new Ext.data.HttpProxy({url:'/users'}); // all requests sent to /users
    ...
)}
     * &lt;/code&gt;&lt;/pre&gt;
     * If there is no &lt;code&gt;{@link #api}&lt;/code&gt; specified in the configuration of the proxy,
     * all requests will be marshalled to a single RESTful url (/users) so the serverside
     * framework can inspect the HTTP Method and act accordingly:
     * &lt;pre&gt;
&lt;u&gt;Method&lt;/u&gt;   &lt;u&gt;url&lt;/u&gt;        &lt;u&gt;action&lt;/u&gt;
POST     /users     create
GET      /users     read
PUT      /users/23  update
DESTROY  /users/23  delete
     * &lt;/pre&gt;&lt;/p&gt;
     * &lt;p&gt;If set to &lt;tt&gt;true&lt;/tt&gt;, a {@link Ext.data.Record#phantom non-phantom} record's
     * {@link Ext.data.Record#id id} will be appended to the url. Some MVC (e.g., Ruby on Rails,
     * Merb and Django) support segment based urls where the segments in the URL follow the
     * Model-View-Controller approach:&lt;pre&gt;&lt;code&gt;
     * someSite.com/controller/action/id
     * &lt;/code&gt;&lt;/pre&gt;
     * Where the segments in the url are typically:&lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
     * &lt;li&gt;The first segment : represents the controller class that should be invoked.&lt;/li&gt;
     * &lt;li&gt;The second segment : represents the class function, or method, that should be called.&lt;/li&gt;
     * &lt;li&gt;The third segment : represents the ID (a variable typically passed to the method).&lt;/li&gt;
     * &lt;/ul&gt;&lt;/div&gt;&lt;/p&gt;
     * &lt;br&gt;&lt;p&gt;Refer to &lt;code&gt;{@link Ext.data.DataProxy#api}&lt;/code&gt; for additional information.&lt;/p&gt;
     */
    restful: false,



( run in 0.483 second using v1.01-cache-2.11-cpan-3d66aa2751a )