New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Start learning with our library of video tutorials taught by experts. Get started

ColdFusion Builder Essential Training
Illustration by

Using the CFC Generator extension for ColdFusion 8


From:

ColdFusion Builder Essential Training

with Daniel Short

Video: Using the CFC Generator extension for ColdFusion 8

CFCs are powerful, but they can sometimes be mighty boring to build. Developing services and writing value objects usually consists of a bunch of repetitive and potentially error-prone code. ColdFusion 9's ORM capabilities can help with all that, but we are not all on ColdFusion 9 yet, and some applications just aren't set up to support ORM-based objects. Luckily, ColdFusion Builder can take care of some of the grunt work with creating CFCs to connect to databases in our ColdFusion 8 based applications. So, in the last video, we installed the CFC Generator and here I am going to show you how to use it.
Expand all | Collapse all
  1. 7m 48s
    1. Welcome
      59s
    2. Installing ColdFusion Builder
      2m 20s
    3. Installing ColdFusion Builder as a plug-in
      3m 18s
    4. Using the exercise files
      1m 11s
  2. 17m 42s
    1. Workspace overview
      2m 25s
    2. Organizing your workspace
      6m 19s
    3. Adding and selecting workspaces
      2m 53s
    4. Installing and managing plug-ins
      6m 5s
  3. 12m 12s
    1. Creating projects
      2m 11s
    2. Importing projects
      2m 48s
    3. Creating project working sets
      2m 23s
    4. Managing projects
      2m 22s
    5. Linking folders
      2m 28s
  4. 23m 2s
    1. Configuring and managing ColdFusion servers
      6m 26s
    2. Using the Services Browser
      4m 15s
    3. Using RDS Dataview and Fileview
      4m 52s
    4. Using FTP
      7m 29s
  5. 18m 10s
    1. Creating editor profiles
      2m 6s
    2. Using Code Assist
      5m 43s
    3. Setting code coloring
      4m 5s
    4. Using shortcut keys
      3m 5s
    5. Working with outlines and syntax checking
      3m 11s
  6. 37m 40s
    1. Using code completion
      7m 25s
    2. Using snippets
      9m 23s
    3. Using SQL editing and the Query Viewer
      5m 55s
    4. Working with components
      7m 27s
    5. Working with variable mapping
      2m 14s
    6. Navigating code and documents
      5m 16s
  7. 13m 12s
    1. Getting set up
      3m 50s
    2. Using the ColdFusion debugger
      5m 37s
    3. Watching logs with Tailview
      3m 45s
  8. 13m 8s
    1. Installing extensions
      4m 5s
    2. Using the CFC Generator extension for ColdFusion 8
      4m 52s
    3. Using the CFC Generator extension for ColdFusion ORM
      4m 11s
  9. 34m 5s
    1. Building a simple contact form extension
      3m 42s
    2. Creating user interfaces
      8m 55s
    3. Packaging the extension
      3m 55s
    4. Building the handler
      8m 10s
    5. Using the Builder extension
      9m 23s
  10. 25s
    1. Goodbye
      25s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
ColdFusion Builder Essential Training
2h 57m Beginner Mar 22, 2010

Viewers: in countries Watching now:

ColdFusion Builder, based on the Eclipse workbench, is Adobe’s first dedicated development environment for programmers of ColdFusion-based Internet applications. ColdFusion Builder Essential Training, with author Dan Short, is designed to teach both new and experienced ColdFusion developers how to configure servers and services, generate data-aware components, and create custom extensions. Exercise files accompany the course.

Topics include:
  • Installing ColdFusion Builder
  • Customizing the ColdFusion Builder workspace
  • Managing assets within a project
  • Setting up ColdFusion servers
  • Coding with Code Assist, code coloring and syntax checking
  • Using code snippets
  • Working with components and variable mappings
  • Creating custom Builder extensions
Subjects:
Developer Web
Software:
ColdFusion Builder
Author:
Daniel Short

Using the CFC Generator extension for ColdFusion 8

CFCs are powerful, but they can sometimes be mighty boring to build. Developing services and writing value objects usually consists of a bunch of repetitive and potentially error-prone code. ColdFusion 9's ORM capabilities can help with all that, but we are not all on ColdFusion 9 yet, and some applications just aren't set up to support ORM-based objects. Luckily, ColdFusion Builder can take care of some of the grunt work with creating CFCs to connect to databases in our ColdFusion 8 based applications. So, in the last video, we installed the CFC Generator and here I am going to show you how to use it.

In the RDS Data view, I am going to expand my local server and the cfartgallery data source. I will expand the tables and I am going to create a batch of CFCs for my ARTISTS table. If I right-click on the table, at the bottom you can see Adobe CFC Generator, and we are going to select Create CFC. This opens up the Adobe CFC Generator dialog, which just has three options. The first is where I want my CFCs to go. The second is whether I want it to generate a Service CFC, along with the value objects. And the third is whether I want it to do a ColdFusion 9 CFScript-based CFC or if I want to stick with standard tags.

So, click Browse and we will choose exactly where we want our CFCs to go. I am going to put them directly in my Chapter 7 folder. Click OK. Click OK again. The CFBuilder is passing control off to the ColdFusion server. It's going to take a look at my table and then build all of these CFCs. I now have an ARTISTS CFC value object. I have a Data Access object, a Gateway object, and a Service. I am going to go ahead and open up the Service and we will take a quick look at everything that the extension did for us.

If I switch to the Outline view and scroll down the list here, I can see it has created a count function, createARTISTS, deleteARTISTS, getARTISTS, getARTISTS_page, where I can actually pass in my startIndex and the number of items I want it to return. It has generated a lot of code inside just this one CFC. I have got 117 lines of ColdFusion that I didn't have to write. If I open up the Gateway, I can see I have getALL, getALL_page.

I have the same type of methods that my Service had. So, let's go ahead and make sure that these actually work. If I open up my index.cfm, let's output the result of one of these CFCs. Let's dump the getALL method from our Gateway. So, I will run CreateObject ("component", ArtistsGateway").getALL method. I will save my file, switch to the browser preview, and here we can see that the getALL method returned us an array of individual artist objects.

That's all it took to generate all that code. Just a single right-click and clicking Finish. So, because that was so quick, I am going to take a little bit of time and show you how you can adjust this code if you don't like the way that it's being generated. So, for example, in the ARTISTSGateway, maybe I don't like the way it's running the set methods or maybe I want an additional method added to the CFC. If you go to the Adobe CFC Generator folder, go to the handlers directory > com > adobe > cfbuilder, you will see there's a templates directory.

If I expand the templates directory, I can see I have templates for the standard crud methods, which we just used, and the ORM CFCs, which I will show you in the next video. If I expand the crud folder, I will scroll over a little bit here. We can see cfm files for generating the dao, the gateway, a script-based DAO, the script-based Gateway, and then my value objects. So, if I open up the gateway.cfm file -- and I will scroll down a little bit here -- you can see a whole bunch of code that determines how the init method is formatted, how the getALL method is formatted.

You can see some fancy stuff around looping over table names and columns, and you can take this file, change it however you please, save it, and rerun the extension. It will generate the code just as you would like it to be generated. So, if we wanted to change the name of the getALL method, I can change that to say getALLObjects. I will save this CFM file, go back to my RDS view, and let's create some CFCs for the Media table. I will Run Create CFC, choose my destination.

We are going to stick this in the same Chapter 7 folder, click OK, OK again. If I scroll over here, go back down to our Chapter 7 folder, and here I can see my MEDIAGateway. I will open that up, and now my getALL method is get ALLObjects. So, my suggestion to you would be to run the CFC Generator, go through the code, find out what you don't like. For example, single quotes instead of double quotes. Change what you would like to be different, save the files, and now the extension will work exactly the way you would like it to.

There are currently no FAQs about ColdFusion Builder Essential Training.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed ColdFusion Builder Essential Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.