YOUR FEEDBACK
Jeremy Geelan wrote: In response to inquiries and suggestions from readers this lexicon has recently...
AJAXWorld RIA Conference
$300 Savings Expire August 29
Register Today and SAVE!


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TOP COLDFUSION LINKS


ColdFusion To Flex Super Wizard
Building Cool Applications

ColdFusion Extensions for Flex, included in ColdFusion MX 7.0.2, enable Flex Builder 2.0 developers to automate the more mundane tasks like CRUD (creating, reading, updating and deleting records) by creating ColdFusion components, ActionScript class files, and code to invoke a Web Service.

In this article we will use the ColdFusion/Flex Application wizard to automatically generate Master, Detail and Master/Detail pages that will let the user create, read, update and delete artist information supplied from a database. The application will include ColdFusion Components, Flash ActionScript classes, as well as Flex MXML pages. Special thanks to Damon Cooper and Dean Harmon for helping me better understand the CF/Flex Super Wizard.

First we have to make sure we have all the software we need to make our software writing jobs easier.

The following software will be used in this example:

  1. Windows XP Home Edition (the operating system I am using)
  2. Java2Runtime Environment Std Edition 1.4.2.12 (needed to run Eclipse)
  3. Eclipse SDK 32win32 (the tool we will be using to develop in)
  4. Flex Builder 2.0 with Charting (this contains the CFFlex Wizard)

    Please see my previous article "My First Flex App" in September CFDJ (Vol. 8, Issue 9) for instructions on how to install Flex Builder and Eclipse.

  5. ColdFusion MX 7.0.2 (contains the ColdFusion Extensions for Flex Builder)

    To install the ColdFusion Extenstions for Flex Builder (in Flex Builder):
    A) Select Help > Software Updates > Find and Install.
    B) Select the Search for New Features and Install option, click Next.
    C) Click New Archive Site.
    D) Select the ColdFusion_Flexbuilder_Feature.zip file, click Open.
    (If you installed CF MX 7.0.2 using the default values, look in the Extras Folder.)
    E) When the Edit Local Site dialog box appears, click OK.
    F) Ensure the ColdFusion Flex Builder feature is selected, then click Finish.
    G) Select the check box next to ColdFusion_Flexbuilder_Feature.zip, then click Next.
    H) Accept the terms of the license, then click Next.
    I) Click Finish.
    J) Click Install All.
    K) When the installation is complete, click to restart Flex Builder.

  6. Lastly, make sure RDS is set up correctly to allow ColdFusion to access the database you will be using. To configure RDS in Flex Builder:
    A) Select Window > Preferences > RDS Configuration
    B) I will be using the default localhost server in this example:
  • Select localhost
  • Enter Description
  • Host Name 127.0.0.1
  • Port Number 8500 (if you are using the built in web server)
  • I won't be using the Context Root.
  • RDS password
    C) To Test the connection, select the server, then click Test Connection.
    D) To view files in Flex Builder, select Window > Other Views, RDS, RDS Fileview to select files or RDS Dataview to select data sources.
  1. Please reference the livedocs for more information on setting up the ColdFusion extensions and RDS in Eclipse to use ColdFusion with Flex: http://download.macromedia.com/pub/documentation/en/flex/2/using_cf_with_flex2.pdf
Once everything is installed, we are ready to use the CFFlex Wizard to create an application. This application demonstrates how you can use the CFFlex Wizard and Flex Builder 2.0 to "automatically" create a Master, Detail, and Master/Detail page to create, read, update, and delete artist information along with their specific pieces of art. As you will see, the CFFlex Wizard will generate Flex, Flash and ColdFusion pages for you. Read on and be amazed!

To Create the application while in Eclipse, select CTRL + N and select the ColdFusion/Flex application wizard (see Figure 1).

Press Next and read through text displayed. Press Next again (see Figure 2).

Since this is a new application we will click Next to specify our settings. (If we wanted to load settings from a previous application, we could just select the "Load ColdFusion/Flex Application Wizard Settings" button instead) (see Figure 3).

Select your RDS Server where your Data Source is located, then select the Data Source being used in your application. Press Next. (ColdFusion uses RDS to get the metadata from your Data Source here) (see Figure 4).

This is where we will define the Page Layout and Design for our first page (see Figure 5).

We will select "Master" for the Master Page Type. This will generate a page that just lists information. Then select the "Edit Master Page" button (see Figure 6).

Select the artists table from the list of tables on the left (see Figure 7).

Select from the artists table the ARTISTID, FIRSTNAME and LASTNAME. Click Save (see Figure 8).

Enter "List of Artists" next to the Name: label to name the page. Select + to Add the next page (see Figure 9).

Name the page Artist Detail and select "Detail" as a Page Type then select the "Edit Detail Page" button (see Figure 10).

Double-click the artists table. This time the wizard automatically ties the artists to the ARTISTID as indicated by the "ID" parameter (see Figure 11).

Next we add the two pages to the Navagation Tree to the left. Select Next (see Figure 12).

Here we can change settings that could affect the Flash Remoting settings; the Web Root URL settings; the Project Name and Web Root Folder, where the Project will be placed; as well as the Wizard Settings. This time we will accept the default settings, so click Finish (see Figure 13).

The wizard makes the ArtExample project, then compiles it! Automatically created is the ColdFusion code (as seen by the ColdFusion components on the left) as well as the Flex code (as seen by the Main.mxml Source code on the right). WOW! That's what I thought when I saw this! (see Figure 14).

Here, we just double-clicked on the List_of_Artists.cfc to look inside at the query (see Figure 15).


About Mary McDonald
Mary McDonald has served the last four years as the Northern Indiana Adobe Users Group Manager (see www.ninmug.org), has attended many conferences including CFUNITED, MAX, MXNorth and TodCon. Out of her 16 years working as a software developer, Mary has worked the last 6 years with ColdFusion, SQL, Flash, and Flex and is a Certified 5.0 ColdFusion Developer. Mary's other interests include music, photography, traveling, dogs, and most recently Tai Chi.

YOUR FEEDBACK
Randy Smith wrote: Got it working - remember to remove the pound sign from in front of each of the options! I assumed that if they said there was a "default" version that you didn't need to specify the parameters. Wrong!
Randy Smith wrote: This was written in 2005. Here it is 2008 and I'm trying to apply this using Cold Fusion 2008 Enterprise, but I can't get the instance to start. The log files are basically saying that talk.google.com won't let me connect. Is there now a different IP I should connect to, or did Google shut down this "portal"?
emanuel wrote: Where can i download this bot? Thanks.
Mark Holton wrote: This is an awesome overview - Thanks for taking the time to supply this great info, Ben!
CFDJ LATEST STORIES . . .
Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted to be...
Red Hat CTO Brian Stevens, Citrix CTO Simon Crosby, Egenera CTO Pete Manca, Allen Stewart, Group Manager, Windows Virtualization at Microsoft, and Brian Duckering, Sr. Director of Products and Alliances at Symantec were the top industry executives who joined Jeremy Geelan in the 4th Fl...
Mike Neil is general manager for virtualization strategy in the Windows Server Division at Microsoft. Mike is focused on the delivery of the Windows virtualization technology, including Windows Server 2008 Hyper-V, Microsoft Hyper-V Server and Virtual PC 2007. Mike also directs the tec...
SQL Injection attacks are one of the easiest ways to hack into a website. One recent hack, using a script from verynx.cn, involves injecting sql into a web form that then appends some JavaScript code into fields in a database that then gets executed on the client side when a user views...
Recursion Software released a private beta version of their Voyager mobile platform, with powerful interoperability for Android, Microsoft .NET and Compact Framework (CF), all Java editions (JME CDC, JSE and JEE), and more than 15 embedded operating systems. The Voyager platform is a p...
2008 is going to be an important year for Rich Internet Applications. Most organizations are delivering or planning to deliver Rich Internet Applications; however, at the same time, most IT managers are facing a dilemma: which Rich Internet Application technology and platform to use? T...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE