DataReaderJsonReader
SlingReader
| Package: | CQ.data |
| Class: | SlingReader |
| Extends: | CQ.Ext.data.JsonReader |
| Clientlib: | cq.widgets |
| Config Options | Defined By | |
|---|---|---|
|
fields : Array/Object Either an Array of Field definition objects (which will be passed to CQ.Ext.data.Record.create, or a Record construct...
Either an Array of Field definition objects (which will be passed to CQ.Ext.data.Record.create, or a Record constructor created from CQ.Ext.data.Record.create. |
DataReader | |
|
idProperty : String [id] Name of the property within a row object that contains a record identifier value. Defaults to id
[id] Name of the property within a row object that contains a record identifier value. Defaults to id
|
JsonReader | |
|
messageProperty : String
[undefined] Optional name of a property within a server-response that represents a user-feedback message.
|
DataReader | |
|
root : String [undefined] Required. The name of the property which contains the Array of row objects. Defaults to undefined. An exc...
[undefined] Required. The name of the property which contains the Array of row objects. Defaults to undefined. An exception will be thrown if the root property is undefined. The data packet value for this property should be an empty array to clear the data or show no data.
|
JsonReader | |
|
successProperty : String [success] Name of the property from which to retrieve the success attribute. Defaults to success. See CQ.Ext.data.Dat...
[success] Name of the property from which to retrieve the success attribute. Defaults to success. See CQ.Ext.data.DataProxy.exception for additional information.
|
JsonReader | |
|
totalProperty : String [total] Name of the property from which to retrieve the total number of records in the dataset. This is only needed i...
[total] Name of the property from which to retrieve the total number of records in the dataset. This is only needed if the whole dataset is not passed in one go, but is being paged from the remote server. Defaults to total.
|
JsonReader | |
| Property | Defined By | |
|---|---|---|
|
buildExtractors : Object
Abstract method, overridden in DataReader extensions such as CQ.Ext.data.JsonReader and CQ.Ext.data.XmlReader
|
DataReader | |
|
extractValues : Object
Abstract method overridden in DataReader extensions such as CQ.Ext.data.JsonReader and CQ.Ext.data.XmlReader
|
DataReader | |
|
getId : Object
Abstract method created in extension's buildExtractors impl.
|
DataReader | |
|
getMessage : Object
Abstract method created in extension's buildExtractors impl.
|
DataReader | |
|
getRoot : Object
Abstract method created in extension's buildExtractors impl.
|
DataReader | |
|
getSuccess : Object
Abstract method created in extension's buildExtractors impl.
|
DataReader | |
|
getTotal : Object
Abstract method created in extension's buildExtractors impl.
|
DataReader | |
|
jsonData : Object After any data loads, the raw JSON data is available for further custom processing. If no data is
loaded or there is...
After any data loads, the raw JSON data is available for further custom processing. If no data is
loaded or there is a load exception this property will be undefined.
|
JsonReader | |
|
meta : Mixed
This DataReader's configured metadata as passed to the constructor.
|
DataReader | |
| Method | Defined By | |
|---|---|---|
|
SlingReader() Create a new SlingReader
Create a new SlingReader
Parameters:
|
SlingReader | |
isData( Object data ) : Boolean Returns true if the supplied data-hash looks and quacks like data. Checks to see if it has a key
corresponding to id...
Returns true if the supplied data-hash looks and quacks like data. Checks to see if it has a key
corresponding to idProperty defined in your DataReader config containing non-empty pk.
Parameters:
|
DataReader | |
read( Object response ) : Object This method is only used by a DataProxy which has retrieved data from a remote server.
This method is only used by a DataProxy which has retrieved data from a remote server.
Parameters:
|
SlingReader | |
readRecords( Object o ) : Object Create a data block containing CQ.Ext.data.Records from a JSON object.
Create a data block containing CQ.Ext.data.Records from a JSON object.
Parameters:
|
JsonReader | |
readResponse( String action, Object response ) : Response
Decode a JSON response from server.
Decode a JSON response from server.
Parameters:
|
JsonReader | |
realize( Record/Record[] record, Object/Object[] data ) : void Used for un-phantoming a record after a successful database insert. Sets the records pk along with new data from ser...
Used for un-phantoming a record after a successful database insert. Sets the records pk along with new data from server.
You must return at least the database pk using the idProperty defined in your DataReader configuration. The incoming
data from server will be merged with the data in the local record.
In addition, you must return record-data from the server in the same order received.
Will perform a commit as well, un-marking dirty-fields. Store's "update" event will be suppressed.
Parameters:
|
DataReader | |
update( Record/Record[] rs, Object/Object[] data ) : void Used for updating a non-phantom or "real" record's data with fresh data from server after remote-save.
If returning d...
Used for updating a non-phantom or "real" record's data with fresh data from server after remote-save.
If returning data from multiple-records after a batch-update, you must return record-data from the server in
the same order received. Will perform a commit as well, un-marking dirty-fields. Store's "update" event will be
suppressed as the record receives fresh new data-hash
Parameters:
|
DataReader | |