Main Page | Packages | Class Tree | Index | Help

xp.data

class CSVConnector

Object
  |
  +--xp.system.DispatcherObject
        |
        +--xp.data.Connector
              |
              +--xp.data.CSVConnector


class CSVConnector
extends Connector

CSVConnector

The CSVConnector component lets you read or write CSV files using HTTP GET or POST operations. It acts as a connector between other components and external CSV data sources. The CSVConnector component communicates with components in your application using either ActionScript code or data binding. The CSVConnector component has properties, methods, and events, but it has no visual appearance at runtime.
Events;
result xp.events.Event
status xp.events.StatusEvent
modelChanged xp.events.ModelChangedEvent


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Field Summary

public
columnHeaders: Array
set the column separtors used as delimiters,

public
columnSeparator: String
set the column separtors used as delimiters,

public
direction: String
Indicates whether data is being sent, received, or both.

public
params: XML
the cached call params object

public
parseMode: String
Should the parsed object be an array of data rows or an array of data columns

public
rowSeparator: String
set the row separtors used as delimiters,

public
URL: String
The URL used by the component in HTTP operations.

Fields inherited from class xp.data.Connector

logEnabled, multipleSimultaneousAllowed, results, suppressInvalidCalls

Fields inherited from class xp.system.DispatcherObject

parent

Properties inherited from class xp.data.Connector

callsInProgress, currentItem

Constructor

public
CSVConnector ( URL: String)
Constructor

Method Summary

public
onXMLData ( data: Object ): Void
Invoked by the results xml on returning from a call needData is set if we spec that there was something being returned called in the context of the results xml

public
parseCSV ( data: String ): Object


public
trigger ( ): Boolean
Triggers

Methods inherited from class xp.data.Connector

onFault, onResult, validateCall

Methods inherited from class xp.system.DispatcherObject

addEventListener, removeEventListener, routeEvent



Field Documentation

columnHeaders

public var columnHeaders: Array
set the column separtors used as delimiters,

columnSeparator

public var columnSeparator: String
set the column separtors used as delimiters,

direction

public var direction: String
Indicates whether data is being sent, received, or both.

Indicates whether data is being sent, received, or both. The values are the following: send XML data for the params property is sent by HTTP POST method to the URL for the XML document. Any data that is returned is ignored. The results property is not set to anything, and there is no result event. Note: The params and results properties and the result event are inherited from the RPC component API. receive No params data is sent to the URL. The URL for the XML document is accessed through HTTP GET, and valid XML data is expected from the URL. send/receive The params data is sent to the URL, and valid XML data is expected from the URL.

params

public var params: XML
the cached call params object

parseMode

public var parseMode: String
Should the parsed object be an array of data rows or an array of data columns

defaults to rows

rowSeparator

public var rowSeparator: String
set the row separtors used as delimiters,

URL

public var URL: String
The URL used by the component in HTTP operations.

Property; the URL that this component uses when carrying out HTTP operations. This URL may be an absolute or relative URL. The URL is subject to all the standard Flash Player security protections.


Constructor Documentation

CSVConnector

public function CSVConnector(URL: String)
Constructor

Parameters:
URL
The url to connect to to load the CSV file.

Method Documentation

onXMLData

public function onXMLData(data: Object): Void
Invoked by the results xml on returning from a call needData is set if we spec that there was something being returned called in the context of the results xml

Parameters:
data
The xml data to be parsed

parseCSV

public function parseCSV(data: String): Object
: Parses a csv string and returns and array of row objects

Parameters:
data
The csv formated data string

trigger

public function trigger(): Boolean
Triggers

Method; initiates a remote procedure call. Each RPC component defines exactly what this involves. If the operation is successful, the results of the operation appear in the RPC component’s results property. The trigger() method performs the following steps: If any data is bound to the params property, the method executes all the bindings to ensure that up-to-date data is available. This also causes data validation to occur. If the data is not valid and suppressInvalidCalls is set to true, the operation is discontinued. If the operation continues, the send event is emitted. The actual remote call is initiated using the connection method indicated (for example, HTTP).


The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc