SYS-CON Media
 Register Now!
Save $200
Register before October 17th to SAVE! ... and also receive a FREE copy of the Best-Selling AJAX Book, a $119 Value!
Untitled Document
2008 East
Platinum Sponsor
Untitled Document
2008 East Gold Sponsors
Untitled Document
2008 East Exhibitors
Untitled Document
2008 East Media Sponsors
Untitled Document
2008 Association Sponsor
SYS-CON Media
2007 West Sponsors
Goingtomeet.com Conference Directory
SYS-CON Media
2007 East Sponsors
Untitled Document
2008 SYS-CON Events

Can't Miss RSS Feed
Subscribe to the AJAXWorld.com RSS Feed & Get All The Conference News As It Happens!

2008: Decision Year for RIAs - October 20-22, 2008 San Jose


AJAX Reporting Challenges & Solutions with Adobe Flex
Bringing together JavaScript, Flash Player, and Web Services

The XML file on the left is processed by the code on the right. The first three ActionScript trace statements demonstrate how you can access the elements and attributes of this XML stored in the variable myXML. The second line has a filtering criteria in parentheses: @id==2. This line means "find me all XML elements named item, and print the content of the element menuName for those that have the attribute id equal to 2. Pretty loaded and elegant line, isn't it?

After that, the code snippet above creates a newItem element and appends it to myXML, and then again uses dot notation to access XML elements and attributes.

From SOAP to JavaScript and FlashPlayer with ClearBI
ClearBI is a commercial Web reporter originally created for Flex/Java applications and worked only with server-side applications that had Adobe LiveCycle Data Services, which implemented a fast communication protocol called AMF. But the newest version of ClearBI 1.1 can work with the data that comes in a form of JavaScript objects, a Web Service, or uses OpenAMF, an open source implementation of the AMF0 communication protocol.

In this section I'll go over the process of getting the data from Amazon's SOAP Web Service to JavaScript and then to ClearBI. This is what has to be done after the Web Service is initialized by WebService.swf. This time we'll use a JavaScript object as an argument to the operation KeywordSearchRequest.

Pass a JavaScript object with retrieval args to a hidden swf object, which will return the data back to JavaScript, which in turn passes the data to ClearBI swf:

var ws = com.farata.jsfx.WebServices("MyWebService"); // a hidden swf

Add a Web Service operation result listener. The next line maps the WebService.swf method serviceresult to JavaScript's function onJavaScriptResult that will receive the data from WebService.swf when available and will format it as JSON objects.

ws.addEventListener("serviceresult", onJavaScriptResult);
var args = {
   KeywordSearchRequest: {
     keyword:     "AJAX",
     page:     "1",
     mode:     "books",
     tag:     "D3HW0PG66IPLAM",
     type:     "lite",
     devtag:     "D3HW0PG66IPLAM",
     sort:     null,
     variations: null,
     locale: null
   }
};

Call Amazon's "KeywordSearchRequest" Web Service operation.

ws.Amazon.KeywordSearchRequest( args );
...

The JavaScript function receives the data arriving as JavaScript into a variable lastData.

function onJavaScriptResult(ev) {
    lastData = ev.result.Details;
    this.removeEventListener("serviceresult", onJavaScriptResult);
   }

Now we can pass the data from lastData to clearBI.swf for displaying and customizing the report.

Pass the Data to ClearBI from a JavaScript Array
In JavaScript, get a reference to the Flash Player object and call the function loadReport giving the report name (a template customized by the user and stored in a database) and the data itself:

var report

report = $plugin("ClearBIPlayer"); // a helper function to return reporter's id
report.loadReport(reportName, lastData);

The data exchange between JavaScript and ClearBI.swf is supported internally by the ActionScript class ExternalInterface. The report variable above represents ClearBI.swf, which internally (in ActionScript) allowed JavaScript calling its function loadReport, which is mapped to ActionScript's loadReport function.

ExternalInterface.addCallback("loadReport", loadReport);

That's all there is to it. End users can run and customize reports themselves. For example, their Web browser window may look like Figure 4. The top portion of the screen is regular JavaScript while the report and its editor are rendered by Flash Player 9.

Using a Faster Communication Protocol: OpenAMF
If you're building your application in-house and it doesn't have to connect to someone else's Web Service, you may be better off creating a Java-based data feed using faster communication protocol called OpenAMF. This open source implementation of the AMF communication protocol performs serialization of the server-side POJO into its ActionScript peer on the client (see Figure 5). This is how it goes:

  • Client: A Web browser with Flash Player 9 plug-in or ActiveX
  • Mid-tier: A servlet container with open source OpenAMF (five jars), open source Flex SDK, ClearBI's jars to support report compilation and hot deployment, JOTM, JTS, JDBC drivers
  • Report persistence: ClearBI uses two database tables to store reports' metadata (can be co-located with other data)
  • Report publishing: Reports can be compiled into swf files and published on the Web
Summary Proper integration of JavaScript and Flash Player's components can enrich your AJAX application with powerful reporting capabilities offered by ClearBI (written in Adobe Flex). If you aren't into reporting, just use the WebService.swf to communicate with SOAP Web Services.

You can download the description of the API for the JavaScript wrapper to WebService.swf at www.myflex.org/demo/webservice_swf/doc/. The WebService.swf is located at www.myflex.org/demo/webservice_swf/WebService.swf .

The trial version of ClearBI 1.1 became available on October 15, 2007 at www.myflex.org.

The demo application that uses JavaScript, WebService.swf, and ClearBI.swf is deployed at www.myflex.org/theriabook/ClearBI.Ajax/main.html. It looks like Figure 6.

In the first three tabs you'll be able to play with sending XML and JavaScript requests to Amazon, and the last three tabs are supported by ClearBI (the name of the report is Amazon.KeywordSearchRequest. You might want to watch a short pre-recorded demo that shows working with a sample Employees database and using ClearBI editor for report customization. This demo is located at . It shows how end users can add grouping, modify styling, and apply formulas.

About Yakov Fain
Yakov Fain is a Java Champion and a co-founder of the IT consultancy Farata Systems and the product company SuranceBay. He wrote a thousand blogs (http://yakovfain.com) and several books about software development. Yakov authored and co-authored such books as "Angular 2 Development with TypeScript", "Java 24-Hour Trainer", and "Enterprise Web Development". His Twitter tag is @yfain

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Latest AJAXWorld RIA Stories
Containers and Kubernetes allow for code portability across on-premise VMs, bare metal, or multiple cloud provider environments. Yet, despite this portability promise, developers may include configuration and application definitions that constrain or even eliminate application po...
Enterprises are striving to become digital businesses for differentiated innovation and customer-centricity. Traditionally, they focused on digitizing processes and paper workflow. To be a disruptor and compete against new players, they need to gain insight into business data and...
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing sm...
DXWorldEXPO LLC announced today that Ed Featherston has been named the "Tech Chair" of "FinTechEXPO - New York Blockchain Event" of CloudEXPO's 10-Year Anniversary Event which will take place on November 12-13, 2018 in New York City. CloudEXPO | DXWorldEXPO New York will present ...
Chris Matthieu is the President & CEO of Computes, inc. He brings 30 years of experience in development and launches of disruptive technologies to create new market opportunities as well as enhance enterprise product portfolios with emerging technologies. His most recent venture ...
Untitled Document

Call 201 802-3020 or Click Here to Save $200!

Register Today and
Save $200

Your registrations includes: Golden Pass Delegates will receive full conference access on October 20-22, 2008 including: Lunch and Coffee Breaks, Collectible Bag and Archives of all sessions on DVD. Includes access to all Conference Sessions including the Technical Sessions, Exhibits, Keynotes, Vendor Technology Presentations, and Power Panels.


Sponsorship Opportunities

AJAXWorld offers the undisputed best platform to position your company as a leading vendor in the fast-emerging marketplace for AJAX and Enterprise Web 2.0.


Please call
(201)802-3020


Who Should Attend?

 CTOs & VPs of Engineering
 Directors of Technology
 Sr. User Interface Architects
 Front-End Engineers
 VCs & Industry Analysts
 Directors of Business Development
 Software Engineers
 Senior Architects
 Application Programmers & Software Developers
 Project Managers
 Web Programmers & Designers
 Companies & Organizations that need to stay in
  front of the latest Web technology

AJAXWorld Security Bootcamp

Introducing at AJAXWorld RIA Conference 2008 West the world's first-ever full, one-day immersive "AJAX Security Bootcamp" - led by one of the world's foremost AJAX security experts and teachers, HP's Billy Hoffman.

View the full one-day schedule



AJAXWorld 2008 West - Tracks

Track 01: Enterprise RIAs
Track 02: Frameworks & Toolkits
Track 03: Web 2.0 & Mashups
Track 04: Hot Topics
Track 05: The Future of the Web
Track 06: iPhone Developer Summit



Brought To You By:

AJAXWorld Magazine is the pre-eminent independent vendor-neutral resource for the fastest growing new segment of the software business: entirely Web-based applications and experiences.

Download the Latest Issue!

AJAXWorld Webcasts



SYS-CON EVENTS


AJAXWorld Keynotes & Power Panels

2008 SYS-CON TV Keynotes: Can We Fix the Web? By Douglas Crockford - by Douglas Crockford
2008 SYS-CON TV Keynotes: 2008: The Year of the RIA - by Anthony Franco
2008 SYS-CON TV Power Panel: The Business Value of RIAs
2008 SYS-CON TV Power Panel: What Lies Beyond AJAX
2007 SYS-CON TV Keynotes: Why Web 2.0 for the Enterprise Is Far More Than Just a Facelift - by Ted Farrell
2007 SYS-CON TV Keynotes: Fueling the Next Generation Web: A Peek Behind the Green Curtain - by Bob Brewin
2007 SYS-CON TV Keynotes: AJAX in the Balance - by Joe Stagner

AJAXWorld Sessions on SYS-CON.TV

· Bill Scott - Yahoo! UI Library
· David Heinemeier Hansson - AJAX on Rails
· Jesse James Garrett - Elements of User Experience
· Dion Hinchcliffe - Real World AJAX
· Eric Miraglia - Open Source AJAX Development
· Paul Rademacher - Mashing Up Your Web Application
· Adam Sah - Google Gadgets
· Doug Crockford - An Introduction to JavaScript
· David Linthicum - Enterprise Web 2.0
· Patrick Grady - The Imagination & Experience Web

AJAXWorld...All The AJAX Rock Stars in One Spot!


Past Events Archive

SOAWorld Conference & Expo 2008 East
soa2008east.sys-con.com
Virtualization Conference & Expo 2008 East
virt2008east.sys-con.com
AJAXWorld 2008 Conference & Expo East
ajaxmar08.sys-con.com
SOAWorld Conference & Expo 2007 West
www.soaworld2007.com
Virtualization Conference & Expo 2007 West
virt2007west.sys-con.com
AJAXWorld 2007 Conference & Expo West
ajaxoct07.sys-con.com
SOAWorld Conference & Expo 2007 East
soa2007east.sys-con.com
Virtualization Conference & Expo 2007 East
virt2007east.sys-con.com
AJAXWorld 2007 Conference & Expo East
ajaxmarch07.sys-con.com
Other SYS-CON Events
events.sys-con.com

Join Over 10,000 Early AJAX Adopters
Who Have Attended AJAXWorld
• A&R Edelman
• Academic Enterprise
• Accoona Corp [2 delegates]
• Acxiom
• Adams Capital Management
• Adaptive Edge
• Adaptive Path
• Adobe Systems Incorporated [21 delegates]
• Adobe Systems Romania
• Ajax13
• All Risks, Ltd.
• alliance
• Alliance For Community Care
• AlphaDetail Inc
• Altera Corporation
• Amazon.com [6 delegates]
• Appeon Corporation [2 delegates]
• Apple Computer [5 delegates]
• Apress [3 delegates]
• Arkivio
• ASA
• Astute Solutions
• Avaya Inc [2 delegates]
• Avenda Systems
• Avenue A | Razorfish [3 delegates]
• Axcella, LLC [2 delegates]
• Aximsoft
• Azimyth
• Backbase USA Inc. [4 delegates]
• BAE Systems [2 delegates]
• Bank of America [2 delegates]
• Barkley Evergreen & Partners Interactive
• Bayview Financial [2 delegates]
• BEA Systems [3 delegates]
• Billeo
• BMC Software, Inc. [2 delegates]
• Borland Software Corporation
• Bradford Technologies, Inc [2 delegates]
• Brilliance
• Brocade Communications Systems, Inc. [2 delegates]
• Brookside Capital LLC
• Brulant
• Bungee Labs, Inc [6 delegates]
• Bureau of Labor Statistics
• BUZ Interactive
• Cadena Software
• Calix Networks
• Callidus Software [2 delegates]
• Cambia Security
• Carnegie Mellon West
• Cautella, Inc.
• CBSA
• Celequest [3 delegates]
• Change Vision, Inc.
• Charles E. Kenney, CPA
• Charles Schwab & Co., Inc. [8 delegates]

   read more...


ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

.NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
Open Web Developer's Journal - OPEN WEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2

SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
SYS-CON EVENTS  |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  OpenWeb Developer Summit  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
 Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.