1 / 41

ColdFusion 8 & LiveCycle Data Services Faster, Better and Cooler than ever!

ColdFusion 8 & LiveCycle Data Services Faster, Better and Cooler than ever!. Tom Jordahl ColdFusion Architect June 27, 2007. Introduction. Architect - Adobe ColdFusion Team Primary implementer of LiveCycle Data Services integration. Topics. What's new for ColdFusion 8

moya
Télécharger la présentation

ColdFusion 8 & LiveCycle Data Services Faster, Better and Cooler than ever!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ColdFusion 8 & LiveCycle Data ServicesFaster, Better and Cooler than ever! Tom Jordahl ColdFusion Architect June 27, 2007

  2. Introduction • Architect - Adobe ColdFusion Team • Primary implementer of LiveCycle Data Services integration

  3. Topics • What's new for ColdFusion 8 • Overview - LiveCycle Data Services • RPC • Messaging • Data Management

  4. Integrated LCDS Install for ColdFusion 8 • Integrated installation option for LiveCycle Data Services • No need to use RMI for communication

  5. LiveCycle Data Services – Connection to CF ColdFusion Data Services CFC CF Adapters: Messaging Data Service Messaging Gateway Assembler Service RMI ColdFusion 8 CFC Messaging Gateway Assembler Service CF Adapters: Messaging Data Service

  6. RPC Services Data Management Messaging Web Service Data Sync Collaboration Remote Object OCC Pub/Sub HTTP Service Paging Data Push LiveCycle Data Services LiveCycle Data Services Web-Tier Compiler Message Service

  7. Topics • Overview of FDS • RPC • Flex Messaging • Flex Data Management

  8. RPC: Flash Remoting Update • High Performance Binary Protocol • AMF3 • Built in to ColdFusion – even if you don’t install LCDS • New features (since CFMX 7.0.2) • Value Objects • Data type translations • Performance improvements in AMF3

  9. ColdFusion and Flash Remoting Update • No Flex Server involved when using Flash Remoting ColdFusion CFC AMF 3 ColdFusion Adapter MessageBroker Servlet

  10. Topics • Overview of LCDS • RPC • Messaging • Data Management

  11. LCDS Messaging • Publish & Subscribe • Producer and Consumer • Asynchronous communication • Messages have header and body • Values can be complex types • Values are converted to/from CFML and Actionscript types • ColdFusion can be both a Producer and Consumer • Publish – sendGatewayMessage() • Subscribe – Event Gateway CFC

  12. What’s new in ColdFusion 8 • Performance enhancements • Default operation now uses Java API instead of RMI • Must specify host/gatewayhost in configuration for RMI operation • Default in CFMX 7.0.2 was assumed to be localhost • Must specify localhost if not using integrated LCDS

  13. Messaging – Connection to CF ColdFusion Data Services CFC Event Gateway Adapter Flex Messaging Gateway RMI ColdFusion CFC Event Gateway Adapter Flex Messaging Gateway

  14. ColdFusion ColdFusion Adapter Messaging: Client-Initiated Message LiveCycle Data Services Message Service Endpoint RTMP AMF HTTP Publisher Subscriber

  15. Messaging: Push LiveCycle Data Services ColdFusion ColdFusion Message Services Endpoint ColdFusion Gateway RTMP AMF HTTP Publisher Subscriber

  16. Messaging – LCDS Configuration • Flex uses Destinations as a basic configuration concept • There are destinations for RPC, Messaging and Data Management • Messaging configuration is found in messaging-config.xml • C:\ColdFusion8\wwwroot\WEB-INF\flex\messaging-config.xml • Clients publish to or consume from a destination • The “ColdFusionGateway” destination pre-configured by default

  17. Messaging – LCDS Configuration • Destination must specify the CF Event Gateway ID • “*” means to look in the message for the target Event Gateway • Preconfigured Destination: <destination id="ColdFusionGateway"> <adapter ref="cfgateway" /> <properties><gatewayid>*</gatewayid> </properties> <channels> <channel ref="cf-polling-amf"/> </channels> </destination>

  18. Messaging – ColdFusion Configuration • Configure a new ColdFusion Event Gateway • Configuration file is optional • Simple property file • Destination – Which Flex destination to send messages • Host – Where is Data Services running? • By default we look for the integrated LC Data Services • allowedIPs – Which remote machines are allowed to talk this gateway • Actionscript conversion options: • Force-cfc-lowercase • Force-query-lowercase • Force-struct-lowercase

  19. Messaging with CF • Example – send message from CFML • Example – receive message in CFC

  20. Topics • Overview of FDS • RPC • Flex Messaging • Flex Data Management

  21. Data Management • Manages distributed data in Flex Applications • Data Replication & Synchronization • Data provided to clients • Changes reflected on all clients • Server manages changes to the underlying data resource • Manage large collections of data • Nested data relationships • One-to-one • One-to-many • Occasionally Connected Clients

  22. Updates in ColdFusion 8 • Performance improvements • CFC creation is much faster (value object mapping goes faster) • Can return a ColdFusion Query directly instead of creating an array of CFCs • Can choose to use structures instead of CFCs to map to ActionScript objects • Use “__type__” key in structure to provide Actionscript type • Data Management notification gateway added • ColdFusion can notify LCDS that data it is managing has changed • Individual and batch notifications supported

  23. Data Management LiveCycle Data Services ColdFusion Data Service Endpoint CFC Adapter

  24. Data Management – Connection to CF CFC ColdFusion Data Services RMI CF Data Service Adapter Flex Assembler Service ColdFusion CFC CF Data Service Adapter Flex Assembler Service

  25. Data Management - Assemblers • The code that actually manages the data is called an “Assembler” • Assemblers can be written as ColdFusion Components • A basic assembler has four methods: • Fill • Get • Sync • Count

  26. CFC Assemblers • Fill • Returns a data set when called, can have optional parameters • Data is returned as an array of CFCs or a query • Get • Returns a single item (row) when passed in an identity value • Sync • Takes a list of changes and applies them to the data • Count • Returns the number of records that fill would return

  27. Creating an Assembler CFC • Show Eclipse Wizard

  28. Configuring Data Management • Must define channels • Channels are how Flash communicates to LCDS • Flex configuration file: services-config.xml • C:\ColdFusion8\wwwroot\WEB-IN\flex\services-config.xml • ColdFusion requires a special flag on its channels<serialization> <instantiate-types>false</instantiate-types></serialization> • Turn on debugging to see what is going on<logging> <target class="flex.messaging.log.ConsoleTarget" level="Debug">

  29. Configuring Data Management • Again we use destinations • Configuration file: data-management-config.xml • C:\ColdFusion8\wwwroot\WEB-INF\flex\data-management-config.xml • “Contact” application sample destination configured

  30. Configuring Data Management • Specify special ColdFusion channels • cf-polling-amf – Polling over HTTP, scalable and works through firewalls • cf-rtmp – Disabled by default, uncomment and add to destination to use • Specify the CFC used as the Assembler • Use dot notation or path • Specify the scope • Application – Single CFC instance created and cached • Gotcha: making changes to CFC when cached has no effect! • Request – New CFC created for each operation • Use for development • Use for production now that CFC creation is faster

  31. Configuring Data Management <destination id="cfemployee"> <adapter ref="coldfusion-dao"/> <properties> <component>samples.crm.EmployeeAssembler</component> <scope>application</scope> <metadata> <identity property="employeeId"/> </metadata> </properties> <channels> <channel ref="cf-polling-amf"/> </channels> </destination>

  32. Flex Data Management with CF • Example – Contact application

  33. Data Management Notification • ColdFusion 8 adds a new Event Gateway: DataManagement. • Notifies LCDS of changes to data made outside of Flex • i.e. CFML page updates a record also displayed by a Flex application • Call SendGatewayMessage(): <cfscript>update = StructNew(); update.destination = "cfcontact"; update.action = "update"; update.previousversion = oldContact; update.newversion = newContact; update.changes = "firstName,lastName"; r = SendGatewayMessage(“MyDataGateway", update);</cfscript>

  34. Flex Data Management with CF • Example – Notification

  35. CFC Assemblers – optional function • Flex maintains the state of all the fill functions for all clients • When a change happens, it does an automatic refresh of each • fillContains method allows the assembler to indicate if a fill needs to be updated • <fill-method><use-fill-contains>true</use-fill-contains> <auto-refresh>true</auto-refresh> <ordered>false</ordered> </fill-method> • Define the method like this • <cffunction name="fillContains" returnType="boolean" access="remote"><cfargument name="fillArgs" type="array" required="yes"><cfargument name="item" type="[CFC type object]" required="yes"><cfargument name="isCreate" type="boolean" required="yes">

  36. MXML Tag • JSP tag library to compile MXML code inline or on disk • <cfimport prefix="flex" taglib="/WEB-INF/lib/cf-bootstrap-for-flex.jar"><flex:mxml height="300" width="600"><?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"> app goes here<cfif switch>do something in mxml<cfelse>do something else in mxml</cfif></mx:Application></flex:mxml> • You can compile files on disk as well • <flex:mxml source="app.mxml" height="300" width="600"> • PERFORMANCE WARNING: You can really get in to trouble with this!

  37. Questions?

  38. Resources • Flex coders yahoo group • http://groups.yahoo.com/group/flexcoders/ • ColdFusion 7.0.2 Documentation • http://download.macromedia.com/pub/documentation/en/flex/2/using_cf_with_flex2.pdf • http://www.adobe.com/support/documentation/en/coldfusion/mx702/cf702_releasenotes.html • Flex Documentation • http://livedocs.adobe.com/flex/201/

  39. Flex Messaging – Security • Integrated LCDS is the most secure – No network traffic • If allowedIPs not configured both LCDS and CF sides will only accept connections from the same machine • You can configure a list of allowed IP addresses for both sides • Gateway configuration file • Flex Destination • If IP addresses don’t match, “Permission Denied” is returned. • No details for security reasons • Possible to have one side configured differently from the other!

  40. Non-Integrated Configuration for Data Management • Enable Flex Data Management support • Make sure the service is enabled in the ColdFusion Administrator • Identity • Used when you have more than one ColdFusion instance on a machine • SSL encryption • The RMI connection between ColdFusion and Flex can be protected by SSL • You must configure a certificate in to ColdFusion (the “server” in this case) • You can use the Java “keytool” program to generate a certificate CFC ColdFusion Flex CF Data Service Adapter Flex Assembler Service RMI over SSL

More Related