Wednesday, October 15, 2008

Using LCDS Data Management with Flex/AIR & Cairngorm

Last night I gave a presentation on LCDS Data Management and how to use it with Flex, AIR & Cairngorm. I wanted to post the presentation and source code so that you can learn from it. The presentation is self explanatory and the Flex Project easily integrates with the LCDS 2.6 Samples WAR. The Flex Project and Presentation cover the following subjects:
  • The differences between BlazeDS & LCDS
  • Channel Options for both technologies
  • What is Data Management?
  • How to connect Flex/AIR to LCDS
  • Default fill() versus Page fill() Assemblers
  • Performance considerations when writing Assemblers
  • Offline capabilities and caching with AIR
  • Tips & Tricks from lessons learned

The sample application is easy to install. Simply follow these steps:
  • Deploy the LCDS 2.6 Samples WAR to JBOSS and make sure it works. Simply explode the WAR and place it in the “deploy” directory. (You don't have to use JBOSS)
  • Open the project zip file, import the project into FlexBuilder 3 and change the build directory to a location in the Samples WAR.
  • Compile the Java Classes into the WEB-INF/classes directory of the Samples WAR.
  • Point the “-services” compiler directive in the Flex Project at the services-config.xml file in the “config” directory of the project. Also, either integrate the destinations in data-management-config.xml and remoting-config.xml into your WAR config Flex files located in WEB-INF/flex or copy over them. You may have to eliminate a few destinations if you copy over them.
  • Compile and run…

The project has good examples for calling two types of Assemblers, a Default Fill and Page Fill Assembler. It also shows how to implement a DataService “Manager” rather than a “Command – Delegate” Pattern for dealing with Data Services in Flex/AIR and also custom sorting and filtering across both Assemblers. There is also an example of using a “DataServiceTransaction” to update a destination through a Remote Object and propagate changes to each client.

Note: You will need to wait about 60 seconds before these links become active to download these files....be patient...thanks...

(If the links are broken please email me and I will send you the files directly....)

LCDS Presentation

LCDS Sample Project

Please email me with any questions and let me know if you run into other issues installing the project. I will update the post based on your feedback...

6 comments:

Don said...

The link to the presentation appears to be incorrect? What's the correct download url for
1_LCDS Flex Data Management.zip?

Brian O'Connor said...

You simply need to wait 40 seconds before the link in active....watch the bottom right portion of the page.

Anonymous said...

I am not able to download files from that link ,could you please check this I need it urgently

Brian O'Connor said...

I updated the posting to indicate that you need to wait 60 seconds for the links to become active..

Anonymous said...

Thanks a lot for quick response.
My browser had some issue and was asking for enable java script. I tried in different box and is fine.
Could you please help me with some samples how I can use Producer and Consumer (LCDS) with this frame work

Brian O'Connor said...

If you want to look at Producer & Consumer Applications you should look at the "Messaging" Functionality in LCDS. There is a simple "Chat" sample that comes with the "samples" WAR. That should get you started....