Collaborative Data Entry with Flex and BlazeDS

After Yahoo Maps collaboration, here is another example of enabling collaboration in a Flex application using the publish/subscribe messaging infrastructure of BlazeDS.

This example demonstrates “collaborative forms” (or “collaborative data entry”). Users in different locations can fill in forms “together” in a real-time and in-context collaboration session: changes made by one user are automatically reflected in the other users application.

Testing the hosted version

  1. Access http://coenraets.org/collabforms/collabforms.html on two different machines or in two browser windows on the same machine.
  2. Click “Create Session” (bottom left) in one browser: a collaboration session is created with a unique collaboration session id.
  3. Enter this collaboration session id in the other browser and click “Join Session”.
  4. Change the selected Accordion tab in one browser, and notice that the Accordion in the other browser is automatically synchronized.
  5. Enter data in one browser and notice that the information is automatically synchronized in the other browser.
  6. On the Employment History tab, add a few companies (including start date, end date, and salary) and notice that the employment history list is automatically synchronized in the other browser.

You can right-click the application and select View Source or click here to see the source code of the application.

Notes:

  1. The way a collaboration session is actually started may vary depending on the application. In this example, one user creates a collaboration session, and shares the collaboration session id (via email, IM, etc…) with people he/she wants to collaborate with. In other use cases, the collaboration session could start automatically. For example, in a call center scenario, a user might click a “Live Help” button which would result in the creation of a support ticket appearing in the Support Reps application. A support rep could then take ownership of the ticket and enter a collaboration session using, for example, the ticket id as the collaboration session id. I will post a call center version of this example in the coming days.
  2. In this example, the synchronization is performed using pub/sub messaging. You could also use the Data Management Service available with LiveCycle Data Services to automatically keep data in sync between multiple clients.
  3. The hosted version of the application first tries to connect to the server using RTMP (available only as part of LCDS), and falls back to “long AMF polling” or regular AMF polling if the RTMP connection fails.

Local installation instructions:

  1. Install BlazeDS. You can download the BlazeDS turnkey server (a version of Tomcat with BlazeDS preinstalled) here.
  2. If you don’t already have a channel called “my-longpolling-amf”, open {blazeds-install-dir}/tomcat/webapps/samples/WEB-INF/flex/services-config.xml and add an AMF long polling channel defined as follows:
    <channel-definition id="my-longpolling-amf" class="mx.messaging.channels.AMFChannel">
    	<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
    	<properties>
    		<polling-enabled>true</polling-enabled>
    		<polling-interval-seconds>5</polling-interval-seconds>
    		<wait-interval-millis>60000</wait-interval-millis>
    		<client-wait-interval-millis>1</client-wait-interval-millis>
    		<max-waiting-poll-requests>200</max-waiting-poll-requests>
    	</properties>
    </channel-definition>
    
  3. Open WEB-INF/messaging-config.xml and add the following destination:
    <destination id="mortgage">
    	<channels>
    		<channel ref="my-longpolling-amf"/>
    		<channel ref="my-polling-amf"/>
    	</channels>
    </destination>
    
  4. (Re)start the BlazeDS turnkey server.
  5. Download the source code of the Mortgage Application here.
  6. Create a Flex Builder project for the Flex application (collabforms). Make sure you configure your Flex Builder project to work with BlazeDS. To read instructions on how to set up a Flex Builder project that works with BlazeDS, make sure your BlazeDS turnkey server is started, and click here.
  7. Compile the application.
  8. Open the Flex application in two browser windows (to simulate two users in different locations) and test the application as described above (in “Testing the hosted version”).



60 Responses to Collaborative Data Entry with Flex and BlazeDS

  1. EDGAR RIVERA April 8, 2008 at 3:42 am #

    Cool example !!!

    Blaze DS + Flex SDK + J2EE = The best openSource solution

  2. William from Lagos April 8, 2008 at 8:27 am #

    Just awesome! I love it.

  3. Gary Funk April 8, 2008 at 2:48 pm #

    Christophe, Is there a way around having to edit the messaging-config.xml file everytime someone adds a Flex application that uses messaging?

    I can see where an admin will get real tired having to do this every day.

  4. Mete Atamel April 8, 2008 at 9:27 pm #

    Gary, you can dynamically (with Java code instead of xml) create a messaging destination without having to modify messaging-config.xml. This can either be done via an AbstractBootstrapService (that gets called as the server starts up) or with a Java class that can be called via RemoteObject.

  5. Vijay Chakravarthy April 9, 2008 at 9:52 am #

    Is the BlazeDS subtopic filtering done on the client side or the server side? If its on the client side, wouldnt that expose serious security issues?

  6. Christophe April 9, 2008 at 10:07 am #

    Vijay,
    The filtering is done at the server-side.
    Christophe

  7. Aprigio Vasconcelos April 11, 2008 at 8:55 am #

    What should I do to get this example working in Granite DS?

  8. Mathieu April 17, 2008 at 4:01 am #

    Hi,

    First of all, thank you for your blog, this is a mine of information.

    However, I’ve got 2 questions :
    - What’s the difference between polling and long-polling and pushing technologies ?
    - How can I use pushing with AMF ?

    Thanks for all in advance.

  9. Christophe April 18, 2008 at 10:33 am #

    Mathieu,
    Damon has a good blog post that answers your questions in detail:
    http://www.dcooper.org/Blog/client/index.cfm?mode=entry&entry=8E1439AD-4E22-1671-58710DD528E9C2E7

  10. Mathieu April 21, 2008 at 2:33 am #

    I already read this artcile but I can’t understand some details (I’m not English). I come back to it and read it again trying to understand better.

    Thank you for reply.

  11. Taldir April 23, 2008 at 7:46 am #

    Hi,
    I enjoy so much this example. Thanks a lot for providing it ! I used this source to build my own “collaborative form” application.

    With the accordion, no problem… but I’m now trying to integer it into a “wizard” form navigation based on HBox element, inspired by the example there :http://blog.kevinhoyt.org/2007/02/18/thoughts-on-accordion-usability/

    No problem for propertyChange events, data is copied, but I can’t manage to exchange forms view when the wizard pages switches (you’re using IndexChangedEvent with the accordion but this event is not applicable to HBox…)

    here is a sample of code :

    Any idea ?

    I hope you’ll understand my English (sorry…) and my problem…

    Thanks a lot if you can help !

  12. Taldir April 23, 2008 at 7:53 am #

    Oops, It seems like posting source code is not allowed.

    Just another thing (one post, one subject…)

    There is a problem with the DateField property which has random results… The binding seems to have a problem, only the session initiator can change it. When the person who join the session try to modify it, the old date immediately goes back… (I tried various ways, everytime the same result).

    Have a nice evening :-)

  13. Taldir April 30, 2008 at 5:26 am #

    Good morning,

    I finally found myself issues for my two previous problems.

    Here is the way I solved the DateChosser binding problem :

    - In the Model, I declare the “Date” property as a String :
    public var dateNaissance:String = “”;

    - In the forms, I’ve put a DateField component binding its text attribute :

    And finally the binding of the DateChooser.text with the model text variable :

    There may exist a better way, but I hope this could help !

    I just discovered your updated version, which I found so exciting. Waiting for the source code to be published ! Thanks again.

  14. Gerdt Brouwer May 2, 2008 at 1:03 pm #

    Hi Cristophe,

    thanks for this great example.
    Don’t know what it’s like in the US right know but a example about mortgages is daring ;)

    Quote of Edgar who says it right :
    Blaze DS + Flex SDK + J2EE = The best openSource solution

  15. kobe May 30, 2008 at 10:51 am #

    hey
    thank you for sharing this website

  16. adg June 2, 2008 at 8:49 am #

    application always gives a bug in firefox
    after some time:

    flash player version 9,0,124,0

    firefox 2.0.0.14 (windows xp)

    –> unhandled exception in browser
    (+”debug in visual studio?” question)

  17. Polykrom June 4, 2008 at 12:36 am #

    Just for those who want to have a Coldfusion version of this app :

    in the messaging-config.xml, just ad this :

    to the end of the document…

    Restart the Coldfusion server

    and all works fine ! ;)

    regards

  18. Polykrom June 4, 2008 at 12:38 am #

    ok.. no source codes here, so go to Adobe Devnet Christophe article at :

    http://www.adobe.com/devnet/flex/articles/data_entry.html

  19. sohbet August 22, 2008 at 5:27 am #

    hey
    thank you for sharing this website

  20. key ödemeleri August 28, 2008 at 3:33 pm #

    thank you for sharing this website

  21. Flüge September 25, 2008 at 5:48 am #

    This looks really awesome, great transparency-style. I also want to thank you, as we are searching for new ideas and styles to improve our homepage.

  22. Forrest November 26, 2008 at 12:54 am #

    it’s not work on my mochine ,and on the FlashPlayer 10!!!!

  23. daslaber January 7, 2009 at 1:24 pm #

    There may exist a better way, but I hope this could help !

    I just discovered your updated version, which I found so exciting. Waiting for the source code to be published ! Thanks again.

  24. ajithmanmu January 18, 2009 at 12:20 pm #

    Hi all,
    i am a coldfusion developer and a flex aspirant. i want to know how we can integrate flex with blazeds and coldfusion. i dont know much abt blazeds. Can i make a chat applicatin in coldfusion with blazeds support and integrate in a flex site? is that possible? any tutorial links would be helpful..thnx..

  25. Data entry February 26, 2009 at 6:10 pm #

    This is a new thing for me, but i am glad that i came hear and make a know about this subscribe messaging infrastructure for data entry.

  26. ghd hair straighteners March 17, 2009 at 8:52 am #

    Hi all,
    i am a coldfusion developer and a flex aspirant

  27. araç sorgulama March 17, 2009 at 4:59 pm #

    Thanks a lot if you can help !

  28. Data Processing March 23, 2009 at 7:54 am #

    This appears good information shared in this post.

  29. Jeff Collins March 25, 2009 at 5:09 pm #

    Trying to figure out php, I know coldfusion is powerful.

  30. Gostixel May 16, 2009 at 5:04 am #

    Да,несогласен с предыдущими высказываниями
    ) Bye

  31. Ghd Straighteners August 31, 2009 at 1:16 pm #

    Thank you! I really like this. If want buy? I recommend this site: http://www.diymyhair.com. They are a good seller.

  32. sandrar September 10, 2009 at 5:11 pm #

    Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

  33. jenna September 21, 2009 at 11:50 am #

    Sign: yyams Hello!!! punht and 843dhursyvpxd and 7004 My Comments: Cool!

  34. megan fox topless October 7, 2009 at 12:42 pm #

    Sign: gfndc Hello!!! cbatx and 6399ckxbucncks and 5857 : I like your blog. cool post!

  35. Joe December 3, 2009 at 11:31 am #

    In this example is your web server using livecycle or blazeds? I ask b/c using my localhost (I only have blazeds setup) I cannot get this example to work. Other samples (gmaps, etc.) work but not this one.

  36. contact center Phil May 23, 2010 at 8:50 pm #

    Thanks for this demo. And might I add, this is a very helpful site. Keep it up!

  37. Guy Siverson August 3, 2010 at 12:49 pm #

    Interesting article about collaboration, as an application developer it is always great to see new technology emerging. Is this a good system to use for Open Source type items that would be readily available from the Web? In-other-words, how secure is it?

  38. rent2buynz August 8, 2010 at 10:20 pm #

    firstly thanks for the good info on this blog, some of the comments have also help me out, all of this for simply stumbling across this blog

  39. botox glasgow August 19, 2011 at 8:04 am #

    The top panel of you website shows up all out of whack! i’m using IE if it helps.

  40. envinvady January 16, 2013 at 2:47 pm #

    Howdy Near friends,

    I was pondering if there are any tips remaining for sites.
    I mean every issue proper up till now has been designed. I’m sensation like the promoting and marketing and advertising tips have been exhausted!
    What do you believe?

  41. orquesta canela October 14, 2013 at 3:57 am #

    I don’t even know how I ended up here, but I thought this
    post was great. I do not know who you are but definitely you are going to a
    famous blogger if you aren’t already ;) Cheers!

  42. Kerry Prat June 21, 2014 at 1:34 am #

    You are so awesome! I do not believe I’ve read through a single thing like that before. So wonderful to discover someone with some original thoughts on this subject. Seriously.. thanks for starting this up. This website is something that’s needed on the internet, someone with a bit of originality!

Trackbacks/Pingbacks

  1. Reboxetine. - July 14, 2008

    Vestra reboxetine….

    Vestra reboxetine. Reboxetine edronax. Reboxetine….

  2. Atomoxetine and drug abuse liability. - July 19, 2008

    Atomoxetine generic….

    Atomoxetine hci….

  3. Reboxetine. - July 20, 2008

    Vestra reboxetine….

    Vestra reboxetine….

  4. lär dig craps - July 20, 2008

    lär dig craps…

    idleness Carletonian?soldierly climbing engraver deafen!…

  5. Vestra reboxetine. - July 21, 2008

    Reboxetine….

    Vestra reboxetine. Reboxetine edronax. Reboxetine….

  6. Cooking classes houston tx. - August 2, 2008

    Leisure cooking classes houston texas….

    Recreational cooking classes. Cooking classes in ventura county. Cooking classes for kids. Austin cooking classes. Whole foods market cooking classes. Cooking classes chicago. Cooking classes west palm beach florida. Vegatarian cooking classes. Informa…

  7. Blazeds « It’s all about RIA - October 16, 2008

    [...] Christophe Coenraets :: Collaborative Data Entry with Flex and BlazeDS [...]

  8. click to view - March 10, 2009

    click to view…

    Here is some more information you can use….

  9. Alexander Shlemenko ready to move closer to second title-shot with win on Saturday night | Many Candles - October 18, 2011

    [...] Gracie Gregor Gracie Ralek Gracie Renzo Gracie Rickson Gracie Rodrigo Gracie Roger Gracie Rolles Gracie Royce Gracie [...]

  10. ‘M-1 Challenge 27: Magalhaes vs. Zayats’ re-airs Tuesday night on Showtime Extreme | Staten Island Community - October 18, 2011

    [...] Hasselvall Daiki DJ taiki Hata He Peng David Heath Delson Heleno Dan Henderson Josh Hendricks Ed Herman Heath Herring Branden Lee [...]

  11. Google Wallet adds coupons, rewards points, Jamba Juice | world.cybertech-support - October 18, 2011

    [...] TELETECH HOLDINGS TECHNITROL TAKETWO INTERACTIVE SOFTWARE SYNTEL SYNTAXBRILLIAN SYNOPSYS SYNNEX SYMANTEC This entry was posted in Uncategorized by Mark Shwartz. Bookmark the permalink. Proudly [...]

  12. Apple reports Q4 2011 financial results, 17.7 million iPhones, 11.2 million iPads, 6.62 million iPods, $6.62 billion in profits | Electronics Fashion Studeo - October 18, 2011

    [...] EQUIPMENT ASSOCIATES UNITED ONLINE UNISYS TRIQUINT SEMICONDUCTOR TRIMBLE NAVIGATION LIMITED TRIDENT MICROSYSTEMS This entry was posted in Uncategorized by Mark Shwartz. Bookmark the [...]

  13. White House Flooded With Online Petitions | motorcross99 - October 18, 2011

    [...] SCIENTIFIC GAMES SANDISK SALESFORCE COM SAIC ROCKWELL AUTOMATION RF MICRO DEVICES RED HAT RADISYS This entry was posted in Uncategorized by admin. Bookmark the [...]

  14. Analysts Predict Rough Road for BEA Portal Customers | Cyber-tech Support Electronics - October 18, 2011

    [...] SYSTEMS ADVANCED SEMICONDUCTOR ENGINEERING ALLIANCE DATA SYSTEMS ALLTEL AMAZONCOM AMERICA MOVIL AMKOR TECHNOLOGY This entry was posted in Uncategorized by Mark Shwartz. Bookmark the [...]

  15. IBM Chief Pitches Obama on $30 Billion Investment in IT | Cyber-tech Support Electronics - October 18, 2011

    [...] AVNET BHARTI AIRTEL BT GROUP CANON MEMC ELECTRONIC MATERIALS MICROSOFT MILLICOM INTL CELLULAR MOBILE TELESYSTEMS This entry was posted in Uncategorized by Mark Shwartz. Bookmark the [...]

  16. Apple’s fiscal 2011 by the numbers | Cyber-tech Support Electronics - October 18, 2011

    [...] DATA SYSTEMS ALLTEL AMAZONCOM AMERICA MOVIL AMKOR TECHNOLOGY AMPHENOL ANIXTER INTERNATIONAL APPLE COMPUTER This entry was posted in Uncategorized by Mark Shwartz. Bookmark the permalink. Proudly [...]

  17. Plantronics Extends UC Headsets To Mac, iPhone | control.cybertech-support - October 18, 2011

    [...] LAWSON SOFTWARE LAND SOFTWARE LAM RESEARCH L1 IDENTITY SOLUTIONS KINGSTON TECHNOLOGY COMPANY KEY JDS UNIPHASE This entry was posted in Uncategorized by Mark Shwartz. Bookmark the permalink. Proudly [...]

  18. Photography Classes Houston Texas | Photography Classes Houston - December 7, 2011

    [...] Classes Houston TexasPhotography Classes Houston Texas – Best Photography School Photography classes Houston Texas offers…audio and visual products like CDs and DVD video training. Complex and challenging projects are [...]

Leave a Reply