views:

286

answers:

3

I've seen a bunch of screencasts demonstrating the integration between blazeds and flex, also some lcds tutorials, model driven or not.

I've seen that some of them the presenter opens 2 browsers and once you change one value in a grid, it propagates to all other grids that presents the data.

I am wondering how the heck this is done, and how to reproduce.

Does this feature depends of the Edge / LCDS solution? I don't think so, but I've never seen some code explaining about it.

I feel it may or may not rely on JMS / MQ / messaging protocols or if this is some sort of 2 way sync and propagation of collection between instances of the same service result.

Thanks for any inputs.

Cheers,

Ernani

+1  A: 

To do this you need to keep an open socket connection between the client and the server so that the server can push data back to the client.

I believe that the RTMP protocol was used for this two-way communication.

I understand that this is the primary reason to use LiveCycle Data Services over BlazeDS. WebORB also has push functionality, as does GraniteDS. I've also seen demos where this is done with ColdFusion.

If none of those options are available to you, you're stuck doing some kind of polling to the remote server.

Unfortunately, I do not have specific code samples to share.

www.Flextras.com
Thanks for your reply, but the samples with LCDS are far easier as I've seen, it's got to be a way to define this in an easier way. I feel what it needs is to keep some sort of application state of the last loaded array and flush back or poll it.This video provides a sample of a model driven feature on LCDS. Considering that the BlaceDS is a small footprint version of LCDS, and we need to ensure some sort of state replication, this would be a must have feature in BlazeDS.http://vimeo.com/6612999Thanks again.
Ernani Joppert
+4  A: 

You can implement this feature both with BlazeDS and LiveCycle Data Services. BlazeDS provides remote and messaging features (the messaging features is the one allowing you to synchronize the data between the clients), LCDS extends BlazeDS adding new features like data management (productivity improvements), PDF generation, EDGE server for dealing with DMZ zones), MDA development, portal integration etc. It also adds some advanced messaging features like message conflation, throttling, reliability.

BlazeDS is free and open source and in my opinion a robust solution, you can use it if you want to synchronize the data between clients. LCDS adds a lot of things, but the LCDS customers should have a large budget.

How does it work? There is no JMS behind for this feature (however BlazeDS can integrate with a JMS provider so you can have one client in broswser and the second one running a SWING application). Instead there are some message queues on the server and a publisher - subscriber graph. In order to push the data from the clients to the server there are several choices, the more advanced are available only on LCDS: HTTP polling, HTTP long polling, HTTP streaming, RTMP sockets (LCDS only). All of them are described in details on Damon blog.

If you want to see some code go and download BlazeDS and take a look on the samples, there are several ones showing the messaging features. Also there a tomcat server is bundled in the download, and the samples are already deployed in it.

Cornel Creanga
Great answer. I'd also like to add that there are some live samples of the Messaging and Data Management features in Tour de Flex: http://flex.org/tourThe Data Management samples might be broken at the moment due to the database being down. But the TDF team is working to resolve that.
James Ward
Thanks, great answer indeed, so in order to resume this question, this is only doable using a MQ endpoint? I thought of managing this with RemoteObjects only, but it seems impossible, right?
Ernani Joppert
Yes it is..download the Spring BlazeDS Integration Samples (http://static.springsource.org/spring-flex/docs/1.0.x/reference/html/ch06.html) and you will find a sample using ActiveMQ.Yes, it is almost impossible, you need to use the producers and the consumers objects. Almost impossible means that you can do something by implementing your own polling based on periodic remote calls but it is overkill.
Cornel Creanga
I've managed to make some test situation using a custom polling interval request using timers, but this is duct-taping programming ;) I feel that using JMS is far better and will seek for the best. Thanks man. Really appreciate your help.
Ernani Joppert
A: 

A simple sample showing how to do this using WebORB can be found here: http://www.kensodev.com/2009/11/01/synchronize-client-application-using-flexweborb-net/

That sample is based on WebORB 3 for .NET; WebORB 4 is now available, for both .NET and Java.

Point being: This is brain-dead simple using WebORB, which is FREE (although a paid Enterprise version is also available). God forbid that anyone should shell out $30K for LCDS just to get this feature.

--- Jim Plamondon, Midnight Coders (makers of WebORB)

JimPlamondon