TSUI.Data
Extends: None
Implements: IDataAccessor
Exported: Yes

Associated source files:

Description

Defines the structure for data accessors. Data accessors push or pull data to/from a data source such as a page on a web server.
T: Specifies the type of the data which will be sent to/from the server.

Constructors

constructor()
Creates a new DataAccessor.
constructor(baseAccessInfo: Data.IAccessInfo)
Creates a new DataAccessor with specified BaseAccessInfo.
  • baseAccessInfo: Data.IAccessInfo -
constructor(baseAccessInfo?: Data.IAccessInfo)
  • OPTIONAL baseAccessInfo: Data.IAccessInfo -


Public Properties

BaseAccessInfo: Data.IAccessInfo;
The normal access info to use in PushData and PullData when no alternative info is supplied. Use this to set up a data accessor for repeated access to the same data source.
OnDataPulled: TSUI.Events.DataPulledEvent<T>;
Fired when data is pulled from the server (or when the data pull request fails).
Check the Status property of the event.
OnDataPushed: TSUI.Events.DataPushedEvent<T>;
Fired when data is pushed to the server (or when the data push request fails).
Check the Status property of the event.


Public Methods

PullData(): Data.IDataAccessResult<T>
Pulls data from the data source (using the BaseAccessInfo property for data source).Note: This should be an aynschronous method.Note: This implementation is empty and will always return an error.
  • Returns: TSUI.Data.IDataAccessResult<T> - The status of the request. Implementations of this which are asynchronous should return empty result with status Pending.
PullData(accessInfo: Data.IAccessInfo): Data.IDataAccessResult<T>
Pulls data from the data source using the specified AccessInfo for the data source.Note: This should be an aynschronous method.Note: This implementation is empty and will always return an error.
  • accessInfo: Data.IAccessInfo - The AccessInfo to use for the data source.
  • Returns: TSUI.Data.IDataAccessResult<T> - The status of the request. Implementations of this which are asynchronous should return empty result with status Pending.
PullData(accessInfo?: Data.IAccessInfo): Data.IDataAccessResult<T>
Empty implementation of PullData. Always returns an error result.
  • OPTIONAL accessInfo: Data.IAccessInfo - The AccessInfo to use for the data source.
  • Returns: TSUI.Data.IDataAccessResult<T> - The status of the request. Implementations of this which are asynchronous should return empty result with status Pending.
PushData(data: T): Data.IDataAccessResult<T>
Pushes data to the data source (using the BaseAccessInfo property for data source).Note: This should be an aynschronous method.Note: This implementation is empty and will always return an error.
  • data: T - The data to push to the server.
  • Returns: TSUI.Data.IDataAccessResult<T> - The status of the request. Implementations of this which are asynchronous should return an empty result with status Pending.
PushData(data: T, accessInfo: Data.IAccessInfo): Data.IDataAccessResult<T>
Pushes data to the data source using the specified AccessInfo for the data source.Note: This should be an aynschronous method.Note: This implementation is empty and will always return an error.
  • data: T - The data to push to the server.
  • accessInfo: Data.IAccessInfo - The AccessInfo to use for the data source.
  • Returns: TSUI.Data.IDataAccessResult<T> - The result of the request. Implementations of this which are asynchronous should return an empty result with status Pending.
PushData(data: T, accessInfo?: Data.IAccessInfo): Data.IDataAccessResult<T>
Empty implementation of PushData. Always returns an error result.
  • data: T - The data to push to the server.
  • OPTIONAL accessInfo: Data.IAccessInfo - The AccessInfo to use for the data source.
  • Returns: TSUI.Data.IDataAccessResult<T> - The result of the request. Implementations of this which are asynchronous should return an empty result with status Pending.


Last edited Aug 29, 2013 at 10:05 PM by EdwardNutting, version 2

Comments

No comments yet.