Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Flex Developer Center /

Set up and build your first Flex and ColdFusion application – Part 2: Generating ColdFusion components

by Trilemetry

Trilemetry
  • Trilemetry, Inc.

Created

22 March 2010

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
CFC ColdFusion data services Flex

Requirements

Prerequisite knowledge

This tutorial is intended for:

  • Developers who are exploring tutorials in the Flex and ColdFusion mini learning center that are based on the Fictitious Sales Planner example.
  • Experienced ColdFusion developers without previous Adobe Flex framework or Adobe Flash Builder 4 experience.
  • ColdFusion developers who are familiar with ColdFusion components.

User level

All

Required products

  • ColdFusion (Download trial)
  • Flash Builder (Download trial)

Sample files

  • f4cf_fictitious_db.zip (75 KB)
  • f4cf_generated_cfcs.zip (4 KB)

In Part 1, you learned how to set up a ColdFusion data source and Flash Builder project. In this section, you will generate the ColdFusion components (CFCs) using ColdFusion Builder. This section is optional, as you can use the CFCs provided in the next section to import into the Flash Builder Data Service. You can skip to the next section, or continue to see how easy it is to generate Object-relational mapping (ORM) components. In Part 3, you will set up a Flash Builder data service project with ColdFusion for use with the Fictitious Sales Planner sample application.

Register the local ColdFusion server in ColdFusion Builder

In this section, you will register the local ColdFusion Server with ColdFusion Builder. This will allow you to access all the data sources on the server from within ColdFusion Builder.  

  1. Open ColdFusion Builder, then click on the Add Server button in the Servers view as shown in Figure 1.
The Add Server button within the Servers view.
Figure 1. The Add Server button within the Servers view.
  1. Since you are using a local server, type "localhost" for the name.
  2. Since you are using a local server, set the host name to "localhost" as well.
  3. For default installations of the standalone ColdFusion server, the web server port should be 8500.

    You should be able to ignore the Context Root and Application Server Name fields. These are only needed if using ColdFusion deployed on a J2EE server.

  4. Enter the RDS User Name and RDS Password you assigned during installation.

    If you did not specify an RDS username when installing, then the default user name is admin.

    The Server Settings window should appear as shown in Figure 2.

The Server Settings window.
Figure 2. The Server Settings window.
  1. Click Next.
  2. Specify the Server Home directory. This is not the web root. This is the folder into which ColdFusion itself is installed. On Microsoft Windows machines using a local development server, this is likely to be: c:\ColdFusion9  (/Applications/ColdFusion9/ for Mac)
  3. Enter the Document Root (the web root directory). On Windows machines using a C:\ColdFusion9\wwwroot  (/Applications/ColdFusion9/wwwroot/ for Mac)
  4. From the Version drop-down menu, choose 9.0.x as shown in Figure 3.

    Note: This step is not available on the MAC version of ColdFusion Builder.

The Local Server Settings window.
Figure 3. The Local Server Settings window.
  1. Click Finish.

Create a ColdFusion Builder project

ColdFusion Builder makes it easy for developers to manage the entire ColdFusion development cycle from concept to production in one easy-to-use tool. In this section you will create a project to hold all the files for the FictitiousSalesPlanner application.

  1. Select File > New > ColdFusion Project.
  2. Enter the Project Name “F4CF_FictitiousSalesPlanner”.
  3. Uncheck the Use Default Location check box. Enter the path for your project in the Project Location field. To find the path, browse to your Document Root folder, likely:

         C:\ColdFusion9\wwwroot

         (/Applications/ColdFusion9/wwwroot/ on Mac)

         Create a new folder inside the Document Root named F4CF_FictitiousSalesPlanner as shown in Figure 4.

The ColdFusion Project Information window.
Figure 4. The ColdFusion Project Information window.
  1. Click Next.
  2. Use the Servers drop down list to select localhost, the server you defined above (See Figure 5).

     

The Server Details within the New ColdFusion Project window.
Figure 5. The Server Details within the New ColdFusion Project window.
  1. Click Finish.

Use the CFC Generator extension to create an ORM CFC

You can generate the data management services for this application using the ColdFusion Builder CFC Generator. The code will use object-relational mapping (ORM) which will manage the database logic and connectivity without writing any SQL.

  1. In the RDS view, expand the localhost server to reveal the FictitiousSalesPlanner data tables.
  2. Select the SALESTARGETS table and right-click.
  3. Choose Adobe CFC Generator > Create ORM CFC. See Figure 6.
Select Create ORM CFC.
Figure 6. Select Create ORM CFC.
  1. In the Adobe CFC Generator dialog box, click the Browse button.
  2. In the Select Folder dialog box, select the FictitiousSalesPlanner folder and click OK (See Figure 7).
Create ORM CFC within the Adobe CFC Generator window.
Figure 7. Create ORM CFC within the Adobe CFC Generator window.
  1. Click OK.
  2. Within the Create ORM CFC wizard, scroll to the bottom of the page and click Generate Code (See Figure 8).

    Note: For Mac users, if this page appears blank, then close it, navigate to Preferences >  ColdFusion > Extensions and check the box next to Use Mozilla browser for extensions. Click Apply. Click OK. Then repeat from Step 3.

Generate the ORM CFC code.
Figure 8. Generate the ORM CFC code.
  1. You should see a message showing the path of the generated CFCs. Click Close (See Figure 9).
ORM CFC generated successfully.
Figure 9. ORM CFC generated successfully.
  1. Within the Navigator view, right-click the FictitiousSalesProject project and select Refresh.
  2. Expand the project to reveal the generated CFCs.

Where to go from here

In this section, you have learned how to generate the ColdFusion components (CFCs) using ColdFusion Builder. In Part 3, you will set up a Flash Builder data service project with ColdFusion for use with the Fictitious Sales Planner sample application.

More Like This

  • Building a Flex application that connects to a BlazeDS Remoting destination using Flash Builder 4
  • Project Hendrix: A call center Customer Experience Management solution
  • Working with Doctrine 2, Zend AMF, Flex, and Flash Builder
  • Building a Flex application that connects to a BlazeDS Remoting destination using Flash Builder 4.5
  • Sending and receiving mobile text messages with Flex, ColdFusion, and BlazeDS
  • Set up and build your first Flex and ColdFusion application – Part 3: Use ColdFusion and Flash Builder 4 to create an application
  • Introducing the MXML and ActionScript languages
  • Set up and build your first Flex and ColdFusion application – Part 1: Database setup
  • Generating ColdFusion forms with Adobe Flash Builder 4
  • Getting started with ColdFusion and Flash Builder 4 – Database, CFC, and data services setup

Tutorials & Samples

Tutorials

  • Flex mobile performance checklist
  • Flex and Maven with Flexmojos – Part 3: Journeyman
  • Migrating Flex 3 applications to Flex 4.5 – Part 4

Samples

  • Twitter Trends
  • Flex 4.5 reference applications
  • Mobile Trader Flex app on Android Market

Flex User Forum

More
07/25/2011 Flash Player Debug Issues - Safari 5.1 & Chrome 13
04/22/2012 Loader png - wrong color values in BitmapData
04/22/2012 HTTPService and crossdomain.xml doesn't work as expected
04/23/2012 Memory related crashes in Flex application

Flex Cookbook

More
04/06/2012 How to detect screen resize with a SkinnableComponent
02/29/2012 Embed Stage3D content inside Flex application components
02/15/2012 Custom WorkFlow Component
02/09/2012 Using Camera with a MediaContainer instead of VideoDisplay

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement