Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 691

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
<cffunction name="count" output="false" access="public" returntype="Numeric">
<cfargument name="id" required="false">
<cfargument name="param" required="false">
<cfset var qRead="">
<cfquery name="qRead" datasource="FDSCFCONTACT">
select COUNT(*) as totalRecords
from Contact
</cfquery>
<cfreturn qRead.totalRecords>
</cffunction>
Notifying the Flex application when data changes
You use the LiveCycle Data Services ES event gateway type provided with ColdFusion, to have ColdFusion
applications notify Flex when data that a destination manages has changed. You configure the LiveCycle Data Services
ES event gateway and write an application that uses the event gateway. For more information, see
Management Event
Gateway" on page 1316.
Authentication
To authenticate users when using the LiveCycle Data Services ES assembler, you use the Flex
setRemoteCredentials()
are passed to the ColdFusion application, where you can use the
you can set credentials in the Flex destination, although it is not the recommended way to do so.
You can set the credentials by doing either of the following:
• Specifying credentials in ActionScript
• Specifying credentials in the Flex destination
Specifying credentials in ActionScript
To specify credentials in ActionScript, you use the
shows:
ds = new DataService("mydest");
ds.setRemoteCredentials("wilsont", "password");
Specifying credentials in the Flex destination
To specify credentials in the Flex destination, you edit the data-management-config.xml file that is in the WEB-
INF/flex folder of the server on which you run the Flex application. In the
and
remote-username
remote-password
method on the DataService object. The credentials, which are in the FlexSession object,
setRemoteCredentials()
elements, as follows:
Last updated 1/20/2012
tag to perform authentication. Alternatively,
cflogin
method, as the following example
element, you include the
properties
686
"Using the Data

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents