
651
DEVELOPING
COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
Las
t
upda
te
d 8/5/2010
Logging SQL statements
The ActionScript ORM logs all SQL statements that it executes.
The log can be configured as follows:
❖
Add a log target for the AIR applications as shown in the following example:
var logTarget:TraceTarget = new TraceTarget();
logTarget.filters = "*";
logTarget.level = LogEventLevel.ALL;
Log.addTarget(logTarget);
The log target is the TraceTarget where all the trace statements appear. The log target can be set to any other log using
the Flash APIs.
ColdFusion ActionScript APIs
The following two APIs have been introduced to the session class in the
coldfusion.air
package:
keepAllClientObjects
Description
Takes an
ArrayCollection
of conflict instances and keeps the client object for every conflict instance in the
ArrayCollection.
Returns
An instance of
coldfusion.air.SessionToken
(which is the token for
keepAllClientObjects
call).
Syntax
public function keepAllClientObjects(conflicts:ArrayCollection):SessionToken
Parameters
Example
private function conflictHandler(event:ConflictEvent):void
{
// Alert.show("Server returned a Conflict !");
var conflicts:ArrayCollection = event.result as ArrayCollection;
// Ignore Server data and retain client Data in SQLite DB
var token:SessionToken = session.keepAllClientObjects(conflicts);
token.addResponder(new mx.rpc.Responder(conflictSuccess, conflictFault));
}
keepClientObject
Description
Ensures that the client object is retained instead of the one from the server (despite server raising data conflict).
The API also ensures that the retained client object is not sent to the server as a new operation on sync.
Parameter
Description
mx.collections.ArrayCollection
An
ArrayCollection
of conflicts raised by the server.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...