8392a541bf432ed8d6e1985b6306b83dc898768dJenny Han Donnelly * Provides a DataSource implementation which can be used to retrieve data from a custom function.
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @module datasource
8392a541bf432ed8d6e1985b6306b83dc898768dJenny Han Donnelly * @submodule datasource-function
8392a541bf432ed8d6e1985b6306b83dc898768dJenny Han Donnelly * Function subclass for the DataSource Utility.
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @class DataSource.Function
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @extends DataSource.Local
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @constructor
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly DSFn = function() {
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly DSFn.superclass.constructor.apply(this, arguments);
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly /////////////////////////////////////////////////////////////////////////////
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly // DataSource.Function static properties
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly /////////////////////////////////////////////////////////////////////////////
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @property NAME
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @type String
1e0aa6df8881a856ec262f103bfee1c0a05d19b9Jenny Han Donnelly * @value "dataSourceFunction"
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly /////////////////////////////////////////////////////////////////////////////
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly // DataSource.Function Attributes
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly /////////////////////////////////////////////////////////////////////////////
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @attribute source
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @description Pointer to live data.
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @default null
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * Passes query string to IO. Fires <code>response</code> event when
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * response is received asynchronously.
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @method _defRequestFn
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * @param e {Event.Facade} Event Facade with the following properties:
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * <dt>request (Object)</dt> <dd>The request.</dd>
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * <dt>callback (Object)</dt> <dd>The callback object with the following properties:
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * <dt>success (Function)</dt> <dd>Success handler.</dd>
4de851bb1d7d556b60e05085a888a1cf06f2b271Jenny Han Donnelly * <dt>failure (Function)</dt> <dd>Failure handler.</dd>
65b755664437543e907b9557027a4a608cc84c31Jenny Han Donnelly * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>
90e5a8d35ce642d0156e8d1d8b8a8ad2bd3417bcLuke Smith } catch (ex) {
90e5a8d35ce642d0156e8d1d8b8a8ad2bd3417bcLuke Smith Y.log("Function execution failure", "error", "datasource-function");
90e5a8d35ce642d0156e8d1d8b8a8ad2bd3417bcLuke Smith Y.log("Function data failure", "error", "datasource-function");
2fe13ddab136a6eb6239d89e5e064e09d9e1bb92Luke Smith payload.error = new Error("Function data failure");