Anaheim Ducks Jersey Atlanta Thrashers Jersey Boston Bruins Jersey Buffalo Sabres Jersey Calgary Flames Jersey Carolina Hurricanes Jersey Chicago Blackhawks Jersey Colorado Avalanche Jersey Columbus Blue Jackets Jersey Dallas Stars Jersey Detroit Red Wings Jersey Edmonton Oilers Jersey Hartford Whalers Jersey Los Angeles Kings Jersey Minnesota Wild Jersey Montreal Canadiens Jersey Nashville Predators Jersey New Jersey Devils Jersey New York Islanders Jersey New York Rangers Jersey Ottawa Senators Jersey Philadelphia Flyers Jersey Phoenix Coyotes Jersey Pittsburgh Penguins Jersey Quebec Nordiques Jersey San Jose Sharks Jersey St. Louis Blues Jersey Tampa Bay Lightning Jersey Toronto Maple Leafs Jersey Vancouver Canucks Jersey Washington Capitals Jersey Winnipeg Jets Jersey

Recordsets

Remoting recordsets are sent back from the server as a typed object (type 0x0A). They are then mapped locally in the Flex framework as mx.remoting.Recordset. Flash recordsets are specifically targeted at holding SQL records. Recordsets have a built-in paging functionality that gateways may wish to implement.

Recordset structure

All recordsets sent back from the server should start as a typed object (0x0A) with name 'RecordSet' (note camel-case). This object contains only one element with key: 'serverInfo'. The value of serverInfo should be an object (0x03) with the following elements:

Key name Value
totalCount The total number of records in the recordset, as a Number
initialData The recordset data as an array (see below)
cursor 1
serviceName If gateway implements pageable recordsets, the name of the service that retrieves further records in the recordset
columnNames The column names, as an array of strings.
version 1
id A recordset id, only used if array is recordset is paged

initialData

initialData should be an array of arrays containing the recordset data. Only numeric keys are used, as the columnNames are encoded separately. An inner array is a single row of data. The inner data may be of any reasonable single-level type, such as string, boolean, Number, etc. Setting a cell to an array or object will work but should be reserved for special applications.

Pageable recordset mechanism

If the number of rows in the initialData is less than the totalCount key, and the serviceName is set, Flash identifies the recordset as pageable. When an unretrieved row is looked up, Flash detects the absence and calls a special service; it retrieves the name of this service from the 'serviceName' key. While the server determines the initial amount of rows sent back, the client determines the amount of data sent back on subsequent calls through the mx.remoting.RecordSet :: setDeliveryMode function.

Pageable recordset request

The 'getRecords' method of the paging service is called with three arguments:

  • Recordset id (the same as the 'id' key in the original recordset)
  • Offset (1-based)
  • Number of records to retrieve

With the recordset id, the service may use a variety of mechanism to reconstruct the recordset; typically the original recordset will be stored in a session variable, or perhaps the arguments originally sent to the method are stored to recreate a LIMIT statement. Implementation is left to the gateway.

Pageable recordset answer

The pageable recordset request should be answered by a typed object (0x0A) with class name 'RecordSetPage'. This object should contain the 'Cursor' key and the 'Page' key (note caps). The cursor should be be set to the same number as the requested offset. The page should contain an array of arrays containing the requested data. The column names are not sent back in this request as they are stored locally by Flash.

Discussion

Enter your comment
 
 
documentation/amf/recordset.txt · Last modified: 2012/05/14 04:26 by 74.125.184.81
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki