ColdFusion Builder Essential Training

ColdFusion Builder Essential Training

with Daniel Short

 


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

show more

author
Daniel Short
subject
Developer, Web
software
ColdFusion Builder 1
level
Beginner
duration
2h 57m
released
Mar 22, 2010

Share this course

Ready to join? subscribe


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:00(Music playing.)
00:04Hi! I'm Daniel Short, and I'd like to welcome you to ColdFusion Builder Essential Training.
00:08In this course, I will show you how Adobe's new ColdFusion Builder is going to
00:11help you become a more productive ColdFusion developer.
00:14I will show you how to make ColdFusion Builder conform to your style of coding.
00:18I will walk you through using the debugging perspective in ColdFusion Builder
00:21to see what your code is doing, while its doing it, and I will also show you
00:25how to extend the capabilities of ColdFusion Builder through extensions,
00:28harnessing the full power of the ColdFusion server and your existing ColdFusion
00:32programming skills.
00:34Whether you are moving from Dreamweaver, looking for a more powerful ColdFusion
00:37development platform, or moving from CF Eclipse to get more direct access to
00:41ColdFusion server functionality, you will learn everything you need to know to
00:44hit the ground running using ColdFusion Builder.
00:46As a longtime Dreamweaver and CF Eclipse user myself, I am happy to show
00:50you Adobe's move to give ColdFusion its own dedicated world-class
00:53development environment.
00:55Now, let's get started with ColdFusion Builder Essential Training.
Collapse this transcript
Installing ColdFusion Builder
00:00Obviously, before you can get started with ColdFusion Builder, we need to install it.
00:04So, to get ColdFusion Builder, you can go to the Adobe Labs and on the
00:07right-hand side, click on ColdFusion Builder.
00:10Once you are on the Adobe ColdFusion Builder page, you can click Get ColdFusion
00:14Builder Beta and download the Installer.
00:17I already have the installer on my desktop, so I will go ahead and close Safari
00:21and run the Installer.
00:25When you run the CF Builder Installer for the first time, if you are on the Mac,
00:28you may have to enter in your Administrator password so that ColdFusion Builder
00:31can put all the files where it needs to place them.
00:33If you are on Windows Vista, you may need to allow the Windows Security Advisor
00:38to let the ColdFusion Builder installer run.
00:41The first screen in the wizard, the Introduction, just tells you that you should
00:44quit all other programs before continuing the installation. Standard warnings
00:48when installing new software.
00:49Go ahead and click Next.
00:51And on the next screen, you will need to accept the license agreement, and then
00:55you will choose the type of installation that you want to run.
00:57You have two different options.
00:59This video I am going to show you the standard ColdFusion Builder installation,
01:02and in the next one, I will show you how to install it as a plug-in into an
01:05existing Eclipse installation.
01:07So, we will click Next, and then we just need to choose where we want to place
01:11Adobe ColdFusion Builder.
01:13On the Mac, it will default into the Applications folder, and on Windows,
01:17it will default to your Program Files directory.
01:20If you want to change that, just click Choose and you can browse to the folder
01:23where you would like to place Adobe's ColdFusion Builder. Click Next.
01:27And here you will get a summary of exactly how much disk space it's going to
01:30take to install ColdFusion Builder.
01:33If you see a screen asking you to associate CFM and CFC files, check the box
01:37to make CF Builder the default application to open when a ColdFusion file is double-clicked.
01:42Go ahead and click Install.
01:43Through the magic of video editing, that should only take a few seconds here in
01:47the video, but it may take a few minutes longer on your system.
01:51So, when you are all finished, just click Done to quit the installer and then
01:55for Mac users, you will have one more step, which is to go to your Applications folder.
02:02Find your Adobe ColdFusion Builder folder, grab the CFBuilder icon, and drag it to your dock.
02:09If you are installing on Windows, it's in the Program Files folder and in the
02:12Start menu, ready to use.
Collapse this transcript
Installing ColdFusion Builder as a plug-in
00:00ColdFusion Builder is actually built on top of Eclipse, which is an open source
00:04IDE platform developed by IBM.
00:06If you are using CF Eclipse, Flash Builder, or any number of other IDEs built on
00:11top of Eclipse, then you already have an Eclipse installation on your system.
00:15So, instead of adding one more by installing CF Builder as a standalone
00:18application, you can install it as a plug-in into your existing Eclipse
00:22installation instead.
00:23So, to show you how to install CF Builder as a plug-in, I have downloaded the
00:28latest Eclipse version, which is Ganymede, and unzipped it to my desktop.
00:33So, I will close my browser here and here in my Eclipse folder, you can see
00:39I have Eclipse installed and ready to go.
00:40So, we are going to double-click on the CFBuilder installer, just as we did when
00:45we installed it as a standalone application.
00:47So, on the Introduction screen, we will click Next. Agree to the terms of the
00:52license agreement, and click Next.
00:55And now we have our choice of either standalone or to install as a plug-in.
01:00You will see that the standard installation is disabled, because I already have
01:05Adobe ColdFusion Builder installed as a standalone application.
01:08So, we will just leave the plug-in option selected, since we have no other
01:11choice and click Next.
01:15This screen will actually allow you to choose where you want the plug-in
01:18files to be installed.
01:20The default is to place those in the Applications or the Program Files directory
01:24on Windows in Adobe ColdFusion Builder Plugins.
01:29One issue with having your plug-in files in a separate directory from your
01:32Eclipse folder is that it makes your Eclipse installation less portable.
01:35One of the nice things about Eclipse is that you can actually move the
01:39Eclipse installation folder around, say drop it on a Flash drive or onto
01:43another computer, and you are all ready to go just as if you had installed it on that machine.
01:47For now, we are going to leave this at its default and we will click Next.
01:52Now we need to choose our Eclipse installation folder.
01:55So, I will click Choose.
01:56I will need to find my Desktop.
01:58So, I will go to my hard drive, Users, User, and Desktop, and I will select my
02:08eclipse installation folder.
02:10Now, I am going to choose the folder itself and not the actual
02:13Eclipse application.
02:17So, I will go back here to my Desktop, choose Eclipse, and click Choose. I will click Next.
02:24Then I will see a summary of how much space is going to be required to install
02:29ColdFusion Builder and where my plug- ins and the installation directory are
02:33going to be located. Click Install.
02:43Once the installation is complete, click on Done, and then I will go ahead and
02:46open up Eclipse, choose my workspace,
02:54And then I will click Window > Open Perspective, choose Other.
03:00I can see I now have a ColdFusion perspective available inside of Eclipse.
03:04I will click OK, close my Welcome view here, and you can see I have all of
03:11the ColdFusion Builder Server, TailView, Services Browser, and Extension
03:16views available to me.
Collapse this transcript
Using the exercise files
00:00If you are a Premium member of the lynda.com Online Training Library, or
00:03if you are watching this tutorial on a DVD-ROM, you have access to the exercise files
00:08used throughout this title.
00:10We won't be using many files in this course, but the exercise files are laid out by chapter.
00:14I already have the exercise files decompressed here on my Desktop and you can
00:18see I have a cfcs folder and one folder for each chapter.
00:22The exercise files consist of ColdFusion files and components, mainly used to
00:26demonstrate CodeAssist and other helpful features of ColdFusion Builder.
00:30To use the exercise files, you need to copy all of the chapter files and the
00:34cfcs folder to your ColdFusion web root.
00:36In my case, on the Mac, that's under my Applications folder, ColdFusion9, and
00:43I will scroll down a little bit here, wwwroot.
00:47So, I will take all of my files and just drag them to my web root.
00:53If you are on Windows, this will most likely be in C:\ColdFusion9\wwwroot, or if
00:59you are using IIS, under C:\inetpub\wwwroot.
01:03If you don't have access to the exercise files, you can follow along from scratch
01:07or with your own assets.
Collapse this transcript
1. Managing Your Workspace
Workspace overview
00:00Where you do all of your work in ColdFusion Builder is called your workspace, so
00:04let's dive right in and take a look.
00:07We will start up ColdFusion Builder, and the first time you start ColdFusion
00:10Builder, it's going to create your default workspace.
00:13If you installed ColdFusion Builder as a plug-in, then you already have
00:16an Eclipse workspace.
00:18Each time you start Adobe's ColdFusion Builder, if you haven't already purchased
00:22a serial number, you will get the Software Setup dialog and you will need to
00:25select that you are going to use it on a trial basis.
00:28So, we will click Close, and then I will just maximize my window here and
00:33we will take a quick tour around the workspace.
00:36Now, your workspace is actually more than just what we are looking at, but
00:39it also contains all of your snippets, your code editing preferences and server setups.
00:44So, workspace is much more than just where a particular view is drawn on the screen.
00:49Now, all these workspace settings are stored here.
00:52You will notice it says, my User folder, Documents, Adobe ColdFusion Builder workspace.
00:59This folder on your hard drive contains all of the setup information for what
01:03we are currently looking at.
01:04You can actually have more than one workspace on your system and you can switch
01:08between them each time you start up ColdFusion Builder, which I am actually
01:11going to show you later in this chapter,
01:13but back to our default workspace.
01:15The first thing you need to know is that what we are looking at now is a
01:18perspective or a distinct collection of views.
01:21This particular perspective, if you will notice here in the upper left-hand corner,
01:25is the ColdFusion perspective, which by default has a large number of
01:29individual views displayed.
01:31To the left, we have our Navigator View, where we are going to see all of our
01:35projects and do most of our work throughout this course.
01:38The File view at the bottom allows you to see your local hard drive, as well as
01:42remote hard drive set up through FTP.
01:44Then across the bottom, we have a Servers view, where we will actually define
01:47all of our ColdFusion servers.
01:49We also have a TailView, where we could watch logs, a Services Browser, and
01:53an Extensions view, where we will actually install extensions later on in the course.
01:57To the right, we have our Snippets view, and at the top an Outline, RDS Data,
02:02and Fileviews.
02:04If I click this little Show List arrow, here off to the right, you can see those
02:08additional views in that group.
02:10That's all there is to a workspace.
02:12The big takeaway here is that a workspace is a collection of settings and views
02:16that you can swap out at will.
02:17So, now that you have had the whirlwind tour of a workspace, I think it's time
02:21to show you how to get your workspace organized to suit your own needs.
Collapse this transcript
Organizing your workspace
00:00Now, in this video we are going to talk about getting your workspace organized.
00:04I don't know about you, but I like my desk a certain way.
00:07I always know where my pens and pencils are and where my paper is and my post-it
00:10notes, and the same holds true for my CF Builder workspace.
00:14I want things just the way I want them, so I can get to them quickly, depending
00:18on the way that I like to work.
00:20The first thing to know about ColdFusion Builder is that everything can be moved,
00:24and we will start, if you would look at the edges of the Editor window here,
00:28this is the Editor View.
00:31We can take and drag all of these dividers and move things around in whatever
00:36fashion we deem appropriate.
00:39So, it's really, really easy to get everything the right size.
00:43And what we are moving around is the borders on all of these views.
00:47Each of these tabs here represents an individual view, and they are
00:53organized into groups.
00:55And inside each group, across the top here you will have a series of buttons.
00:59The ones over on the left have to do with actions that you can take inside the view.
01:04And over here, on the far right, we will cover these first.
01:07We have a Minimize and a Maximize button.
01:10Now, when you minimize a view group, what it does is collapses it to the gutter
01:17bordering the side of that particular group.
01:20So, you can see here, I now have my Navigator collapsed here, and if I hold my
01:25mouse over that, I can restore it to its original position.
01:30If I collapse it again, if I don't want to restore it but I still want access to
01:35that view, I can click the Views icon and it will pop it out temporarily.
01:40But you can see, sometimes you get an occasional rendering goofiness when you do that.
01:45You can click it again.
01:47It will pop back in.
01:47So, we will again restore that.
01:51The opposite of that would be to maximize it.
01:54So, if I maximize this view, it takes up the entire space and all of the other
02:00view groups get collapsed to their gutters.
02:04As you can see here, these Servers, Console, Problems, and TailView, when I
02:09minimize that, that goes down to the bottom gutter.
02:13We will maximize that again.
02:15Now, you can either click the maximize button or you can double-click a view's tab,
02:20and it will take up all of the available space.
02:24So, go ahead and put everything back the way we found it.
02:28Now, next to the Minimize and the Restore buttons there is also a View menu.
02:32And this View menu is a contextual menu that shows you all of the options for
02:37the particular view that is active in that group.
02:40So, as you can see, in the Navigator, we can select working sets.
02:44We can sort projects.
02:45In the File view, if I click that same icon, I can create new pages
02:51directly from here.
02:52If I go over to Snippets, I get a completely different set of options.
02:58So, the View menu inside each view will give you more options to manipulate the
03:04contents of that view.
03:05And I can also move these views around.
03:08For example, over here on the left-hand side I have the Navigator and the File
03:12view in separate groups.
03:13I like to keep these in the same group, so I can just click and drag the tab and
03:18move it up here to stick inside that group.
03:21I don't know if you noticed or not, but when I was dragging the File group,
03:26it gave me more options as to where I can put it.
03:30You can see that black outline there, allows me to drop it back to where it was,
03:34but I could also drag it over here or I could drag it over here.
03:41I could move the Servers group up here, and then I could move the
03:45Extensions down here.
03:47I can rearrange these views all I want, so long as I have the space to do so.
03:52Let's go ahead and put everything back the way it was.
03:55Let's put the Servers back over there, put the File up with the Navigator.
04:00And then if I also have views I don't want to see, if I didn't want to see the
04:04File view as an example, I can just click the X on its tab to close it and
04:09it disappears from the workspace entirely.
04:12Now, if I want to get that view back or I want to show other views, if you
04:17choose Window and Show View, the initial menu will show you most of the common
04:22views that you can turn on.
04:23So, as an example, if I click on File, I can get my File view right back where
04:27it was before I closed it.
04:29If I choose Window, Show View, and Other, I get a large list of views that I can
04:36display inside my workspace.
04:38Inside the ColdFusion group, we have all the views that ColdFusion Builder added,
04:42and we can also see views from other plug-ins that are installed inside of Eclipse.
04:47So, let's go ahead and cancel this dialog.
04:50And now that I have things just the way I like them when I am working, I need
04:54to save this perspective, because everything that we have been looking at is
04:58considered a single perspective. I need to save that to make sure that I don't lose it.
05:03So, under the Window menu, again, we can choose Save Perspective As.
05:07I am going to call this Dan's Perspective.
05:12I will click OK, and here you can see this icon now says Dan's Perspective.
05:21Now, if I want to open a different perspective, I can click on the Open
05:25Perspective button here.
05:27I will choose Other.
05:29And we will go ahead and open the ColdFusion Debugging perspective, and click OK.
05:32Now we can see it has rearranged our entire view.
05:39We have our Debug view over here.
05:42We have Variables and Debug Output Buffers and Breakpoints and Expressions, and
05:47all kinds of other stuff that we didn't have in my standard work view.
05:51So, I can just click on that and go right back to my standard perspective.
05:56So, as I am working through my code and debugging things, I can quickly switch
06:00back and forth in between the different perspectives in order to see
06:03everything that I need to see.
06:05And that's how you go about organizing your workspace just the way you like it.
06:08There are a ton of options. Make it yours, and spend a little time to get things
06:12just the way you like them.
06:13And then make sure you save that perspective, so that you can go back to it at any time.
Collapse this transcript
Adding and selecting workspaces
00:00So, now that you have your workspace just the way you like it, what if you
00:03wanted another workspace?
00:06As an example, if I have a client with a whole bunch of different projects that
00:10I'm working on, I might want to segregate that.
00:12I have a completely separate workspace with a different set of snippets, [00:00:1523] a different set of server setups.
00:17I may want to have a completely different way of working with a specific set of projects.
00:23To set up new workspaces, we need to go into the ColdFusion Builder > Preferences.
00:27When we're in the Preferences, I can search for workspaces, and under the
00:32Startup and Shutdown option, I'll select Workspaces.
00:36Check the box to prompt for workspaces on startup.
00:39We can see here that it's already using my current workspace as a recent workspace.
00:45So, this will list every single workspace that I have set up on this machine.
00:50Now that I have the Prompt for workspace on startup selected, I'll go ahead
00:53and click OK, and we'll shut down ColdFusion Builder and go ahead and start it back up.
01:01The first thing we'll see before we get to our workspace is it'll prompt us
01:05to select a workspace.
01:08So, in this case, I'm going to create a new one and we'll do that just by
01:13highlighting all that and typing "test."
01:16Because that workspace doesn't yet exist, ColdFusion Builder will create it.
01:19Now if I wanted to use test every time I start CFBuilder, I could check that box
01:25to say Use this as the default and do not ask again.
01:28But we'll go ahead and click OK.
01:33It'll basically load up a completely brand-new empty workspace, just like it did
01:39whenever we first started ColdFusion Builder.
01:41I can click and drag things around and I can close things and just generally
01:46make a mess of it all.
01:48We'll delete all that stuff or rather close all those views.
01:52Now I have a completely different workspace then before.
01:55So, let's go ahead and quit ColdFusion Builder again.
01:58We'll start it back up.
01:59Instead of choosing the test workspace, I'll select the ColdFusion Builder
02:06workspace that we set up previously.
02:08We'll click OK, and it opens back up with Dan's Perspective and the ColdFusion
02:16Debugging perspective up and ready to go.
02:18If we have a workspace we don't want in ColdFusion Builder anymore, we can go
02:22back into the Preferences and type Workspaces again.
02:30And then just select the one that we want to remove from our list and click Remove.
02:35Then I'll disable prompting for the workspace on startup, and click OK, and
02:41we're right back where we were when we started the video.
02:43So, now you know how to add new workspaces and select a workspace on startup, so
02:48that you can make sure you're using the right environment for the particular
02:51project that you're working on.
Collapse this transcript
Installing and managing plug-ins
00:00Probably the most powerful thing about Eclipse is that you can do just about
00:04anything you would like with the right plug-in.
00:07Now, ColdFusion Builder is itself a plug- in into Eclipse, and there are plug-ins
00:11for just about any task you can imagine, from working with XML, building UML
00:16diagrams, or working with version control software.
00:20In this video, I am going to show you how to install the Subclipse plug-in for
00:24working with Subversion.
00:25So, to install a plug-in, from the Help menu, choose Install New Software.
00:33And this dialog will allow you to select an update site.
00:38Now, all plug-ins are installed from an update site.
00:41And while it's called an update site, it doesn't necessarily mean it has to come
00:45from an actual web site.
00:47You can also update Eclipse with a plug-in stored locally on your hard drive.
00:52Now, the first thing you should do before you install any plug-ins at all is
00:56actually add the Ganymede update site to your Eclipse installation.
01:01Now, ColdFusion Builder is based off of the Ganymede version of Eclipse, so
01:07some plug-ins will require components from that core set of files in order to install correctly.
01:13So, we will start by adding that update site.
01:15Next to the Work with dropdown, click on Add, and we will just type in the name
01:21of this update site.
01:23And in the Location dialog, we will type download.eclipse.org/releases/ganymede.
01:35So, now if we install any plug-ins that require core Eclipse components,
01:39they will know where to go out and fetch those pieces. So click OK.
01:43It will locate the update site.
01:48So, after we have added the update site, it will go out and fetch all the
01:52pieces that are out there, and show us a list of everything that can be
01:56installed from that update site.
01:58As you can see, there is quite a bit.
02:00There is C and C++ development tools, collaboration tools.
02:04All of this is directly from the Eclipse organization.
02:08We have database development, other programming languages, a whole cornucopia of
02:14programming resources.
02:15But what I want to do is install Subclipse in order to be able to work with my
02:19Subversion repositories.
02:21So, let's go out to their web site and figure out how I can install this plug-in.
02:28So, I am going to go to Safari and we will go to subclipse.tigris.org, and
02:36on the Subclipse homepage, down on the left- hand side you will see Download and Install.
02:41On this page, they list all of their current releases and here are the
02:46releases for Subversion 1.6 and Subversion 1.4, and you can go all the way back to Subversion 1.0.
02:53In this case, I am going to install the plug-in for Subversion 1.6.
02:58So, I can copy this Eclipse update URL.
03:05I will go back to my ColdFusion Builder installation.
03:08I will click Add, type Subclipse, and I will add in my location and click OK.
03:21And now I can see the plug-ins that are available.
03:23We are going to choose the Core SVNKit Library and Subclipse, and click Next.
03:33And now I can see all of the items that are going to be installed based off of
03:37those selections that I made.
03:39So, go ahead and click Next, because that all looks right to me.
03:41We will agree to the license agreement.
03:45Each of the individual components can have their own license.
03:48So, if you can accept all the license agreements, go ahead and click Finish.
03:54That's going to download all the components and put them all in their
03:57proper spot on my machine.
04:01Now, the Subclipse installation does have some unsigned content, but I trust them,
04:06so I am going to go ahead and click OK.
04:07If I didn't, I could click Details and see exactly which components aren't
04:12being properly signed.
04:13So, go ahead and click OK.
04:16Let it finish the installation.
04:18Now, after plug-in installs, it's recommended that you restart the entire
04:21ColdFusion Builder application to make sure that the plug-in gets
04:24properly registered.
04:26So, I will go ahead and click Yes.
04:29ColdFusion Builder will restart.
04:31And while nothing is new here, if I go to the Window, and Show View, and Other,
04:42you can see now that I have some SVN views available to me.
04:48I generally like to have the SVN Properties view open.
04:51So, I will select SVN Properties and click OK.
04:53I like to have it over here in my bottom group.
05:00So, we will choose Window and Save Perspective, and overwrite my
05:06existing perspective.
05:07We will go ahead and choose Yes.
05:11And now I have my SVN Properties available to me all the time.
05:15Now, to keep an eye on what plug-ins are installed. If you go back to the Help
05:18menu and choose Install New Software, in the lower right-hand corner, you can
05:23see a link that says, What is already installed?
05:25If I click that link, it will show me every single plug-in that is currently
05:30installed in my version of Eclipse, and you can see that even Adobe ColdFusion
05:35Builder is listed, since it is itself a plug-in.
05:38Now, if there were updates to a particular plug-in, I can select them and
05:41at the bottom, I can click Update.
05:43I can uninstall the plug-in directly from here and I can even look at the
05:47Installation History and see when each of these installations took place.
05:52And that's all it takes to add new functionality to Eclipse with plug-ins.
05:57And that concludes our chapter on managing your workspace.
06:00So, in the next chapter, we are going to talk about actually starting to
06:02work with some projects.
Collapse this transcript
2. Working with Projects
Creating projects
00:00A project in CF Builder is a way for you to manage all the files you work on day-to-day.
00:05You should set up a project for each application you are working on.
00:08If you are coming from a Dreamweaver background, you can think of a project as a site.
00:12To get started, let's create a new project.
00:14You can click the ColdFusion Project link here in the Create column of the
00:17start page, or in the Navigator view, right-click anywhere in the blank area,
00:21choose New and ColdFusion Project.
00:25The first step of the New ColdFusion Project dialog is to give your project a name.
00:29We will call this one ColdFusion Builder, but in this case, we are going to
00:32point our project at the ColdFusion 9 webroot.
00:35So, let's uncheck Use Default Location.
00:37I will click Browse.
00:39And in my Applications folder, I will find my ColdFusion 9 application.
00:43On Windows, it will most likely be under your C drive, under ColdFusion 9.
00:48And we will scroll down and choose the wwwroot.
00:51I have already copied all the exercise files for this course into my wwwroot, so
00:56I will click Choose and then click Next.
01:00The next step in the New ColdFusion Project wizard is to set up a server for
01:03this particular project.
01:04We are not going to do this right now because we are going to cover setting up
01:08your ColdFusion Server in the next chapter.
01:10So, for now, we will just click Next and move on to the next screen.
01:13In this step, you can set up linked folders for your ColdFusion project.
01:17We are also going to cover this in another video.
01:19So, for now, we will go ahead and click Finish.
01:22Now we have our CFBuilder project in the Navigator view.
01:25I will expand that.
01:27We can see all of the folders in our project, and you can see on the CFBuilder
01:30folder, we have a nice little CFBuilder icon, so that we know that this is
01:34actually a ColdFusion Builder project.
01:37Behind the scenes, when your project gets created, ColdFusion Builder is going
01:40to add two hidden files to your hard drive.
01:43The first is .project.
01:45The second is .settings.
01:47These two files contain all of the project configuration information that
01:51ColdFusion Builder uses to do its thing.
01:54So, if you see these files on your hard drive, just leave them alone.
01:57If you delete them, you are going to have to reconfigure all of your project settings.
02:02Creating projects is quick and easy inside ColdFusion Builder and you are now
02:05ready to get to work.
02:06In the next video, we will cover importing existing projects that you have
02:09already begun work on.
Collapse this transcript
Importing projects
00:00If you are coming CF Eclipse or any other Eclipse based IDE, you probably have a
00:05large number of projects that you have already set up and use every day.
00:08These projects can be imported directly into ColdFusion Builder in just a few easy steps.
00:13In the Navigator view, just right-click anywhere in the open area and choose Import.
00:18The Import dialog gives you a lot of options to import your projects.
00:22You can import a project directly from your hard drive, which we will do in
00:25just a moment, or you can even import a project directly from a Subversion repository.
00:29So, if you already have a repository set up, you can just checkout the project
00:33directly from Subversion, and it will go right into your Navigator view.
00:37If you don't have any existing projects on your hard drive, just watch
00:40along with the video.
00:41If you do have some existing projects, you just need to browse to wherever you
00:45have your projects stored on your local hard drive.
00:48So, let's click Next to get started.
00:51Under Select Folder, click Browse and just locate the location of your existing projects.
00:56In my case, they are under my User folder, and in the Sites directory.
01:00And here you can see I have a number of projects in here.
01:03The first one is an old CF Eclipse site. The other two are existing
01:07ColdFusion Builder sites.
01:08If I click on one of these sites, you can see the .project and .settings file
01:13and folder that I was talking about in the previous video, but let's back up.
01:17And I am going to choose my Sites folder, which contains all of my projects.
01:21I will click Choose and ColdFusion Builder will go through there and pick up
01:25all of the projects that it can find, but you will notice that it's only showing
01:29Site1 and Site2, my existing ColdFusion Builder projects.
01:33If I click Show All Projects, I can now see that CFEclipseSite.
01:38You will also notice at the bottom that the Add ColdFusion Nature to
01:42Non-ColdFusion Projects check box is now enabled.
01:46Basically, what this does is converts your project to a ColdFusion Builder based project.
01:52For now, let's uncheck that box and I will show you how to do that manually
01:55inside the Navigator view in just a moment.
01:57Now that I have my three projects selected, I will just click Finish and
02:02all three projects are now showing in my Navigator view.
02:04You will notice that the CFEclipseSite is missing my ColdFusion Builder logo.
02:09What this means is that I won't have any ColdFusion Builder functionality for
02:13this particular site.
02:14So, in order to get that ColdFusion Builder functionality, I can right-click the
02:18project and choose Apply CF nature.
02:22Once I click that, I now have my ColdFusion logo on top of the project
02:25folder, and I will be able to use all of the ColdFusion Builder functionality inside this site.
02:31Importing new projects and quickly adding the ColdFusion nature to them makes it
02:34easy to migrate all of your existing projects into ColdFusion Builder.
02:39In the rest of this chapter, we will talk about organizing your projects into
02:41working sets and managing a large number of projects inside your workspace.
Collapse this transcript
Creating project working sets
00:00There is no arguing that projects are a great way to organize your applications,
00:03but if you are dealing with years worth of work in your Project Navigator,
00:07it can be difficult to find what you are after.
00:09The easiest way to take care of this problem is by creating working sets
00:13for your projects, which is a way of logically grouping your projects in
00:16the Navigator view.
00:17We can deal with our working sets by clicking the View menu in the Navigator
00:21view and choose Select Working Set.
00:24In this dialog, we can either select an existing working set or we can create new ones.
00:28Our three options at the top are Window Working Sets, which is actually Java
00:32specific and something we are not going to need to use with ColdFusion Builder.
00:36We can deselect any working sets or select working sets we have
00:40already configured.
00:41So, let's create a new working set.
00:43I am going to click Ne and we will choose Resource.
00:47This is a general purpose working set for any Eclipse based resource.
00:51So, we will click Next and I am going to name these Sites, because I am going
00:56to just put Site 1 and Site 2 inside of this working set.
00:59I will click Finish, and we can now see that working set listed here in our dialog.
01:05If I select that option and click OK, my Navigator view then filters down and
01:09only shows me Site 1 and Site 2.
01:11If I click the View menu and the Navigator view, I can see that the Sites
01:16working set is selected.
01:18If I deselect that working set, I get all of my projects back in the Navigator view.
01:23So, the working sets are just a way to filter down the Navigator view.
01:26They don't remove your projects at all, they are still there, they are just
01:29hidden so that you don't have to look at them when you are dealing with a
01:32particular group of projects.
01:34If I need to edit my working set, I can click the View menu, choose Select,
01:39highlight the one I would like to edit, click Edit, and I can add and remove
01:43projects from that working set.
01:45I will click Cancel.
01:46And I am going to add another working set.
01:49Let's click New > Resource.
01:51We will click Next.
01:52I will name this one CFBuilder Projects and in this one, I don't want Site 1 or Site 2.
01:58I just want CFBuilder.
02:00I will click Finish.
02:02And I am going to select both of these working sets as my active working sets and click OK.
02:08And now I see all three of those sites in my Navigator view.
02:12As you can see, working sets are a quick and easy way to get things organized in
02:15the Navigator view, especially if you don't want to create multiple workspaces
02:19to organize all of your projects.
Collapse this transcript
Managing projects
00:00If you work on a large number of projects, CFBuilder can sometimes be slow to
00:04start up as it processes data in all of your active projects.
00:08In order to prevent ColdFusion Builder from slowing down, you can open and
00:12close projects so that eclipse only has to worry about the projects you want it to worry about.
00:17In order to prevent these slowdowns, consider closing projects you're not working on.
00:21To close one of those projects, all you need to do is select the project,
00:25right-click and choose Close Project.
00:27You'll notice that the icon changes to regular blue folder and the little arrow
00:33goes way that allows you to expand that project.
00:36At this point, ColdFusion Builder is completely ignoring that project as if
00:39it doesn't even exist, but you still have access to it in the Navigator view
00:43and when you need to work on that project you can right-click it and choose Open Project.
00:48You'll notice that my CFBuilder logo came back and that project is
00:51now accessible again.
00:53This allows me to enable and disable projects so that ColdFusion Builder only
00:58has to worry about what I want it to worry about.
01:01And I don't have to delete the project and then re-import it later.
01:04It's immediately available to me when I need it.
01:07Now if I don't need a project anymore, I can delete it from the Navigator by
01:11right-clicking and choosing Delete.
01:14Now when I delete a project, I can simply remove it from my workspace or if
01:19I select this option, the project will actually be deleted from my hard drive entirely.
01:23Now, notice that it does say, "Cannot be undone."
01:27These files are not moved to your Recycle Bin or the Trash.
01:30They are removed immediately.
01:32So, let's uncheck that because I don't want to lose my old sites and we'll click OK.
01:36I can also delete multiple projects at one time by selecting them,
01:41by holding down the Shift key and clicking on each project, right-clicking and
01:46then choosing Delete.
01:48And inside the Delete Resources dialog, I can click Preview and it'll show me
01:52everything that it's going to do.
01:54So, I can see that it's going to delete both of these projects and I'm fine with that.
01:58So, I'll click OK and both of those projects are removed from my Navigator.
02:03Now you know how to manage the projects in your ColdFusion Builder installation
02:06to ensure that things run smoothly once you have a large number of projects.
02:11If you start seeing CFBuilder take a long time to startup or process files in
02:15the IDE, you should start closing inactive projects as the first step to
02:19troubleshooting those performance issues.
Collapse this transcript
Linking folders
00:00If you've ever worked on a large application or a suite of applications,
00:03you've probably had files spread out across multiple physical locations.
00:07For example, you may have all of your applications ColdFusion files in one
00:10directory, let's say your www root, and all of your components in another
00:14directory outside of the web root.
00:16While this is a great way to organize a project,
00:18it can make things hard to work with.
00:20ColdFusion Builder fixes this problem by allowing you to link a folder into your project.
00:25Let's take custom tags as an example.
00:28By default, in ColdFusion, all of your custom tags are stored in a CustomTags
00:32directory inside of the ColdFusion 9 installation directory.
00:35But if you wanted to edit those custom tags, you'd either need to create a
00:38project in your Navigator or choose File and Open, then browse directly to those
00:42files on your system.
00:43But it'd be far easier if they just lived inside of your project.
00:48To do that, we can right-click on our project and choose Properties and go to
00:52the ColdFusion Project category.
00:55The bottom-half of this dialog lists an additional resource section where I can
00:59link folders to resources outside of my project.
01:02So, I'll click Add and I'm going to browse to my CustomTags directory.
01:07In my ColdFusion9 folder, I'll select CustomTags and click Choose.
01:12CF Builder will automatically insert the name of your folder into the linked
01:16folder name field, but if you need to change it, you can type-in a new name.
01:19If I'm going to have CFCs in this directory, I can leave this box checked so
01:24that ColdFusion Builder will use that folder to resolve CFCs.
01:28For now, uncheck the box since we're pointing to our CustomTags and click OK.
01:33I can now see my linked folder in the Additional Sources list and I'll click OK
01:37again to return to my Navigator.
01:40You can now see a CustomTags directory with the small linked icon on top of the folder.
01:46If I expand this, I can see all of the custom tags that are installed on
01:49my ColdFusion server.
01:51Now this directory does not actually exist inside of my project, but I can get
01:55access to all of the files and actually open them and edit them.
01:59So, you need to keep in mind that when you edit this file, you're not just
02:03editing this file for this project.
02:05If you have other applications that point to the same CustomTags directory,
02:09those changes will be reflected in those projects as well.
02:12Linking folders between projects is pretty simple.
02:15It allows you to keep your files organized just the way you like them without
02:19sacrificing usability in your workspace.
02:21Just remember that changing your file here will change it in every other project
02:25that references the same folder.
Collapse this transcript
3. Servers and Services
Configuring and managing ColdFusion servers
00:00A great deal of advanced functionality is available to CF Builder
00:03if you hook it directly to your ColdFusion server. You can add and manage
00:07multiple servers directly inside the server view of CF Builder.
00:10Once you have a ColdFusion server configured, you'll be able to access data
00:13sources and file system data on the server as well as get SQL code hinting,
00:18view components on the server and =hook directly into Web services.
00:22So, the first thing you need to do is add a server.
00:24If you don't already have the Servers view open-- as you can see here, it's on
00:27the bottom half of the default UI.
00:31You can go up to Window, choose Show View and select Servers.
00:37Once you're in the Servers view, you'll see this little Add Server icon.
00:41If you click the little down arrow, you can choose Connect to ColdFusion Server,
00:45which opens the New ColdFusion Server Setup dialog, which looks a
00:48little bit intimidating.
00:49Since we're working on a local ColdFusion server, we're not going to have to fill
00:53out most of the stuff on this dialog.
00:54So, let's just get started.
00:56I'll give my server a name.
00:57We'll call it Local CF9.
00:59If I like I can give a description.
01:02If I have three or four or a dozen servers that I'm going to be working with and
01:06they will help me to know which one I'm managing inside the Servers view.
01:10So, we'll call this my Local ColdFusion 9 Installation.
01:15Now for the Application Server, the default is Jrun, which again is what our
01:19local development ColdFusion 9 is running on top of.
01:22If you are using a different application server, you'll need to choose Other.
01:26You will not however be able to start and stop ColdFusion directly from
01:30CF Builder if you're not using Jrun.
01:32So, the next thing we'll provide is our host name.
01:36Since we're working on our local machine, we'll call that localhost.
01:39If you needed a different IP address or even a proper domain name, you'd enter that here.
01:44And since we're working locally, we'll leave Is Local selected.
01:48If you choose Is Remote, nothing really changes, although you won't be able to
01:51auto start and stop your servers, but the dialog doesn't change at all.
01:55So, we're going to leave this at Is Local.
01:57And then our WebServer Port, the default for a ColdFusion 9 development instance
02:03is 8500 and then for Context Root and Application Server Name, you only need
02:07those if you're going to be using a multi-instance ColdFusion server.
02:11So, if you had a ColdFusion server with multiple instances setup, you would
02:15need to tell CF Builder which instance you're going to be hooking into so that
02:19it knows what to use for RDS and all those other wonderful features we're going to be using.
02:25So, the last thing on this dialog is we're going to enter in our RDS user name
02:28and password, which you should have set up when you installed ColdFusion9.
02:32And then we're also going to Auto Start and Auto Stop this server.
02:36What that means is when CF Builder shuts down, when we quit CF Builder, it will
02:40automatically stop the ColdFusion server.
02:43When we start CF Builder up, it will automatically start the ColdFusion server.
02:47That means that CF 9 will be up and ready to go as soon as we start CF Builder and
02:51it'll shut down so it's not using any computer resources when we're done working
02:55for the day and we quit the application.
02:57So, once that dialog is complete, we'll click Next and now we need to specify
03:02our local server settings.
03:03So, I'm going to choose where my server home directory.
03:06So, I click Browse and in this case, my local ColdFusion server is under
03:10Applications in ColdFusion9.
03:13If you are on the Windows' side that's most likely under your C drive in the
03:16ColdFusion9 directory.
03:18So, I'll click Choose and ColdFusion9 will do the rest for us.
03:21It can determine the version and it sets our web root.
03:25If we were using a remote server, we would need to select the ColdFusion version
03:29in this little dropdown list.
03:30Now these next two we're not going to be using for our local installation, but
03:34the URL Prefix and Virtual Host Settings are used if you need to access files
03:39that are outside of your regular web root.
03:42For example, if you have CFCs that live outside the web root that you need
03:46CF Builder to be aware of, you can specify those here in the URL Prefixes.
03:50And Virtual Host Settings you'll use if you're using a server that's hosting
03:54multiple web sites on the same IPs.
03:56You will specify each of those web sites, their individual ports and document
04:00roots, all that other kind of good stuff.
04:02So, as we're just using our regular local installation, we don't need to worry
04:05about any of this either.
04:07So, we'll click Next.
04:09Now it's going to ask us if we want to install some extensions that come
04:13with CF Builder, which include an ORM CFC builder and a standard CFC builder extension.
04:20At this point, we are not going to install these extensions because I'm going to
04:24cover this later in another chapter.
04:26So, click Finish and down here, it is going to set up our ColdFusion server and
04:33immediately start it since I had elected to have the server auto-start.
04:37So, as you can see, it's showing me everything in the log view for ColdFusion
04:43server as the server gets started up.
04:45And now we can see it's ready to go.
04:47It took 15 seconds to get the server started.
04:51It's now that your server is set up, we'll go back to the Servers view and you
04:54can see that it is currently running.
04:56If I scroll over here to the side, you can see there's the description I typed in.
05:01There's the server type, which is local, my host and my port.
05:06Across the top, here we also have options to restart the server, ColdFusion 9
05:11servers can't be paused, and we can stop the server.
05:14We can also open the logs for each server.
05:16We can look at the event gateways, the server logs.
05:19Again, we're going to cover an another video, but for now, I'll show you how to
05:23stop and start the server.
05:25Scroll back over here to the left and if I just right-click on the server I also
05:29have all those same options.
05:31We can restart, stop, delete or edit the server.
05:34I could even launch the Server Monitor or the ColdFusion Administrator
05:38directly from here.
05:40So, let's stop the server.
05:42If I go back over here to the console, we can see it didn't take any time at all
05:46to completely stop the ColdFusion server and then it destroys all the resources
05:51the ColdFusion server was using.
05:52Go back over here to the Servers view and we can see that that server is
05:56now listed as Stopped.
05:58So, this time I'll click on the little play icon and we'll start the server back up.
06:03We now know how to add and manage all of your ColdFusion servers in CF Builder,
06:08but don't go overboard.
06:10Be sure to configure just what you need in order to keep CF Builder working
06:13nice and smooth and double-check your configurations before moving on to
06:17developing your application.
06:18A good number of features depend on having access to your project's ColdFusion
06:22server, so make sure you have all those settings correct.
Collapse this transcript
Using the Services Browser
00:00The Services Browser in ColdFusion Builder gives you access to all of the
00:04ColdFusion components on your ColdFusion server as well as external Web services
00:08that you can add directly inside the Services Browser.
00:11So, let's first take a look at the ColdFusion components.
00:13If you don't already have the Services Browser open in this bottom group of views,
00:17you can choose Window > Show View and find the Services Browser.
00:21I want to make this a little bit larger so we can get in here and play.
00:25I'll expand my Local CF9 server and here I can see all of the components that
00:29are currently available to me inside of my application.
00:33If I expand the cfcs package here, I can see all of the components that are
00:37currently inside that directory, and if I go take a look here inside my
00:41Navigator view, you can see all of those matching components.
00:44As I expand each component, I can also see its location and each of its
00:48individual methods and the type of method that it is.
00:51As you notice this small gift wrapped box here, that's a package method.
00:56The init method is public, and I could also show private and remote methods.
01:01If I only want to be able to see public methods, I can also turn off specific
01:06methods by clicking these boxes here at the top.
01:08So, I'll deselect the Show Package option and all the package methods disappear.
01:13I'll click it again and they show up.
01:15You can also use the Services Browser to insert calls directly to methods, which
01:20I'll cover later in this course when we talk more about components.
01:23Now if you are building any sort of application that requires access to
01:26the ColdFusion Administrator APIs, you can click the little lightning bolt icon here
01:31and it will actually show you all of the system cfcs.
01:34Here, I can see cfdocs, CFIDE and all of the Administrator API functionality.
01:40If I deselect the lightning bolt, all those will disappear again.
01:44So, as I said earlier, that's all we are going to cover for components in the
01:47Services Browser for now, but I'll show you some more about that later on in the course.
01:51Next, we're going to take a look at Web services.
01:53In the upper right-hand corner here, I can click on the Show Web Services icon
01:58and it switches over to this nice empty screen.
02:01So, what we're going to do now is actually consume a Web service from the
02:05Adobe Feeds Website.
02:06I have the Web site open in Safari already.
02:09So, we'll switch over to Safari and I'm on feeds.adobe.com/Developers.cfm.
02:15Here on the page, it lists a WSDL file
02:18that defines the Web service for the Adobe XML News Aggregator.
02:23I'm going to copy that WSDL URL, go back to my Services Browser, and click the Plus icon.
02:30This will bring up the Add WSDL dialog where I can paste in my URL and click OK.
02:36The ColdFusion server will then go out, take a look at that WSDL file and then
02:40show me all of the methods that are available on that particular service.
02:44I just need to expand the nodes here until I see all of the methods.
02:49Now just like with components I can actually insert calls directly to
02:52these methods in my code.
02:54In the Chapter 3 folder, I have an empty index.cfm file ready to go.
02:58So, if I want to call the getCategories method of this Web service, I can
03:02right-click and choose Insert CFInvoke.
03:06So, the CFInvoke tag already has my WSDL URL set up for the Web service attribute.
03:11It's calling the proper method and then putting the results into this ws return variable.
03:16So, now I'm going to add a cfdump and actually dump out the results of that
03:19variable to make sure it's actually working.
03:21So, if I click on the Safari tab, I'm going to get an alert that there is no
03:26server yet configured. While I've added a server to the Servers view I have yet
03:30to associate it with my project.
03:32So, I'll click OK and switch back to my Code view and then in the Navigator,
03:37I'll right-click on my project, choose Properties, and then in the ColdFusion
03:43Server Settings section, just choose the server that I want to relate to
03:46this project, click OK.
03:50I'll switch back to the Safari tab, and here I can see the results of the
03:53getCategories method call to that Web service.
03:56If I have more Web services I'd like to use, I can just click the Plus icon
03:59again and continue to add WSDL files until I have everything I need.
04:03So, the Services Browser is probably something you are going to keep open all
04:07the time so that you can quickly gain access to all of your components and
04:10all of your Web services as you continue developing your applications.
Collapse this transcript
Using RDS Dataview and Fileview
00:00The RDS Data view and File view allow you to view data sources and files directly
00:04on your ColdFusion server.
00:06In order to make these items work, you must have RDS enabled, which is
00:10discouraged on a production system, and you may not have checked that box when
00:14you installed your local ColdFusion 9 server.
00:17So, make sure that you're working on a secure system before enabling RDS and in
00:20order to check and make sure that you have RDS enabled, you can right-click on
00:24the server in your Servers view and choose Launch Admin Page.
00:28Now, this opens a ColdFusion Administrator directly inside of CF Builder.
00:33So, I'm going to type in my password here and once we are inside the ColdFusion
00:37Administrator, if you click on the Security section here at the bottom of the
00:42left-hand side, you should see RDS.
00:45If you don't see RDS, then that means that RDS was not enabled on your system
00:50when you've installed ColdFusion.
00:51Unfortunately, there's no way to enable RDS directly through the
00:54ColdFusion Administrator.
00:55So, there is an Adobe TechNote that will show you how to do that and that is
01:01TechNote number 17276.
01:04Unfortunately, if I scroll down here, you can see that it involves a bunch of
01:08editing of XML files and restarting your server.
01:11It's not too bad, but you will need to go through and edit those XML files and
01:15restart your server before you can continue with the rest of this video.
01:19So, let's go back to ColdFusion Builder.
01:22Now that I know that I have my RDS enabled, I know my password, I can close this,
01:27and we're back at our regular ColdFusion Builder view.
01:31Depending on the setup on your local machine, the CFCs displayed may differ
01:34from those shown here.
01:36And over here in the RDS Data view, we can expand our Local CF9 node and I can
01:43see all of the data sources that exist on that server.
01:47I can also expand each of these data sources and look into any tables, views and
01:53all the other resources on this database.
01:56I can even expand the individual tables and see every single column and their data types.
02:00The other great thing about the RDS Data view, especially if you're on a Mac and
02:04connecting to a SQL Server database, or you're on a Windows machine and you
02:09don't have MySQL or SQL Server installed locally or don't have the tools to
02:14connect directly to your database, you can actually run queries directly from the RDS Data view.
02:20This little button here is the RDS Query Viewer.
02:24I'm going to click that and I can actually start writing queries directly in
02:28here to look at the data on my server.
02:31So, at the top, I can choose the server that I want, the data source,
02:35we'll look into cfartgallery, and I can type some SQL, I can click Execute and
02:40I can take a look at all the data inside of that table directly from inside CF Builder.
02:46So, we'll close the RDS Query Viewer and if we go back over here, we can also
02:51see that I can right-click on the table names and show the table contents
02:56or edit the RDS configuration.
02:59I can refresh the RDS Server if I've made changes to datasources that I need to show up.
03:04The Go Into option also allows me to drill down into a smaller subset of data.
03:10Let's do this, for example.
03:11If I'm working on the cfartgallery database, I might not want to see all this other stuff.
03:17So, I can right-click on cfartgallery and choose Go Into.
03:22Now, all I'm seeing is the cfartgallery Tables, System Tables, Views, and Synonyms.
03:28If I need to get back up to the top because I want to see all the datasources,
03:31I can click on the Home button and now I can see everything on that server.
03:35Now, if I need to change something about my RDS configuration, I can click this
03:40button right here, which will open up the RDS Configuration dialog.
03:44I can choose the server that I'm working on and then I can adjust the user
03:48name and the password.
03:49Well, I wanted to prompt me for a password and a few other options.
03:52So, go and cancel this dialog and that's about all there is to the RDS Data view.
03:58The View Setting right next to that one is the RDS File view.
04:02This allows me to look at all the files on my "remote system."
04:06Now I'm actually using my local system as my remote system so I can see
04:10everything on my Mac hard drive directly through the RDS File view.
04:15So, if I click on Applications, I'll find ColdFusion9.
04:20I'll choose Go Into and now go down to the wwwroot.
04:27I'll Go Into here and then I can see everything that I can also see in my navigator.
04:34RDS integration was something I've used a lot of in Dreamweaver and sorely
04:38missed when I switched over to CF Eclipse.
04:40It's great to have the feature back in a dedicated ColdFusion IDE.
04:44Just make sure that you only use the RDS access on your local development or
04:47secure staging servers and never enable RDS in a production environment.
Collapse this transcript
Using FTP
00:00While it's always best to work on local development environments when you're doing
00:03your day-to-day work,
00:04there's always comes a time when you to need to upload a file to a server.
00:07We can do this is in CF Builder by creating a synchronization connection between
00:10our projects and a remote FTP server.
00:13There's just a few simple steps to get things configured.
00:16To associate a project with an FTP connection, you simply need to right-click on
00:19the project, choose Synchronize and Create New Synchronize Connection.
00:26In the Site Connection dialog box, you provide a name for your connection.
00:29We'll leave it at the default, which is our project's name.
00:33We choose the project that it's going to be connected to and then we can choose
00:37which type of server we want to associate with this project.
00:41So, our options are FTPS, FTP, another existing project shortcut, or SFTP.
00:48In this case, we're going to choose FTP.
00:50This'll bring up the new connection dialog box and we'll give our site a
00:54friendly name that we can reference.
00:56In this case, it's going to be server1.
00:59I can select my connection type, which, in this case, is FTP.
01:03I can change it if I had made the wrong selection in the previous dialog and
01:07then I'll provide my FTP details.
01:09In this case, my server name is server1.sitedrivinc.com.
01:14My user name is cfbuilder and my password is top-secret.
01:19Then I'll click Test to make sure that the FTP connection actually works.
01:25We can see that the connection is succeeded.
01:26If there was a problem, it'd tell us what that problem was, so that we could correct it.
01:32Click OK and then I can choose the remote path.
01:36In my server's case, my remote path actually includes my user name.
01:40Your server may or may not have this requirement.
01:43So, make sure that you have the proper remote path specified as defined by your host.
01:47So, you click on the Advanced Options and change the port number, use passive mode,
01:53or if you're having problems with the synchronize functionality not working
01:56correctly, you can calculate the server and client time offset.
02:00In this case, I don't need to change anything so I'll click OK and click OK once more.
02:07Now I can see that I have my project associated with my new server1 remote connection.
02:12I'll click OK once more and if I look at my File view, I can see my new Project
02:19Shortcut is setup here. My FTP server that I've just defined is set up here.
02:24And in my Navigator view, I can now see I have these double arrows here
02:29that determine that there is a synchronization connection associated with this project.
02:34So, now how do we upload files?
02:36Well, in our Chapter 3 directory, let's create a new file to upload.
02:40I'll right-click, choose New > ColdFusion page, just call this index and we'll
02:46type some code in here, This is my test file.
02:48I'll save that and to upload, I need to right-click on the file, choose
02:55Synchronize and Upload.
02:59When I click Upload, it's going to give me a message that says, "are you sure you
03:02want to upload this file?"
03:03It'll overwrite any items with identical names at the destination.
03:07This is the same warning you get when you upload a file through Dreamweaver.
03:10Basically, are you are you sure you want to do that?
03:12We'll click Yes and we can see that one item was uploaded and one folder was
03:18created because that Chapter 3 folder didn't exist on my remote site. I'll click OK.
03:24And if I click on the Console view, I can actually see all of the FTP
03:28communication that happened with my remote server.
03:31So, if you are having problems with files not uploading correctly, you can look
03:36in the console and determine exactly what went wrong.
03:38Now you can also look at your remote site by going through the File view.
03:42If I click on the small arrow here next to my FTP server, I can see that
03:47Chapter 3 folder that I've uploaded and I can see the index.cfm file sitting on the remote server.
03:53I can also right-click here and take actions on that file, for example, if
03:58I want to delete it.
03:59Let's go ahead and delete this file.
04:00It'll ask us, are we sure?, and you cannot undo this action.
04:04So make sure you really are sure. And I'll click Yes and that file has been removed.
04:11Now, one functionality that I've used a lot in Dreamweaver is actually
04:14synchronizing my local system up to my remote system.
04:17You can do that in CF Builder as well by right-clicking on any file or directory
04:22in your project, choose Synchronize and Synchronize again, and this brings up the
04:29Synchronization preview for your site.
04:31I can see that I'm going to be synchronizing with server1 and here I can see my
04:36local system and my remote system.
04:39In this case, the index.cfm file is going to be created on server1.
04:44If I didn't want that file to be created, I can simply click the Skip check box
04:49and it will skip that file in the synchronization options.
04:52I do want this file to be uploaded so I'll uncheck that box.
04:56Under the View Options here, I can also determine how I want to see all of the
05:00resources that are going to be synchronized.
05:03By default, it shows a flat view, but if I choose Tree, I can see the individual
05:08folders and all the files underneath those folders.
05:11I can also choose the Show Modification Dates.
05:14So, if I choose that option and I'll scroll over here to the right, I can see
05:19the local and remote times for files.
05:21Since this file isn't on the remote server, I don't have a remote time.
05:24Now down at the bottom, I can also choose to delete orphaned files.
05:29So, as an example, if I wanted any files not on the remote server to be deleted
05:34on my local system, I can check this box and you can see that the Chapter 3
05:40index file is actually going to be deleted.
05:42Let me scroll back over here so you can see that.
05:46So, since I don't want this file to be deleted, I'm going to uncheck that box.
05:52Now over here under Mode, if I expand this menu, I currently have it set to Sync,
05:57which means if the file is existed on the remote server, it will be
06:00downloaded and if a file existed on the local server, it would be uploaded.
06:04I can change this so that I'm only uploading or only downloading.
06:08I can also force all files up to the remote server even if they're older than
06:12the ones on the server and vice versa.
06:15I can force all files down even if they're newer on my remote system.
06:19To continue through the dialog, the next section is the Cloud Team Comment.
06:23If you're using the cloud team functionality as part of Aptana, this will
06:27make sense to you and you can actually enter any comments in this dialog box.
06:31The last thing we'll take a look at is the Advanced Options.
06:35Under the Advanced Options, you can use a CRC check when files are less than a
06:39minute apart to make sure that they actually are different.
06:42This would take into account any slight time differences in between your
06:46local and remote server.
06:48We can also have it do all of this work in the background for us so we can
06:51continue working on other things and we can set permissions on files if we're
06:55working on a remote server that supports that functionality.
06:58So, now I'm going to collapse the Advanced Options and since I'm all ready to go,
07:02I'll click Start Sync.
07:05ColdFusion Builder then uploads, deletes, overwrites, does whatever it needs to
07:09do to get everything at the sync and then tells me that everything is taken care of.
07:13So, I'll click Close, go back over here to my FTP site and we'll just expand
07:18this to make sure that it did indeed upload my index.cfm file.
07:22So, you should now be able to hookup any project to an FTP site and get your new
07:26creations published quickly.
Collapse this transcript
4. Editor Preferences
Creating editor profiles
00:00You most likely have been using another IDE for years and you have your own
00:04style of coding and your own preferences for colors and formatting.
00:08Luckily, CFBuilder gives you a great deal of control over how your code is
00:11displayed and how the editor responds to your actions.
00:14In this chapter, I'm going to show you how to get things just the way you like them.
00:18To get started, I'm going to show you how to manage your editor profiles.
00:22You can get to the editor profiles by choosing the Adobe ColdFusion Builder and then Preferences.
00:27On the Windows side, you'll choose Window and then Preferences.
00:31Once inside the Preferences, expand the ColdFusion node and choose Editor Profiles.
00:36The Editor Profiles store all of your existing information for colors, code
00:42assist, keyboard shortcuts, basically anything to do with how the editor works.
00:47Now ColdFusion Builder comes with several default Editor Profiles.
00:51The first one is, of course, Default, which is how ColdFusion Builder comes
00:54straight out of the box.
00:56They also have Editor Profiles for CFEclipse and Dreamweaver, which have common
01:00CFEclipse and Dreamweaver keyboard shortcuts, as well as code coloring.
01:04As you can see, I already have an option in my profile list called Custom.
01:08As soon as you start changing any of the settings, it will automatically create
01:12a custom profile for you.
01:14Now if I want to create a new profile, I can click the Create New Profile button
01:18and give my profile a name.
01:20In this case, we're going to call it Dan.
01:21I'll click OK and now we can see I have this new active profile.
01:27Now, it has inherited all of the settings from the default CFBuilder profile.
01:33I can then expand the Editor Profiles section and start playing with all these
01:37settings and they'll automatically get saved under this Dan profile.
01:42If you decide for whatever reason you want to remove a profile, just select it
01:45from this list and click Remove.
01:47It'll ask you if you're sure you want to delete it, and click OK, and it goes
01:52back to the Default profile.
01:54So, let's create that one again.
01:56Again, we'll call it Dan and there we go.
01:59Now that you know how to create and manage Editor Profiles, you can start
02:02customizing those preferences in the next few videos.
Collapse this transcript
Using Code Assist
00:00When working day-to-day you'll live and die by CF Builder's Code Assist features,
00:04so take some time to get them right.
00:06Let's look at the Code Assist Preferences and then I'll walk you through all
00:09the various settings.
00:11To get your Preferences on the Mac, choose the ColdFusion Builder menu
00:14and select Preferences.
00:15If you are using Windows, the Preferences menu is under the Window menu.
00:19Inside the Preferences, under the ColdFusion node and Editor Profiles, choose Editor.
00:24This first section is pretty simple.
00:25At the top, we have our Pair Matching preferences.
00:29This determines how ColdFusion Builder will show you matching pairs,
00:33parentheses, tags, brackets, et cetera.
00:36You can choose the color
00:37you want to highlight these pairs, and choose whether you want it to match pairs at all.
00:41Highlight only the matching element you don't have selected, or highlight the entire pair.
00:46I'll show you how that works in just a moment.
00:48Below the Pair Matching, you can choose to either display or hide the CFML
00:52toolbar and you can also elect to trim spaces before saving a file, which
00:56I like to do to keep all the end of my lines nice and clean.
00:59Below this, is a nice looking button that says Optimize editor preferences.
01:03If you click that button, be sure you read this dialog completely.
01:07This will change your current preferences to make the editor work as fast as
01:10possible, but you won't be able to undo these changes and they will overwrite
01:14all of your existing profile settings.
01:17So, if you are going to use this, make sure you save your existing profile
01:21before creating a new one for these fast editing preferences.
01:24So, I am going to click No here and we'll continue on with the dialog.
01:28Below that section, you can set some default file content for CFM and CFC files.
01:34I'll like all of my CFM files to have a <cfsilent> tag at the top or I could put any
01:38business logic that used to go before all my presentation code.
01:42I also like to have a description of the file at the top, so when I come back to
01:46this file six months from now, I'll actually know what it's suppose to do.
01:49So, I now have some initial CFM content and I'll apply my settings and click OK,
01:54and let's see how this works.
01:56Under the Chapter4 folder I'll right- click, choose New, and ColdFusion Page.
02:01I'll give my file a name.
02:03Let's call it FileTest and click Finish.
02:05We can see my file now has my default content in it.
02:10If I place my cursor at the end of this comment, I can see that it matches up
02:13the start and the end comment with this highlight.
02:16If I place my cursor inside of my </cfsilent> tag it also highlights my matching
02:21starting <cfsilent> tag.
02:22So, that's what the Pair Matching does.
02:25Let's go back to the Preferences and continue on.
02:27I'll expand the Editor and choose Code Assist.
02:31On this screen, I can choose my dictionary version, for example, I am
02:34coding with ColdFusion 9.
02:35If I have yet to upgrade, I can choose a ColdFusion 8 or MX7 dictionary.
02:39So, I only see appropriate tags for that particular version of the language.
02:43Below that, I can choose whether or not Code Assist automatically displays as
02:47I'm typing, and whether or not SQL Code Assist displays when I am typing.
02:51If I have these options unchecked, I'll need to press Ctrl and Spacebar in order
02:56to get the Code Assist to display.
02:58That keyboard shortcut is the same for both Mac and Windows.
03:01I can also choose the Delay Before Code Assist Displays.
03:04I am a fairly fast typer, so I'll like my Code Assist to come up as fast as I type.
03:09So, I use to change that to 50 milliseconds instead of 500.
03:13Moving on to the Auto-Insertion section, this first one looks a little bit confusing
03:17but is actually pretty slick.
03:18This one allow me to automatically insert a tag if there is only one suggestion
03:23for what that tag could be.
03:25Let me show you how that works.
03:27I'll check Automatically Insert a Single Proposal, click Apply and OK.
03:32In my code, I am going to start by typing a cf function tag.
03:36So, I'll do cff and press Ctrl and Spacebar.
03:39Now you will see that I have cffeed, cffile, cffileupload, et cetera.
03:44If I type the letter U, there is now only one matching tag that starts
03:50with those letters.
03:51If I press Ctrl and Spacebar, it will automatically insert that tag and it's
03:55matching end tag, if my Code Assist preferences are set to do.
03:59Let's go back into the preferences and look at the rest of that dialog.
04:01Now as you saw from my <cffunction> tag, it automatically inserted a closing tag.
04:07It also put that closing tag on a new line.
04:10I can also have CF Builder append spaces after inserting my selection, so I can
04:14immediately start typing attributes that go on that tag.
04:18I can have it automatically insert equal signs, and I can determine what types
04:22of characters I wanted to use when it quotes attributes.
04:26In this case, I am going to leave it on double quotes.
04:28Next, I'll move on to the Typing section, which has the rest of our code
04:31hinting bits in it.
04:33Here, we are going to have CF Builder automatically insert closing double
04:36quotes, single quotes, brackets, or pound signs, so that when we type the pound sign,
04:41it will add its matching closing pound sign.
04:44Then lastly, we can determine when we want CF Builder to insert our closing tags.
04:49In my case, I'd like you to end the tag when I finish typing the start tag.
04:53Now there is one other section, that isn't really to do with code assisting
04:57but does help when you are going through and using the editor on a daily basis.
05:01So, I am going to type-in Editor here and go to the General Editors section and
05:06then the Text Editors.
05:08Here, I can determine whether or not I wanted to insert spaces for tabs.
05:12Highlight current lines.
05:14What I am really after here is to show line numbers.
05:17I can also determine whether I wanted to show whitespace characters and a few
05:21other common Code Assist settings.
05:24So, I am going to click Apply, and you can see my line numbers have now shown up
05:27and I'll click OK.
05:29You'll notice now that we're through with all of these options that Adobe kindly
05:32turned nearly everything on for you by default.
05:35If you find that CF Builder is being a bit too helpful for your tastes, just
05:39head-back to the Preferences and start unchecking boxes.
Collapse this transcript
Setting code coloring
00:01I find it pretty amazing just how much color-coding affects my ability to make
00:05sense of the code that I am looking at.
00:07And not just any code coloring will do.
00:09I have been using the same set of colors for my ColdFusion code for years.
00:13Never mind that I am partially colorblind as well.
00:16Let's take a dive into CFBuilder's vode voloring options, so you can get things
00:19just the way you like them.
00:21If you don't still have your preferences open, let's open up the preferences.
00:25Under the ColdFusion node and Editor Profiles, choose Editor and Colors.
00:31I am going to make this window a little bit bigger, so we can see everything
00:33that's going on, move all of our ugly scrollbars. There we go.
00:39At the top, you can see we first have two options, which is to import and export
00:43a colorization file.
00:44If you are working in a team and you want everybody to have the same code
00:47coloring functions, you can get everything set up just the way you like.
00:50Then export a colorization file and they can import it on their end.
00:54Below this section, we have some Editor Options for basic coloring.
00:58These would overwrite the default Eclipse editor settings.
01:02To show you what those default Eclipse editor settings are, go over here to the
01:06filter and we will type Colors.
01:08Here, under General and Appearance, you can see we have Colors and Fonts.
01:12If I click here, we can set up under the Basic section what gets used for the
01:17Content Assist background colors and foreground colors, what gets used for
01:21dialog fonts and our text editor fonts.
01:25Over here, we can also set code coloring for our CSS files, HTML files,
01:30JavaScript, script documents, and XML files.
01:35And you will notice that they all have the exact same dialogs.
01:37So, let's get back to our ColdFusion code and start playing with some of
01:41the code coloring here.
01:43Under our Editor Options, if I choose to override Eclipse editor settings,
01:47it's going to show me what all of its current defaults are.
01:49For example, the background of our editor is white, our line highlight is a
01:54light gray, and the selection background is blue.
01:57So, if I click this item, it's going to open my system color picker, and I can
02:01choose whatever color I like and then just click OK to accept it.
02:05Let's collapse these options for now and take a look at the tokens on the bottom.
02:09The first section is keywords.
02:11You will notice we have a number of keywords here:
02:13Break, Case, Catch, but only the Function has any colors associated with it.
02:18If you would like to add additional colors, just check the box next to a
02:21particular keyword, and then you can choose how you want that keyword to be formatted.
02:25I can click the little color block here.
02:27It will bring up my system color picker, and I can choose either Bold, Italic,
02:31or Underline for that particular item.
02:33When I choose a particular formatting, that little button will
02:36become highlighted.
02:38Let's collapse the Keyword section and take a look at the rest of the options.
02:41Here, we can set numeric and string literals to have different colors.
02:45Let me show you how those work.
02:47So, the numeric literal has this color here, the string literal has completely a different color.
02:52I am going to click OK and we will take a look at our FileTest that we did before.
02:57Let's do <cfset Foo = "somestring"/>.
03:03And then we will do <cfset bar = 1234/>.
03:06As you can see, the string literal and the numeric literal have completely
03:11different colors, and that is determined by those code coloring options.
03:15Let's go back to our Colors preferences and continue down the list.
03:20Collapse the literals.
03:22We can set the punctuators, such as equal, greater or greater than equal.
03:26We can set codes for SQL comments and keywords.
03:29We can determine colors for attribute names and values and determine how
03:33whitespace gets colored.
03:35Now, I mentioned this in the previous video regarding Editor Profiles, but if
03:38you are moving from CF Eclipse or Dreamweaver, it's probably easiest to just go
03:43to the Editor Profiles and choose the profile you like best.
03:46I am going to choose CFEclipse, click Apply, and OK.
03:52You can see that my code coloring is now completely different.
03:56And there you have it.
03:57My suggestion to you would be to start with one of the default Editor Profiles
04:00and then customize to your heart's content, using all of the color preferences.
Collapse this transcript
Using shortcut keys
00:01I prefer not to take my hands off of my keyboard, if I can avoid it.
00:04So, I tend to use a lot of shortcut keys.
00:07Unfortunately, when I first started with CFBuilder, some of the shortcuts
00:10weren't quite to my liking.
00:12You can change the keyboard shortcuts for ColdFusion Builder by going to the
00:15Preferences, and in the filter, type Keys.
00:18Now, you are going to get two sets of keyboard shortcuts.
00:22The first are general keyboard shortcuts, which apply to the entire Eclipse IDE.
00:27This means that these shortcuts will apply in ColdFusion Builder, Flex Builder,
00:33or any other plug-in that you have installed into Eclipse.
00:37Now, there are a ton of keyboard shortcuts here.
00:40My suggestion to you would be to go through this list and see which shortcuts
00:44you like, make note of them, and commit them to memory.
00:48If they are not quite to your liking, you can select each one, and in the
00:52Binding section, you can type in a new shortcut.
00:55If that shortcut conflicts with anything, you will see the conflict over here in
01:00the Conflicts window.
01:01You can also export all of these keyboard shortcuts to a CSV file, so you can go
01:05through them and perhaps make a cheat sheet to put on your desk.
01:09Let's go back and look specifically at some ColdFusion Builder
01:12keyboard shortcuts.
01:14Here, you can see all of the shortcuts for inserting ColdFusion code quickly and easily.
01:20For instance, doing a cfabort tag or cfdump, which I do quite a bit when
01:25I am doing my debugging.
01:27So, these are two that you are going to want to remember.
01:29Also, wrap in pound signs Shift+ Command or Shift+Ctrl+H, or cfoutput tags,
01:37double quotes and single quotes.
01:39All of these are actions and code that you are going to be doing all day long.
01:43So, let's play with a couple of these and see how they work.
01:45I am going to play with the cfset and the cfdump keyboard shortcuts.
01:50Let's click OK and open up our FileTest.
01:55Let's delete what I have in here and start over.
01:58So, the first thing I am going to do is insert a cfset tag by pressing Command
02:02or Ctrl and the equal sign.
02:04It inserts a cfset tag, and I am ready to start typing.
02:07So, I will do <cfset Foo = StructNew()/>.
02:10Now, another thing I can do is if I hold down the Shift key and press Enter,
02:15it will actually put me on a new line, even if my cursor is in the middle of a tag.
02:20So, Shift+Enter moves me to a new line, and now I can actually dump the value inside Foo.
02:27If I want to, I can just type the word Foo and highlight it, and press
02:31Shift+Command or Shift+Ctrl+D, and it will wrap the cfdump tag around my
02:36variable with pound signs.
02:38I can press Shift and Enter again, press Ctrl +Command+A and it will insert a cfabort tag.
02:44So, as you can see, I can do a lot of coding very, very fast, if I can spend a
02:48little bit of time to get those keyboard shortcuts committed to muscle memory.
02:53That's about all there is to the keyboard shortcuts.
02:55As you go through and set keyboard shortcuts to your liking, be sure you test
02:59as you go, to make sure that your shortcuts don't conflict with any of the
03:02existing Eclipse shortcuts.
Collapse this transcript
Working with outlines and syntax checking
00:00The Outline view is something you'll constantly reference as you go through files.
00:05Unfortunately, it can be a bit unwieldy to see every tag on a page in one big outline.
00:10You can change how much the Outline view displays in the Outline preferences.
00:14So, to show you what I mean, let's first open up a rather long file.
00:18Under the cfcs directory here, let's open up the ARTService.
00:23This file isn't terribly long.
00:25It's only about 118 lines, but if you look at the Outline, almost every single
00:30one of those 118 lines is reflected in the Outline, including comments and
00:36returns and basically a bunch of stuff that you really don't need to see in
00:40order to be able to navigate this file.
00:42So, let's go to our preferences and change how much the Outline shows us.
00:46If I click on the Outline node here in the Preferences, by default, it's
00:51going to show all tags.
00:53However, I can choose Show selected tags and then I can add and remove what I
00:58want to show in the Outline.
01:00Let's click Add and then I can just type the name of the CFML tag.
01:04Let's say I want to see cfif tags.
01:08Now I can enter in a comma separated list, if I want to add more than one at a time.
01:12Click OK.
01:14Let's click Apply and you can see that my Outline view immediately changed.
01:19Now I'm only seeing my cffunction tags, because apparently there are no
01:23cfif tags in this file.
01:25In my opinion, that makes the Outline view a whole lot easier to deal with.
01:29Now to wrap up our Editor preferences, let's take a look at the Syntax Checking options.
01:34This page is really easy to deal with.
01:37We only have two options: whether we want to enable syntax checking and whether
01:41we want to display those syntax errors only on a file save.
01:46So, the syntax checking looks a lot like spellchecking in Microsoft Word or
01:51other Office applications.
01:52Let's click OK and take a look at what that looks like.
01:56Let's open up our FileTest.cfm file again and let's cause a problem.
02:02Let's enter in a cffunction tag and I'm missing all the arguments on my cffunction tag.
02:08So, you'll notice that has these dots underneath it.
02:11It also has an X over here in the gutter next to my line numbers.
02:15If I hold my mouse over that X, we can see that an attribute name is required.
02:20So, let's go back to my cffunction tag.
02:23I'll put name="myFunction".
02:27Now the X has gone away.
02:29If I go back to my Preferences and select to display syntax errors only on file save,
02:35I'll click OK.
02:36I'm going to remove my name argument.
02:40Now when I save my file, it's showing me the error is there again.
02:45So, I like this to be on all the time, so I can see problems as I go through my code.
02:50So, I'm going to uncheck Display Syntax Errors Only on File Save.
02:54We'll click Apply and OK and we're back to the way I like it.
02:59So, you now know everything there is to know about customizing your editor in CFBuilder.
03:04As I've said in previous videos, take the time to get everything just the way you want it.
03:08Trust me, you won't regret it.
Collapse this transcript
5. Using the Code Editor
Using code completion
00:00The heart of any good development IDE is its code completion engine.
00:03As you saw on the previous chapter, you can do a ton of customization around how
00:07CF Builder writes your code.
00:09So, let's put some of that to use, by working on a simple login application.
00:13In the Chapter 5 folder, I'm going to take these three files from the begin
00:17directory and we'll put them in the Chapter 5 directory.
00:23Open up these files and take a quick look at what we're starting with.
00:28First off, my Application.cfc.
00:30I just have an onApplicationStart method and an onRequest method, which we'll
00:34fill out as we continue on through this video.
00:37My index page is where I'm going to keep all of my trade secrets about my Art Gallery.
00:44On my login page, I have the start of some code of a cfparam at the top and I've
00:49started my login form.
00:51I have my username field. I just need to add the password field.
00:55Now to begin, let's go to the Application.cfc and we'll finish up this file.
01:00The first thing I'm missing in my Application.cfc is the cfapplication tag.
01:05So, I'm going to start by adding that tag here at the top and I can just start
01:10typing cfap, and as I type, the code hints will eliminate tags that don't
01:17match what I'm typing.
01:18So, I've got cfap and I only have cfapplet and cfapplication as valid selections.
01:25I can then click on the tag that I want, or use my arrow keys, select it and
01:30press Enter and CFBuilder will add a space after the tag and close it for me and
01:35immediately pop up all of the attributes available for that tag.
01:39Off to the right-hand side, I can see a tooltip that tells me exactly what
01:43that attribute does.
01:44If I use my arrow keys, I can scroll down through the attributes and the tooltip
01:48will change to show me exactly what I need to enter.
01:51So, we'll choose name, and once I have the attribute selected, press Enter, the
01:56attribute will get added as well as the equal sign and my quotes.
02:00I'll type the name of my application, press the arrow key to move past the quote
02:06and press the Spacebar again, and all of my attributes pop back up.
02:10But the name attribute is missing since it's already applied to the tag.
02:14Now for a login application, I need to enable sessions, so I can keep track of
02:18whether or not a user has successfully logged in.
02:20So, we'll scroll to the bottom, choose sessionmanagement.
02:24CFBuilder adds the equal sign and the quotes for me and then because
02:27sessionmanagement is a true or false value, it gives me the two possible
02:31entries for that value.
02:33I can choose which one I want, press Enter and then CFBuilder adds a space and
02:38pops up the attribute code hints again.
02:40So, as you can see, once you get rolling, you can really add tags and attributes
02:44very, very quickly, by letting ColdFusion Builder finish your work for you.
02:48So, we'll close the cfapplication tag.
02:51Now instead of the cfapplication tag, I actually like to use the this scope in
02:55my application cfcs.
02:57Let's replace the cfapplication tag with this scope variables.
03:00I'll press Shift+Enter to move down to a new line and then Command or
03:05Ctrl and Shift+= to add in a cfset tag, type this and press the period and
03:13CFBuilder will show me all of the appropriate attributes for the this scope,
03:17inside of the application.cfc.
03:18You'll notice that I don't get any of the tooltips for the attributes, but I do
03:22still get all of the correct attributes.
03:24The reason is that CFBuilder sees the this scope as a variable scope and scopes
03:30don't have attributes like tags do.
03:33With the cfapplication tag, it's looking at tag attribute, so it knows
03:36exactly what everything is.
03:39Now, let's go ahead and add the name attribute and put in the same thing,
03:42CFBEsstCh5, and I forgot to put my double quotes around my name, but if I
03:50hold on the Shift key and highlight all of my text, then press
03:54Command+Shift+Apostrophe on my keyboard, it will surround the code with the double quotes.
04:01I'll press Shift+Enter.
04:02We'll go to the next line, Command+Shift +=, this.sessionmanagement = true, and
04:10I can press the Shift+Enter again and go on to the next attribute very, very quickly.
04:14Now that we have our application set up, I'll go up to line 3 and I'm going to
04:19delete this line by pressing Command+D or Ctrl+D on Windows.
04:23And that would delete that line.
04:25Now I need to add my onSessionStart method, so that every time a user session begins,
04:30I can set a variable that determines whether or not that user has logged in.
04:34So, I'll go to the bottom of my file, and instead of typing out all the
04:38code this time, I'm going to use the Tag Wizard, which is right here in the cfml toolbar.
04:42So, I'll click Open Tag Wizard.
04:45I can choose the version of ColdFusion I'm coding against.
04:48In this case, ColdFusion 9, and I'll type in the name of the function,
04:51cffunction, press Enter and it shows me my tag right here.
04:56I can select my tag and click OK and CFBuilder will show me all of the
05:00attributes that are available on this tag.
05:03I can just tab through all of the attributes and set the proper values.
05:06In the access dropdown, I'll press the down arrow to get the menu to expand.
05:11I'll choose public, press Enter.
05:14Tab down to the name.
05:15This one is called onSessionStart.
05:18Our output is going to be false, returnformat will be blank, the returntype will
05:23be void. roles, securejson and verifyclient, we can leave blank and click OK.
05:31CFBuilder then adds a cffunction tag for me and leaves all of the blank
05:35attributes off of the tag.
05:36So, it only added attributes that I actually provided values for.
05:40Now I don't like the way it's formatted, because it's all flush left.
05:44So, if I click and drag to select these two lines, I don't have to select the entire line.
05:49I can then press Tab and indent both lines.
05:53If I click anywhere in the middle of the line and press Tab, it will actually
05:56just insert a Tab character.
05:59but if I have any text selected in a line, it will indent and outdent
06:03by pressing Shift+Tab.
06:05So, we have two more things to do.
06:06I need to set a variable inside my onSessionStart and I actually need to render
06:11my page in the onRequest method.
06:13I'll press Command+Shift and Enter, which will add a new line above my closing
06:17cffunction tag and place my cursor at the beginning of the line.
06:20Then press Tab, Command+Shift+= to add my cfset Session.Logged = True.
06:29Now in my onRequest method, I need to actually render the page that's being
06:33passed to the method.
06:35So, I'll do cfinclude template.
06:39After I press Enter and add the template attribute, I can click on Select File
06:43or Folder and actually browse to the file that I want to cfinclude, but
06:47in this case, we're actually using an argument passed to the onRequest method.
06:50So, I'll press pound, type Arguments, period and CF Builder will show me all of
06:56the arguments for the current function that I'm inside.
06:59So, you'll notice it lists target page.
07:02I'll just press Enter, then close my cfinclude tag.
07:05We now know all the basics of CFBuilder's code completion engine.
07:09If for whatever reason you don't see code hints pop-up when you expect them to,
07:13you can always press Ctrl+ Spacebar to get code hints to appear.
07:17If you find that CFBuilder is doing something you don't want it to do, go back
07:21into your Preferences and tweak the settings to get things just the way you want them.
Collapse this transcript
Using snippets
00:00Little has affected my day-to-day productivity in last few years quite as much as snippets.
00:05First off, what is a snippet?
00:07A snippet is that one block of code you find yourself typing or copying and
00:10pasting over and over again, every single day.
00:13So, what makes for a good snippet?
00:15A good snippet is usually a short block of code.
00:18Let's create a couple of snippets to see just how useful these can be.
00:21In the login.cfm file, I have my Login Form halfway done.
00:25I have my form down here at the bottom.
00:28I have one row with my username.
00:29You obviously need another row for the password.
00:31And at the top, I have a cfparam that sets a default value for my username.
00:36So, these are the kinds of things that I do every single day, adding cfparams,
00:40adding table rows with labels and inputs.
00:42So, we are going to turn these into snippets.
00:45The first thing you need to do to create a snippet is make sure that the
00:47Snippets view is showing.
00:50By default, in CFBuilder, the Snippets view is down here in the lower right-hand corner.
00:54If you don't see your Snippets view, choose Window > Show View and Snippets.
01:00Let's first go over the icons at the top of the Snippets view.
01:04The first one is a Refresh icon.
01:06Your snippets are actually stored on your hard drive, and I will show you
01:09where those are at.
01:10Open up your Preferences and type the word snippets. Click on ColdFusion and Snippets.
01:17You can see exactly where your snippets are stored.
01:20They are in your Documents folder, inside of your workspace, in a hidden
01:25metadata folder, and then snippets.
01:28You can choose a different location if you would like your snippets to be easier
01:31to get to, i.e. not inside of a hidden folder.
01:34Or if you are sharing snippets with multiple people, perhaps on a network drive,
01:37you could also point this to a shared folder.
01:40Let's click Cancel and go back to the Snippets view.
01:44The next button actually inserts a snippet.
01:45We will use that one so we have created one.
01:48The next one is to create a new snippet, edit a snippet, delete one, and create
01:54and delete packages.
01:55And packages in this sense are folders to store your snippets.
02:00So, you can have a folder for layout snippets or form based snippets, however
02:04you would like to organize them.
02:06But once you have 10 or 15 items in here, sometimes it gets a little bit
02:09difficult to find exactly what you want.
02:11Let's create that cfparam snippet by selecting our code.
02:15So, I don't like to type if I can avoid it.
02:18We will copy it, click Plus, and here's the Snippet Details dialog.
02:22We will give our snippet a name.
02:25I think CFParam make sense.
02:26We will leave Trigger Text blank for now.
02:29We will add that back in a bit.
02:30And then I can give it a description. Add a simple cfparam tag.
02:36And then I have a Start and an End Block.
02:38A cfparam tag does not have an end tag, so we are not going to use the End Block,
02:42but I am going to paste in my Start code and then remove FORM.username.
02:48So, now I have a cfparam tag with empty name and value attributes. Click OK.
02:54And I can now see the CFParam snippet inside of the Snippets view.
02:58Down here in the Preview, it will show me exactly what will be inserted when
03:02I insert the snippet.
03:04Go back to the code editor and I want to add a new cfparam on Line 3.
03:08So, I place my cursor where I want the snippet to be, and I can either
03:11double-click or click the Insert Snippet button.
03:14So, I double-click.
03:15It adds my cfparam.
03:17And then I have to go back up here and type in FORM.password to finish up my cfparam tag.
03:23So, how can I make this snippet more useful?
03:26First, I don't like to take my hands off the keyboard if I can avoid it,
03:29reaching back and forth for the mouse.
03:31So, I am going to undo this and use some trigger text so I can insert the
03:34snippet directly from my code.
03:36I will select the snippet and click Edit.
03:38I will go to the Trigger Text field and I am going to put cfp.
03:43So, when I type cfp in my code editor, I can press the keyboard shortcut to have
03:47that snippet inserted for me. Click OK.
03:49Now go back to the code editor, type cfp, and then Command+J on the Mac or
03:56Ctrl+J on Windows, and that inserts the snippet directly.
03:59Now, I still have to use the arrow keys or my mouse to go back and insert the
04:04name of the variable I want to param, which is also annoying.
04:09So, I will undo that one more time, and we will go back to our snippet and use
04:14some data placeholders, so that I can actually create a dialog when I insert the snippet.
04:20Inside of my name attribute, I will type $${} and then I am going to give
04:28my attribute a name.
04:30In this case, we will call it Variable Name.
04:33Then I am going to do the same thing for the value. $${Default Value}.
04:42Now when I insert the snippet, a dialog will pop up and prompt me for the
04:45variable name and the default value. Click OK.
04:49Go back to Line 3, type cfp, press Command+J or Ctrl+J, and there is my Replace
04:56variables dialog for the snippet.
04:58So, I want this to be FORM.password.
05:00I will leave the default value blank.
05:03If I wanted to, I could click this little arrow here to the right and it will
05:07expand the text field if I need to enter in more than one line. Click OK.
05:12And there's my next cfparam.
05:14I can press Enter and do another one, FORM.login, Default Value, false, press
05:19Enter, and I can continue on a line at a time to add cfparam tags.
05:24Now that's handy, but you can do more with the variables inside of a snippet
05:28than just have simple prompts.
05:30Let's undo this last cfparam, and go down and take a look at my table row
05:34here for my username.
05:36When I am building data entry tables, almost every single one of my rows is
05:40formatted just like this.
05:41The only thing that changes is the ID for the text field, the label for that
05:46field, and the value that gets placed inside of that field.
05:50So, this is another perfect candidate for a snippet.
05:52I will select this entire row and copy it, and we will create a new snippet.
05:58We just need to complete the dialog the same way we did with out cfparam.
06:00We will give it a name.
06:01I will call this Form Input Row.
06:04Now I need to decide on some trigger text.
06:07I will name it f for form, inp for input, and then row, finprow, and this
06:13Inserts a new form input row.
06:17Then for my Start Block, I will paste in the code that I copied out of the code editor.
06:22The first thing I will do is remove all the leading tabs, because CFBuilder is
06:26actually smart enough to know that if you insert a snippet with two tabs in
06:29front of it, it will indent the entire snippet block by those two tabs.
06:34So, I have removed all the tabs. Now I just need to go through and place all of
06:38my variables into the code.
06:41So, for the ID, I will do $${ID}.
06:45And every place I need to use that ID, I will just copy it and paste.
06:53I will only have to enter in the ID once, but CFBuilder will replace the ID in
06:58every instance inside my snippet.
07:01The next thing I need is a label, so $${Label}.
07:06Then I need to specify the type for the cfinput, but I don't actually want this
07:10to be a text field that I type in a value for.
07:14I only have five valid choices for the type.
07:17So, I am going to type in Type: and then a pipe separated list of the valid values.
07:24These are text, pipe, hidden, radio, check box and password.
07:32Then I will close my brace.
07:35And the last thing I need to do is specify my scope for the variable.
07:39$${Scope:Arguments|Session|FORM|URL}.
07:53Be careful that all your braces are properly matched.
07:56If your snippet syntax is incorrect, when you try to insert it into the code
08:01editor, you are not likely to get any error at all.
08:04It just simply won't insert.
08:05So, double check that you have all of your braces matching.
08:08And once you know everything is right, click OK.
08:12Now, back in the code editor, I will press Enter, type my trigger text.
08:16And case does matter, so make sure it's all lowercase, if your trigger text was all lowercase.
08:21Press Command+J or Ctrl+J, and our Replace variables dialog comes up.
08:26For my ID, it will be password.
08:29My label will be Password.
08:31For the type, I can press the little dropdown list and choose the type, but I
08:35could also type in a value here.
08:37So, if I wanted it to be a submit, I could type in Submit.
08:40I will choose Password for now.
08:43Then choose my scope.
08:45Again, I could type in a custom scope.
08:47If this was coming from a record set, I could type the name of my record set in here,
08:51but I am going to choose FORM, and click OK.
08:56Notice that each of my lines in my snippet was indented by two tabs.
09:01So, I didn't have to actually add all of those tabs into the snippet.
09:04I hope the two snippets we created here will save you hours of typing over your
09:08development career, and that you can see just how powerful snippets can be in
09:12your day-to-day coding.
09:13Stop and take a look at what you spend most of your day doing and spend a few
09:18moments to automate those tedious tasks with a few well-defined snippets.
Collapse this transcript
Using SQL editing and the Query Viewer
00:00Because connecting to a database is such an integral part of our day-to-day
00:03lives as developers, the CFBuilder has added some nice features to the IDE for
00:07dealing with your database and SQL query specifically.
00:12I already showed you the RDS Dataview earlier in this course, but now I am going
00:15to show you the SQL Editor and some of the differences between the two.
00:18To continue on with our Login application, we need to add a query to actually
00:22validate a user's username and password.
00:25So, on my login.cfm page, which we were working on in the last video, I am going
00:29to go ahead and add an if IF statement here to determine when I want to actually
00:37check the username and password.
00:39So, we have our cfif.
00:41Now I am going to write my query.
00:44So, cfquery name = rsValidation.
00:49And then we need a datasource.
00:51Now, I normally have my datasource in a variable that's stored in the
00:55application CFC, so I can use it anywhere in the application, but in this case,
00:59I am just going to drop in the datasource name directly into the cfquery tag.
01:04I can do that by just grabbing my datasource in the RDS Data view and dragging it
01:09in between the datasource attribute quotes.
01:12There is my cfartgallery datasource.
01:14I will close my cfquery, and then I can start writing some SQL code.
01:19So, there is two ways I can write the SQL code.
01:21The first way is I can right-click anywhere inside of my cfquery and choose SQL Editor.
01:28This pops up a small window, where I can actually just start writing my code.
01:32We will do SELECT * FROM, and when I press the Spacebar, I actually get a list
01:40of all of the tables inside of the cfartgallery data source.
01:44In this case, we are going to be checking against the GALLERYADMIN table.
01:48I will press Enter, type WHERE EMAIL, space,
01:52equals, we will just put an empty string for now. AND PASSWORD =.
02:00Actually, I got that wrong, didn't I?
02:01It's ADMINPASSWORD, so I will press Enter, take out my bad column over here.
02:08There we go. = empty string.
02:12So, now I can execute that query and the SQL Editor will switch to the Query Result tab.
02:17As you can see, I didn't get any results.
02:19So, let's go back to the SQL Editor and I will take out my WHERE clause.
02:23I will just cut it to my Clipboard and choose Execute again.
02:28Now I can see all of the users in the database.
02:30We have admin@demodata.com, whose password is demo.
02:35Let's go back to the SQL Editor and I will undo and get my WHERE clauses back.
02:40Now I can click OK and CFBuilder adds the SQL code in between my cfquery tags.
02:46I will press Tab to indent that.
02:49And then we will replace our quotes here with our actual cfqueryparams.
02:54But what are the datatypes for my columns?
02:56If I go back over here to the RDS Data view, I will expand Tables, GALLERYADMIN.
03:01If I scroll over here to the left, I can see that the EMAIL is a character field
03:08and the ADMINPASSWORD is also a character field.
03:10So, we will go back here, cfsqltype is going to be character, and value is going
03:16to be FORM.username, and we will do the same for the PASSWORD.
03:31And now I have my query ready to go to actually check whether or not my user
03:35authenticated properly.
03:36So, we will set cfset Session. LoggedIn = rsValidation.recordcount GT 0.
03:49So, that's one way to edit your SQL queries.
03:51If I want to edit the SQL query further, I can click inside of the cfquery tag,
03:56right-click and choose SQL Editor, and my query comes back up.
04:01But because it has ColdFusion code in it, if I click Execute, I will get a SQL
04:05syntax error and I don't get any results for that query.
04:08If I go back to the SQL Editor and then remove code here so that the query
04:14actually works, then when I click OK, that code is removed from my cfquery tag.
04:18So, this is one reason I don't like using the SQL Editor.
04:22It's a modal dialog.
04:23I can't do anything else while I am working in it.
04:25And I don't have a whole lot of control over what I can add or remove without
04:29affecting the page below it.
04:31So, let's click Cancel and I will show you the way I like to work.
04:35Let's take this query.
04:36I will copy it to my Clipboard.
04:38And inside of the RDS Dataview, I will click the Query Viewer, which opens up
04:43the RDS Query Viewer in a completely separate tab inside of my editor.
04:47This means that I can be working over here in login.cfm, go over here to the
04:52Query Viewer and check my work, copy code, back to login.cfm, and I can go back
04:56and forth all day long as I work on my queries.
04:59So, let's paste my query here, and we will remove my WHERE clauses and execute the query.
05:07Now I get my results down here at the bottom.
05:09I can check and make sure what my demo e-mail and passwords are.
05:13Then I can switch back over to the login.cfm and test my page.
05:18Now, one downside of using the RDS Query Viewer is that you don't get any code hints.
05:23If I press Spacebar in here, I don't get table names or column names, but if you
05:27have access to the RDS Data view here, you can always just click and drag and
05:31drag your table names directly into the RDS Query Viewer.
05:34That saves you a lot of typing and ensures that you don't misspell one of your columns.
05:39If you are anything like me, a third or more of your time is spent dealing with databases.
05:44The ability to preview your SQL directly inside the IDE, meaning you get rid of
05:48another tool that you have to switch back and forth between all day long, really
05:51makes a difference in how quickly you can get your work done.
Collapse this transcript
Working with components
00:00ColdFusion components or CFCs have become the de facto standard in new ColdFusion
00:04applications over the last few years.
00:07In order to make developing with CFCs as efficient as possible, CF Builder gives
00:10you a lot of help when working with your components.
00:13So, let's take a look at exactly how much work CF Builder is going to save us.
00:17Returning to the login.cfm page we were working on in the last video, I am going
00:21to take my authentication logic here, which is basically just a query and a
00:26check against the recordcount, and move that into a login service component.
00:31I am going to place my component inside of the cfcs directory.
00:35So, I am going to right-click on cfcs, choose New, and ColdFusion Component.
00:41And now the New ColdFusion Component wizard is going to write most of the
00:44CFC structure for me.
00:46The first section of the wizard just determines where the CFC is going to be placed.
00:51In this case, it's in the same directory I right-clicked on to create the CFC.
00:55If I wanted to move it, I can just click Browse
00:58and then I can specify the component name, which is going to be the name of the
01:01file minus the .cfc, so we will call this LoginService.
01:07I can then specify all of the attributes for the CF component tag.
01:10I will provide a hint. Provides Login Services for my application.
01:16I can give it a display name.
01:19I can specify if this is going to extend another CFC, and if I click browse here,
01:24I can actually see every CFC the CF Builder is aware of.
01:28You can see all of my ART, ARTDAO, ARTGateway, and ARTService inside of the cfcs directory.
01:35I can also see all of the cfdocs and CFIDE CFCs.
01:39For example, here are all the adminapi components.
01:43For now, we will click Cancel.
01:45I can also specify if this CFC implements any interfaces.
01:50This particular component won't be outputting any content, so I will
01:53choose false for Output.
01:55And then I can choose whether or not I want this to be a ColdFusion 9 script style CFC.
02:00For now, I am going to stick with the regular tags.
02:03Click Next, and I can now specify all the properties and functions for my component.
02:09On the Properties, just click Add, and I can specify all of the attributes
02:14for CF property tag.
02:15Down here at the bottom, I can also have CF Builder add getters and add setters
02:20for each of the individual properties.
02:21I can specify the access for each of those getters and setters.
02:25And if I am building a large value object CFC with say a dozen CF property tags,
02:31this will save me tons of time typing out redundant getters and setters.
02:35Our LoginService won't have any properties, so we will just click Cancel.
02:38We will have one function though.
02:41Click Add Function and our function is going to be called AuthenticateUser.
02:47I don't need any of these three attributes.
02:49I will specify the access type, which is going to be public.
02:53Our return type is going to be Boolean.
02:55I can either type in a return type.
02:58For example, if I was going to return another component, I could put in the path
03:02to that component, or if I press the down arrow on my keyboard, I can choose one
03:06of the built-in return types.
03:08And for the output, we will choose false.
03:11And we don't need return format, SecureJSON, or VerifyClient, since we are not
03:15working on remote function calls. Click OK.
03:19And I can see my function is added to the Functions list.
03:22Now I just need to add my two arguments to this function.
03:25Click Add Argument.
03:27The first argument is our username.
03:30We don't need the DisplayName or the Hint, but I will specify the type as being a string.
03:34This is going to be required and will not have a default value. Click OK.
03:38Then we will add our next argument, which will be password.
03:42It's the same thing.
03:44It will be a string, and required, with no default value. Click OK.
03:50Then I can see both of my arguments as a comma-separated list, next to the function name.
03:55Now that that's complete, I will click Finish.
03:57The CF Builder opens out my LoginService and I now have my function ready to
04:02accept all of my business logic.
04:04So, let's drop that business logic in here real quick.
04:06I will go back over to login.cfm and I will cut my query, and go over to the
04:12LoginService and we will add it here inside the function.
04:19We will var our variable first. Paste the query.
04:23I am going to double-click on the LoginService page, so we can see the entire thing.
04:27I will replace FORM with Arguments, and then return whether or not the user
04:38successfully validated.
04:40So, rsValidation.recordcount is greater than zero.
04:47So, I will save this file, and we will go back over to the login.cfm and
04:50actually use our new object.
04:52So, on login.cfm, I will delete my blank lines here and we will remove this.
05:00Now I need to insert the call to my authenticate user method.
05:03I am going to do that by using the Services Browser, which should be, by
05:08default, down here in this bottom group of views.
05:12If it's not showing, just go to the Show View menu, under Window.
05:16If I expand my server here, it will show me all of the CFCs that are
05:20available on this server.
05:22So, I will expand the cfcs directory.
05:25I can see my LoginService.
05:27And I can just right-click and choose Insert CreateObject.
05:32And it will add the CreateObject call exactly where my cursor was.
05:35I will back up, get rid of the line break, press the period, and now I can see
05:40the methods that are available on that object.
05:42CFBuilder will go through and introspect all of your components and show you all
05:47of the available methods.
05:48So, I can press Enter, and then pass in FORM.Username and FORM.Password.
05:54I can do a little bit more with the Services Browser though.
05:57Let's go to a new line.
05:59And instead of using a CreateObject call, I can use the CFInvoke.
06:03And I can actually do that on the method. Choose my method.
06:07Choose Insert CFInvoke.
06:09It will add the CFInvoke.
06:11It's calling the proper component, my method.
06:15It's setting my returnVariable, which in this case I actually want to
06:18be Session.LoggedIn.
06:21And then it provides a cfinvokeargument for each of the arguments on that method.
06:25If I scroll down here a bit more on my Services Browser, I can then take a look
06:29at each of those arguments.
06:31The last trick I use all the time for navigating around my components is inside
06:36of the code editor, if I press and hold the Command key or the Ctrl key on
06:40Windows, I can hold my mouse over an object or a method and click on it, and
06:45it will take me directly to that object or method.
06:48So, as you can see, I clicked on AuthenticateUser.
06:51It brought me right to the authenticate method inside of the
06:54LoginService component.
06:55If I go back over here to login.cfm, I can do the same thing with the CFC
07:00itself, press Command, click on LoginService, and it will take me to the first
07:04line of the LoginService component.
07:06CFBuilder has some great component integration, just don't forget to use it.
07:10Instead of choosing New in ColdFusion page, choose New ColdFusion Component and
07:15fill out the wizard.
07:16Keep your Services Browser open and handy and don't forget to hold down the
07:20Command or the Ctrl key to quickly navigate in between your ColdFusion pages and
07:24their matching components.
Collapse this transcript
Working with variable mapping
00:00It's common practice to store a copy of a CFC and a variable for use
00:04throughout your application.
00:06These singletons or single instances of objects are used a lot, but CFBuilder
00:11won't know about them unless you tell it where to find them.
00:14You can set up variable mappings to tell ColdFusion about any CFCs that you have
00:18stored in a scoped variable.
00:20To demonstrate this, let's assume that we already have access to our
00:23LoginService through an application variable, Application.LoginService.
00:29To tell CFBuilder that this CFC lives in a specific application variable, I just
00:34need to right-click on my project in the Navigator, choose Properties, and go to
00:40the ColdFusion Variable Mappings section.
00:43Here, I can add as many mappings as I want.
00:45I will click New and I am going to map Application.LoginService to the
00:51cfcs.LoginService component.
00:54I need to use the exact same path here that I would use inside of my
00:59CreateObject statement.
01:01Click OK and I can see my new mapping.
01:04I can then add as many as I would like.
01:06If you make a mistake, you will need to actually delete the mapping and create a new one.
01:10There is no way to edit a mapping through this dialog. Click OK.
01:16And now I am going to replace Line 8 with a new one.
01:19We will do Session.LoggedIn = Application.
01:25You can see Application selected in my code hints, so press Enter.
01:29I can then see LoginService in my code hints. Press Enter again, press a period.
01:34And because I am right up against the closing bracket on the cfset,
01:38my code hints don't pop-up.
01:39But if I press Ctrl+Spacebar, I can then see the AuthenticateUser method.
01:44Press Enter once more, and then I can add FORM.Username and FORM.password.
01:52So, now I have access to all of the methods on this application scoped variable.
01:58Now, if you are using any sort of framework, like model-Glue, Fusebox or
02:02ColdBox, you will most definitely have a large number of objects that are inside
02:06of scoped variables.
02:07To get the most use out of these objects, be sure to set them up in the Variable
02:11Mappings in your project properties.
Collapse this transcript
Navigating code and documents
00:00If your days end up anything like mine, by noon you have dozens of documents
00:05open, and for the life of you, you can't remember exactly what you were
00:08working on or where that last file was that you needed to change.
00:11One of the things I love most about CF Builder is just how fast it allows you to
00:15get around your code and find what you are looking for.
00:18There are a ton of keyboard shortcuts and toolbar buttons that help you find
00:21what you want as fast as possible.
00:24To start with, we will take a look at navigating between documents.
00:27Right now, I have my ColdFusion Builder start page open and four documents,
00:32which has just enough room to show all of the tabs along the top here.
00:36But if I go over to my cfcs directory and open up a couple of components,
00:42I no longer have room to display every file that I am working on.
00:45So, over here to the side, you can see there is a small double arrow with a
00:50number that shows how many documents are open, besides the ones that are
00:53currently showing in the tabs.
00:56So, if we click this little button, we can see at the top,
00:59I have four bolded documents that are not viewable in the tabs along the top,
01:05and then at the bottom I have everything that I can currently see in the tabs.
01:09If I start to type, at the top, I can filter down that list to find exactly what I want.
01:14Use my arrow keys to select the document and press Enter, and then that
01:20document comes into focus.
01:22I can get to this same list by pressing Command+E or Ctrl+E on Windows to
01:27bring up the file list.
01:28I will type in login, choose login.cfm, and press Enter, and then that tab comes into focus.
01:35Now, you will notice that CF Builder will continually redraw the tabs to fit
01:38as many as it can, and now my file list shows that there are five additional documents open.
01:43So, just expect your tabs to jump around a little bit and for this number to
01:47change as you move through your documents.
01:49Now, what about navigating around a single document?
01:52Let's go to the ARTDAO.
01:55And this file is fairly long.
01:57We have got about 140 lines.
02:01If I move over to the Outline view, I can see the structure of my ARTDAO.cfc.
02:07I can also go up here to the Filter and filter down my list to find exactly the
02:11method that I am looking for.
02:13So, for example, I type cre.
02:15I can scroll down and find my Create method and it gets highlighted over in the code editor,
02:20but there is also a way to do this directly inside of the code editor, without
02:24having to reach for my mouse.
02:25If I press Command+O, it brings up the same Outline view.
02:30I can start typing a method that I want to find, use my arrow keys, select it,
02:35and press Enter, and it will go directly to that method.
02:38Also, in the little Outline pop-up, I can click this menu and choose whether or
02:43not I want it to remember the size and location.
02:46So, for example, I can make the window larger.
02:49I can also choose whether items should be sorted alphabetically or in the order
02:52they appear in my code.
02:54I can collapse and expand everything directly from here, and I can hide private
02:58methods that won't be available to my CFM files.
03:01To get rid of the Outline view, I can just press Esc, and I am back to my file.
03:06Another way I tend to move quickly through my code is by searching for specific
03:10variables that I am using.
03:11So, as an example, here in my Create method, I have an argument called ARTID.
03:16If I want to know everywhere that the ARTID method is used, I could open the
03:20Find dialog, but it's easier to use the Find Selection keyboard shortcut, which
03:25is Command+K or Ctrl+K.
03:26If I hold down Command+K, it will cycle through all of the instances of the word ARTID.
03:32So, I am just pressing Command+K and it's jumping through every match for
03:38the current selection.
03:39If I hold down Command+Shift+K, it will go backwards through the document.
03:43So, I can move back and forth through my entire document and find everywhere
03:47that I am using a particular string of text.
03:49Now, there are also times when I need to jump to a specific line in my code.
03:54To do that, I can press Command+L or Ctrl+L, and that brings up the Go to Line dialog.
03:59Then I can just type in Line 50, press Enter, and it will jump directly to that line.
04:04So, those are the ways to navigate to a specific location if you actually know
04:08where you want to go.
04:10But oftentimes, if I am five or six files down into solving a problem, sometimes
04:15I forget where I have been.
04:17Across the top of CF Builder, in the toolbar, we have Back and Forward buttons,
04:22just like you have in a Web browser.
04:24You can click the Back and Forward buttons to actually move through your code,
04:29to go back to where you have been.
04:30I can see I have been in six different locations in the ARTDAO. Before that I
04:35was in login.cfm, and before that, I was in ARTGateway.
04:38I can click the Back buttons and cycle back through each of those positions, and
04:44then I can click Forward to go back through that same list.
04:48This far left icon is the last Edit location, and this goes back to the last
04:52line where I actually changed a line of code.
04:55I didn't just stop and select something, but actually edited part of the file.
05:00So, if I click that link, it takes me back to the login.cfm, which I was
05:04actually editing in the previous video.
05:07Those are the quickest ways to navigate around your documents inside of CFBuilder.
05:11To find additional keyboard shortcuts, spend some time in the General Keys preferences.
Collapse this transcript
6. Debugging Code
Getting set up
00:00One downside of working with Web applications is the general lack of
00:04line-based debugging tools.
00:05ColdFusion 8 introduced line debugging with the plug-in for CF Eclipse and the
00:09same debugging tool as part of ColdFusion Builder.
00:11In order to use debugging in CF Builder, you have to first enable the debugger
00:15inside of the ColdFusion server.
00:17To do that, we'll right-click on our server in the Servers view and
00:20choose Launch Admin Page.
00:22This will launch the ColdFusion Administrator and we'll log in and on the bottom
00:27left-hand side, click Debugging & Logging and Debugger Settings.
00:30Now, we only have a few options here.
00:32The first is to actually Allow Line Debugging.
00:35The second is the port that the debugger is going to run on and the last is how
00:39many simultaneous debugging sessions ColdFusion server should support.
00:43The thing to note here is to make sure that your debugger port is not already in
00:47use by another process or service on your system.
00:50If it is in use then the ColdFusion server will not start successfully.
00:54To find out if this port is in use, on the Mac, we'll go to a Terminal window or
00:58on Windows, open up a command prompt and type netstat.
01:03On Windows, you'll type -a or on the Mac, -anf inet.
01:10Press Enter and you'll see all the other ports that are currently in use on your system.
01:14If I scroll up here to the top, I can see the port 8500 is in use, my ColdFusion
01:19server is running on that port, but nowhere on this list do I see port 5005.
01:25So, in my case, the default port of 5005 is available.
01:28If you do see 5005 in use here, you'll need to choose another port 5006 or 5007
01:34as an example that is not in use.
01:36So, I'll go back to the ColdFusion Administrator and click Submit Changes and
01:40then I'll get the exact same warning that I just gave you, which is to make sure
01:43that your debugger port is not already in use.
01:46The next thing I need to do is to actually restart ColdFusion so that the
01:50debugger can become enabled.
01:51So, we'll close the Administrator and in Servers view, I'll right-click on my
01:55server and click Restart.
01:59After the server is restarted, I can go back to my Servers view.
02:03We'll go back into the ColdFusion Administrator and on my Debugger Settings page,
02:08I'll click Start Debugger Server.
02:10I'll now have the option to stop the debugger or to restart it if for whatever
02:14reason something isn't working properly.
02:16So, we're done inside the ColdFusion Administrator. I'll close that.
02:19The next thing we need to check is that our project is actually associated with
02:23the proper server to start debugging.
02:25So, I'll right-click on my project and choose Properties.
02:28Then in the ColdFusion Server Settings, I'll need to make sure that I specify my
02:32Local CF9 server so that it's associated with that project.
02:36Click OK and the last thing we need to do is set up a debug configuration.
02:40I'll click on the little arrow next to my bug in the toolbar and then choose
02:44debug configurations.
02:46Depending on the setup on your local machine, the CFCs displayed may differ
02:49from those shown here.
02:51Since I'm debugging a ColdFusion application, I'll select ColdFusion Application
02:55and click the New icon.
02:57This allows me to create a new launch configuration for my CF Builder project.
03:01So, I'll give it a name, CFBuilderDebugging.
03:06Make sure to use your own FTP information when setting up the connection.
03:09I'll click Apply and then Debug.
03:13This will then ask me if I want to switch to the Debug perspective. I'll click Yes.
03:19If you see a screen asking you to associate CFM and CFC files, check the box to
03:24make CF Builder the default application to open when a ColdFusion file is
03:28double-clicked. And it actually give me two different prompts.
03:31In this case, I'll say Remember my decision, so that the next time I open the
03:34debugger, it'll automatically switch me to the ColdFusion Debugging perspective. Click Yes again.
03:39Now that we have the debugger turned on, on the ColdFusion server, we've created
03:42a launch configuration in CF Builder and we're in the debugging perspective,
03:46we can now start debugging some ColdFusion code.
Collapse this transcript
Using the ColdFusion debugger
00:00Now that you have the debugger for ColdFusion enabled, it's time to start
00:03debugging some code in CF Builder.
00:06In the Chapter 6 folder, I'm going to switch back to my regular perspective so I can see it.
00:10I'll open up index.cfm.
00:14Here, I'm setting up an array and then just looping through a list of numbers
00:18and dividing the number 1 by each number and then pending the results to my array.
00:22If I preview this in my browser here, you'll see I just get an array with each
00:28of the results as a separate node in that array.
00:31If I switch back to the source code and set one of these nodes to be the number
00:360 and run my code again, end up getting a Division by zero error, but I can't
00:44actually tell which value in my list caused that problem.
00:47To figure out which node in my list is the culprit, I'm going to switch over to
00:51the ColdFusion Debugging perspective.
00:53In the ColdFusion Debugging perspective, I know that my error is happening on line 3.
00:58I know that because here in my Console I can see, it shows the Division by
01:03zero error on line 3.
01:06So, to find out what's happening on line 3, I'm going to create a breakpoint by
01:10double-clicking on the line number.
01:12You'll see it's added a small circle here to show me there's a breakpoint at
01:16that line and as I run the ColdFusion debugger, ColdFusion is going to stop on
01:20line 3 and tell me all of the values for every variable on my page at that point in time.
01:26So, to start the debugger, we'll choose Down arrow next to my little bug,
01:32choose Debug As > ColdFusion Application.
01:37My browser pops open and if I switch over to my browser, you can see that it's
01:42continually loading.
01:43CF Builder is using this browser session so that it can keep track of the
01:47variables and then in the Variables section, I can see the value in the Divisor
01:52and the value in my Results array.
01:54Now to continue process into the next line, I can click the Step Over button and
02:00as you can see, I have a little arrow here in my line number, so it shows me
02:03which line is getting processed.
02:06If I expand my Variables section, I can see that the divisor is still 8 but I
02:12now have an entry in my Results array.
02:15I'll step over again.
02:16I can see that the divisor is now 7.
02:20Step over again and now my Results array has two values in it.
02:26So, every time I click Step Over, it's jumping to the top of the loop then
02:30stopping on line 3 to tell me everything that's currently set at that point in time
02:34and then goes back to the loop.
02:37So, I'll click Step Over again, and now I'll fix and now my debugger has stopped
02:42working and if I look down here in my console, I can see that the request has
02:47exceeded the allowable time limit.
02:49Basically, I took too long to figure out what the problem was with my code.
02:53What I need to do now is to stop the debugger and I've terminated processing of
02:58that thread and I actually need to tell my page that I need a little bit more
03:02time to figure out what's going on.
03:04So, we'll use cfsetting and we'll set our requesttimeout to say 240 seconds.
03:11That should give me plenty of time to step to the code and figure out
03:13exactly what's happening.
03:15But this time, I want to be able to more easily see the value of the divisor as I go.
03:19So, I'm going to click on the Expressions view here and I can set up a watch
03:25expression that will allow me to see the value of a specific variable at any
03:28point in time without having to filter through my Variables list to find it.
03:33If I had 10, 15, 20 different variables defined on this page, it'll be hard to
03:37pick out the Divisor variable.
03:39So, I'm going to click my little Create new watch expression button and I just
03:44need to type in the name of the variable that I want to watch.
03:48I'll click OK and now I can see that variable set up in the Expressions list.
03:54So, I'm going to go back to the code editor and then we will debug
03:58our application again.
04:00My browser pops back up.
04:04It sends me back to CF Builder and now I can see that the value of the divisor is 8.
04:09If I click back on the Variables view, I can see the same thing I saw before.
04:15I'll step over 8, 7, now the math for the value 7 has been performed.
04:23We'll click on Expressions and we can see that the divisor is 7 there as well.
04:28Click Step Over again, go to the number 6, one more time and go to the number 0,
04:35Step Over once more and now I get my division by zero is not allowed.
04:40So, that allowed me to see the Divisor variable for every single loop that
04:44got processed, so I can finally find out which item in my list was causing the problem.
04:49So, now that I know what the issue is, I can take out the problem variable, save my file.
04:55I can remove my breakpoint.
04:58I'll run the code one more time.
05:00To do that, I need to first terminate the processing.
05:04So, you can't open one debugging session while another is up and running.
05:09Click in the Editor again and debug one more time, and we can see that the file
05:17processed correctly.
05:18So, as you can see, the ColdFusion Debugger gives you a lot more detailed view
05:23into what your code is doing as it's doing it, the Variables view will show
05:27you record sets and column names and column values, add breakpoints and step
05:32over lines as you go through the application to quickly find and correct
05:35missteps in your code.
Collapse this transcript
Watching logs with Tailview
00:01Sometimes the only way to really know what's going on with your application is
00:04to look at log files.
00:05Whether you're looking at the server logs or you own custom logs, this usually
00:09involves getting into the ColdFusion Administrator, browsing to a log file and
00:13then refreshing as you work to see what's going on.
00:15CF Builder includes the ability to watch a log file directly in IDE via the TailView.
00:21The TailView by default is in this bottom section along with your Servers and Console.
00:26If you don't see the TailView, just choose Window > Show View and locate the TailView.
00:32To start using the view, click on Add log and a browse dialog will open up and
00:38I'm going to go into my ColdFusion9 installation directory, which is under
00:42Applications, ColdFusion9.
00:44On Windows, this'll most likely be under your C-drive in ColdFusion9 and
00:48the logs directory.
00:49I can see my application log, my server log, exceptions, etcetera.
00:54I'm going to click the application.log file and click Open. And now I can now see
00:59everything in the application.log file.
01:01I can see all of my Division by zero errors from my ColdFusion debugging video.
01:05So, let's go ahead and open up this index.cfm file from Chapter 6.
01:09I'm going to add that 0 back into the file and let's cause an error.
01:14I'll save my file and then switch over to the Safari view and if you noticed,
01:19I now have a new entry down here that shows me my Division by zero error.
01:24So, as items get added to this log file they show up in TailView.
01:27Now I can add more than one log file.
01:31I'll click Add and let's add the exception log.
01:35Click Open and now I have the exception log sitting right next to
01:39my application log.
01:41Now I can also watch logs that aren't necessarily part of the ColdFusion server.
01:44The TailView will look at any .log file.
01:48So, if you need to keep an eye on a job application or some other item on your
01:51system that's writing out log files, such as IIS logs,
01:55you can also have the TailView watch those logs as well.
01:58When you're done looking at a particular log, you can either stop it so that
02:02CF Builder no longer watches that log file and then you can start it back up
02:05again when you need it.
02:07You can also forcibly reload the log file, clear the log file in the display, so
02:11if I don't want to see that content any more, I can click that button.
02:15It clears the entry in the TailView but leaves that data in the log file or I
02:20can actually remove the log file from my disk entirely.
02:23So, avoid hitting that one if you can and then I can remove that log tab.
02:28It's the same as clicking the little x here next to the name or I can remove all logs at once.
02:33So, let's do a little bit of custom logging.
02:35Let's go back over to our file here.
02:39I'm going to remove the 0 so that this will actually process all the way through
02:43and as we add items to my array, I'm going to log the fact that we did it.
02:48So, I'll choose cflog and we're going to log it to a file called MathLog.
02:53We're going to add some text, Dividing the number 1 by, and then we'll put
03:00our divisor in there and then we'll make this strictly informational and close my tag.
03:08So, I'll save my file and take look at it in the browser preview and then click
03:13Add log and in my logs directory, I can now see my MathLog.
03:18So, I'll click Open and now I can see each of those entries as it went through the loop.
03:24If I run this page again, you'll see I have another eight entries added to the log file.
03:29So, the TailView is an awesome way to get some visibility into your applications.
03:34Use the TailView along with the cflog tag, especially if you're using cfthread
03:38or some other asynchronous processing to see exactly what's going on in your
03:42application as it's happening.
Collapse this transcript
7. Using ColdFusion Builder Extensions
Installing extensions
00:00CF Builder gives you the ability to extend the functionality of the IDE
00:04through extensions.
00:06CF Builder extensions boost your productivity by giving you the full power of the
00:09ColdFusion Server directly in the IDE, but before you can start to experience
00:13all this newfound power, let's see how you install an extension in CFBuilder.
00:18The first thing we are going to do is take a look at the ColdFusion
00:20Builder Preferences.
00:22In the filter here at the top, type extensions and choose Extensions under
00:27the ColdFusion section.
00:28Make sure that the /use Mozilla browser for extensions is checked.
00:32Some extensions, especially those that use Flash forms or other advanced
00:35functionality inside of their dialogs, will not function correctly if you are
00:40not using the Mozilla browser.
00:41So, once you have that box checked, click OK and we can start installing.
00:45The Extensions view normally sits down here at the bottom with your Server and Console views.
00:50If it's not available, choose Window > Show View and select Extensions.
00:54Down here in the menu, we are going to choose the Install extension from archive
00:58file, the little plus icon.
01:00If you have your Start page open, you can also click Install Extensions
01:03directly from here.
01:04You will need to find your ColdFusion Builder installation directory.
01:08So, I will go to my Applications folder and then Adobe ColdFusion Builder, but
01:13if you are on Windows, it's most likely under your Program Files directory, and
01:16then choose extensions.
01:18CFBuilder ships with four different extensions.
01:21The first extension is an ActionScript Class Generator, if you are working with Flex.
01:25We also have a CFC Generator, an ExtensionBuilder extension, which we will cover
01:29in the next chapter, and a modelGlueAssistant.
01:33Let's first install the CFC Generator.
01:35So, I will select that zip file and click Open.
01:37The Installation Wizard gives me a few details about the extension, such as
01:41who wrote it, an e-mail address, if they provided it, and the Version of the extension.
01:45I will then have a description that should tell me exactly what this is going to
01:48do and hopefully how to access it. Click Next.
01:52On the Install Settings dialog, we are going to choose the server that we want
01:55to install this extension to.
01:57Because CF Builder extensions use ColdFusion code to perform most of their work,
02:02you need to make sure that you have a ColdFusion Server set up, running, and
02:05available, in order to install them.
02:07So, I will choose my server, and it will automatically complete my
02:10webroot dialog here.
02:12I just need to choose where on my server I am going to install it.
02:16So, I will click Browse, and it drops me right into my wwwroot folder, and I am
02:21going to create a new folder to house all of my extensions.
02:24So, we will call this CFBExtensions, click Create, and then Choose.
02:30So, I will verify that my folder is listed in the install location dialog and click Next.
02:36Here is just an installation summary that shows me the type of installation it's doing,
02:40the extensions it's going to install, and where it's going to install it.
02:43I will click Finish, and then click OK in the Installation successful dialog.
02:48I will go over to my project and refresh the project.
02:54I can now see my extension sitting right there.
02:57If I go down to my Extensions view, I will refresh this as well, and I can see
03:03my extension installed right here.
03:05If I select it, I see my description.
03:07If necessary, I can click the Delete button here or rather the Uninstall button,
03:12and I can either uninstall the extension from just CF Builder and leave the files
03:17on the server, or I can completely uninstall them and it will remove the
03:20extension files from my ColdFusion server.
03:23For now, I am going to click Cancel and I am going to install the
03:27ExtensionBuilder extension.
03:28I will select the ExtensionBuilder zip file and click Open.
03:33Then back in the Installation Wizard, I will click Next, choose my server,
03:38select my install location, which is my CFBExtensions folder, and then just click Finish.
03:44I will click OK.
03:47I can now see my extension here in the dialog.
03:49If I refresh the CFBExtensions folder, I can see the ExtensionBuilder is
03:54now installed as well.
03:55That's all there is to installing an extension.
03:58Just remember that you must have access to a ColdFusion server in order for the
04:01extensions to install and function correctly.
Collapse this transcript
Using the CFC Generator extension for ColdFusion 8
00:00CFCs are powerful, but they can sometimes be mighty boring to build.
00:04Developing services and writing value objects usually consists of a bunch of
00:08repetitive and potentially error-prone code.
00:11ColdFusion 9's ORM capabilities can help with all that, but we are not all on
00:14ColdFusion 9 yet, and some applications just aren't set up to support ORM-based objects.
00:19Luckily, ColdFusion Builder can take care of some of the grunt work with
00:23creating CFCs to connect to databases in our ColdFusion 8 based applications.
00:27So, in the last video, we installed the CFC Generator and here I am going to
00:30show you how to use it.
00:32In the RDS Data view, I am going to expand my local server and the
00:35cfartgallery data source.
00:37I will expand the tables and I am going to create a batch of CFCs for my ARTISTS table.
00:43If I right-click on the table, at the bottom you can see Adobe CFC Generator,
00:47and we are going to select Create CFC.
00:50This opens up the Adobe CFC Generator dialog, which just has three options.
00:54The first is where I want my CFCs to go.
00:56The second is whether I want it to generate a Service CFC, along with the value objects.
01:01And the third is whether I want it to do a ColdFusion 9 CFScript-based CFC or if
01:06I want to stick with standard tags.
01:08So, click Browse and we will choose exactly where we want our CFCs to go.
01:13I am going to put them directly in my Chapter 7 folder. Click OK.
01:17Click OK again.
01:18The CFBuilder is passing control off to the ColdFusion server.
01:23It's going to take a look at my table and then build all of these CFCs.
01:28I now have an ARTISTS CFC value object.
01:30I have a Data Access object, a Gateway object, and a Service.
01:34I am going to go ahead and open up the Service and we will take a quick look at
01:37everything that the extension did for us.
01:39If I switch to the Outline view and scroll down the list here, I can see it has
01:43created a count function, createARTISTS, deleteARTISTS, getARTISTS,
01:50getARTISTS_page, where I can actually pass in my startIndex and the number of
01:54items I want it to return.
01:55It has generated a lot of code inside just this one CFC.
02:00I have got 117 lines of ColdFusion that I didn't have to write.
02:04If I open up the Gateway, I can see I have getALL, getALL_page.
02:10I have the same type of methods that my Service had.
02:13So, let's go ahead and make sure that these actually work.
02:15If I open up my index.cfm, let's output the result of one of these CFCs.
02:21Let's dump the getALL method from our Gateway.
02:24So, I will run CreateObject ("component", ArtistsGateway").getALL method.
02:35I will save my file, switch to the browser preview, and here we can see that the
02:41getALL method returned us an array of individual artist objects.
02:45That's all it took to generate all that code.
02:47Just a single right-click and clicking Finish.
02:50So, because that was so quick, I am going to take a little bit of time and
02:53show you how you can adjust this code if you don't like the way that it's being generated.
02:58So, for example, in the ARTISTSGateway, maybe I don't like the way it's running
03:02the set methods or maybe I want an additional method added to the CFC.
03:06If you go to the Adobe CFC Generator folder, go to the handlers directory > com >
03:13adobe > cfbuilder, you will see there's a templates directory.
03:17If I expand the templates directory, I can see I have templates for the
03:21standard crud methods, which we just used, and the ORM CFCs, which I will show
03:25you in the next video.
03:26If I expand the crud folder, I will scroll over a little bit here.
03:31We can see cfm files for generating the dao, the gateway, a script-based
03:35DAO, the script-based Gateway, and then my value objects.
03:39So, if I open up the gateway.cfm file -- and I will scroll down a little bit here --
03:43you can see a whole bunch of code that determines how the init method is
03:47formatted, how the getALL method is formatted.
03:50You can see some fancy stuff around looping over table names and columns,
03:54and you can take this file, change it however you please, save it, and rerun the extension.
03:59It will generate the code just as you would like it to be generated.
04:02So, if we wanted to change the name of the getALL method, I can change that
04:06to say getALLObjects.
04:08I will save this CFM file, go back to my RDS view, and let's create some CFCs
04:15for the Media table.
04:16I will Run Create CFC, choose my destination.
04:21We are going to stick this in the same Chapter 7 folder, click OK, OK again.
04:25If I scroll over here, go back down to our Chapter 7 folder, and here I can
04:31see my MEDIAGateway.
04:32I will open that up, and now my getALL method is get ALLObjects.
04:37So, my suggestion to you would be to run the CFC Generator, go through the code,
04:40find out what you don't like.
04:42For example, single quotes instead of double quotes.
04:45Change what you would like to be different, save the files, and now the
04:48extension will work exactly the way you would like it to.
Collapse this transcript
Using the CFC Generator extension for ColdFusion ORM
00:00ColdFusion 9's ORM features make it less necessary to spend your days building
00:04simple value objects and crud methods, but you still have to spend time typing
00:08out repetitive code and dealing with object relationships.
00:12Luckily, ColdFusion Builder helps with this as well by providing a feature rich
00:15way to build ORM CFCs without writing a line of code.
00:18So, we are going to return to our ARTISTS and ART tables and build some ORM CFCs.
00:25First off, I am going to delete the ARTISTS files we generated in our last
00:29video, so we can start over with the ORM way of doing things.
00:33In my RDS Data view, I am going to select both the ART and the ARTISTS tables.
00:38Then I will right-click, choose Adobe CFC Generator > Create ORM CFC.
00:44Now, the first dialog is pretty simple.
00:47We are just going to choose where we want the CFCs to be generated.
00:50We will stick these in our Chapter 7 folder and click OK.
00:54Then the next screen may take a bit to come up, because it's using all sorts of
00:59Flash forms in ColdFusion 9.
01:01So, as we can see, here on the left we have our two tables that I selected, and
01:05on the right-hand side, we have all of the columns for the ART tables.
01:09If I select ARTISTS, we will see all of the columns for the ARTISTS table.
01:14I can check these boxes to determine which columns I want to actually be in my CFC.
01:19So, what we are going to do is build relationships in between the ART and the ARTISTS table.
01:23So, I will click on the ART table, and here in the Relationships section, I will click insert.
01:28Now I am going to relate the ART table to ARTISTS.
01:34I will give it a name and specify my target table, which is ARTISTS, and
01:39choose the Multiplicity.
01:40What this means is I am going to choose whether or not there is one piece of
01:44art to one artist, one piece of art to multiple artists, multiple pieces of art
01:49to a single artist, or whether multiple artists can work on the same piece of artwork.
01:54So, I am going to choose multiple pieces of art to one artist, the n-1 relationship.
01:59Now, I don't need to choose a Link table, because this is a one-to-one
02:02relationship in between the two tables.
02:04It's not a many-to-many relationship where I need a intermediary link table.
02:08Once I have this relationship defined, I will click Save, select it again, and
02:13then I can choose the join conditions.
02:15I need to choose the columns that relate these two tables together.
02:18I will scroll down a bit and click insert.
02:21Then I need to choose my source field, which in this case, in the ART table is
02:25the ARTISTID, and then the target field.
02:28In the ARTISTS table, that's also ARTISTID, and click Save.
02:33Now I will do the same thing for ARTISTS.
02:35I will click insert, choose my relationship name, which will be ART.
02:41Choose my target table, also ART.
02:43And the Multiplicity.
02:45One artist can have multiple pieces of artworks, so it's a 1-n relationship.
02:49Click Save, select the relationship, and we will insert a join condition.
02:55My source field is going to be ARTISTID.
02:58My target field is also going to be ARTISTID. Click Save.
03:02If I scroll down to the bottom, we can click Generate Code.
03:06So, it says the code has successfully been generated.
03:10I will click Close.
03:11Go back to my Chapter 7 folder and refresh.
03:15Here, I can see its created an ART, ARTISTS, ARTISTSService, and ARTService.
03:20If I open these up, you will notice in the ART.cfc, at the bottom here it has
03:26my ARTISTS property.
03:27That shows a many-to-one relationship with the ARTISTS.cfc and specifies my
03:32foreign key columns.
03:33In my ARTISTSService, I also have methods for creating new artists, deleting
03:39artists, getting all artists, a paging method, basically everything we had in
03:44the standard CFCs, but using all of the ColdFusion 9 ORM functionality to make it work.
03:49So, just like the generated code from the previous video, you can edit the
03:53handler that outputs the ORM CFCs' code to suit your needs.
03:57As with this or any extension that generates code, always remember that if
04:01you are not happy with the output of the extension, it's worth the time to
04:05dig through the handler's directory and get everything customized to suit
04:08your specific needs.
Collapse this transcript
8. Extending ColdFusion Builder
Building a simple contact form extension
00:00Before we get really started in this chapter, let's take a minute to go over
00:03exactly what we're going to be building.
00:05We're going to build a simple contact form extension that will create a contact
00:09form page where the details of the form can be e-mailed to us.
00:12I'm going to show you the extension first and then we'll spend the rest of the
00:15chapter building it.
00:16You'll find the extension under the Chapter 8 folder.
00:19It's called SimpleContactForm.zip.
00:22So, we'll install this extension.
00:24I'll just click the plus icon here in the Extensions view.
00:27I already have my Chapter 8 folder selected so I'll pick that zip file, click
00:32Open and here we can say it creates a simple contact form.
00:35I can right-click anywhere in my Project view to install it. Click Next again.
00:41There is my license.
00:42I'll accept the license agreement.
00:43Then I'll choose my server.
00:46All these steps were the same as when we went through using an extension in
00:50the previous chapter.
00:53Next once more and then Finish.
00:55Extension was successfully installed so I'll click OK.
00:58And now I'll show you how to use the extension.
01:00I can right-click anywhere in here.
01:02I'll choose Dan Short and Simple Contact Form, and all I need to do is specify
01:08the name of a file that I want to save and then where I want this form
01:13contents to be e-mailed to.
01:15So, I'll click Browse and I see the list of my projects and I can choose where
01:20I want my file to go.
01:21I'll click OK and I then have some validation here.
01:25I can see the fileName cannot be empty, so I'll go around here and pick a file name.
01:32I can also ensure that it's a valid file name.
01:34If you notice, I'll not fill it out completely.
01:36Then I need to provide an e-mail.
01:41Here, we can see now that I've gone to the e-mail field then actually put in some data.
01:45There is some additional validation that's been run on the filename.
01:48The filename must have a valid .cfm file.
01:51So, I guess I have to add a .cfm there.
01:54Now that the form is complete, the OK button is enabled, so I'll click OK.
02:01I then get a dialog that says A new file has been written.
02:03I'll click Close, and now I can see that file here in my Project View.
02:08If I open that up, we can see it's just checking to make sure that a form
02:13has been submitted.
02:14It's doing some simple validation and then running a cfmail tag,
02:18but you can see that it's being sent to dan@sitedriveinc.com, the exact same
02:23e-mail address that I provided in my dialog.
02:25So, basically, what we're going to do is, if you take a look at the Begin
02:28folder, we're going to take this formTemplate.cfm.
02:32Let's go ahead and open that up.
02:34And we have a number of placeholders here.
02:37You'll notice I have two brackets and then the string mailTo.
02:40I have two brackets in mailSubject.
02:44I'm basically going to take all of the input that's provided to me through the
02:47extension dialog and I'll loop through each of those values that get sent and do a
02:52replace inside of my formTemplate.
02:54So, if I scroll over here you can see I also have data for the mailServer,
02:58the username, the password.
03:00All of the details that I asked for in that form are going to be replaced
03:06where these brackets are.
03:08And if I go and take a look at the extension itself, I need to refresh this to
03:11get it to show those new files that got added.
03:16You'll see I have an ide_config file just like our previous extensions we've looked at.
03:20Then in the handlers directory, I have a formTemplate.cfm and a single index.cfm.
03:26This index.cfm is going to be my handler, which we're going to cover later in this chapter.
03:31So, that's our project for this chapter.
03:33We're going to build our extension UI and then we're going to use all of
03:36the data provided through that UI to do some simple replacements inside of
03:40our formTemplate.
Collapse this transcript
Creating user interfaces
00:00The user interface for ColdFusion Builder extensions is defined in an
00:04ide_config.xml file.
00:06This file not only generates the UI for your extension but also tells CF Builder
00:11what to do once you've completed the dialog.
00:13So, we're going to start by actually building our ide_config.xml file.
00:18To do that, I have a starter one here in the Begin folder.
00:22So, let's create a new folder for our extension to get started.
00:25So, we'll choose New and Folder, and we'll call this Ch8Test.
00:31Click Finish and then I'm going to copy both of these files, both my
00:35formTemplate and my ide_config.
00:37I'm going to paste those in the Chapter 8 Test folder.
00:40That way we can keep these nice and clean.
00:43So, let's open ide_ config and go over the basics.
00:46So, you can see it's fairly small and straightforward.
00:49The entire thing is wrapped in one application tag and at the top, we have all
00:54of the information that's defined during the install process for the extension.
00:59So, we'd given the name of the extension, who wrote it, the version,
01:02the description and some license information.
01:04So, let's go ahead and fill this one out.
01:06We'll call this one Simple Contact Form Test, author, we'll put down as lynda.com Viewer.
01:16For a version let's call this Beta 1 just to be fancy, and then we'll give it a description.
01:23This installs a simple contact form wherever you choose.
01:33Right-click in the Project View to add the contact form.
01:38All right! Then we'll provide a license, say 'This stuff is free,' and then we get to decide
01:46where we want our menus to show up.
01:49So, under here we have menucontributions.
01:52You can add multiple contributions inside here and this basically tells
01:56CF Builder where you're going to create these right-click menus and you have four choices.
02:01You can choose the Project View, which is what we're going to use.
02:04You can choose the RDS View.
02:06So, if you're over here in the RDS View and you right-click something.
02:10For example, our CFC Generator, if I have a table selected here and I right-click.
02:16I can see the Adobe CFC Generators.
02:18So, this is using the RDS view contribution target.
02:22The Outline View would allow me to right-click in the Outline here and have a
02:26right-click menu to perform an action.
02:29And we have Editor, so if I right- click inside the editor, I can add
02:32a right-click menu.
02:33So, for now we're going to choose Project View.
02:36So, I'm just going to get rid of these and then we have our menu tag, which
02:40determines what the main menu item is going to be.
02:43So, when I right-click, what is that first menu item the user is going to see?
02:47In this case, let's call it lynda.com Viewer.
02:52Then underneath that we determine what the action is going to be.
02:56So, I can add multiple distinct actions underneath one menu item.
03:00So, for our action we are going to name it Simple Contact Form.
03:06The next thing we have to do is tell it which handler we wanted to fire when we
03:09perform this action.
03:11Now down here at the bottom on line 23, you can see where we define all of our
03:15handlers and you'll reference these by id.
03:18You notice my attribute here is handlerid.
03:20Here, I have a handler tag with an id.
03:24So, let's call this buildContactForm.
03:29Let me shrink these panels over here so we can see everything.
03:33The last attribute I have is showResponse.
03:35I'll set showResponse true because I want my extension to show the users some
03:40feedback when it's all finished.
03:42My handler is going to determine what that response is, but if I set
03:46showResponse to false, it will fire the handler and then the extension will just
03:50disappear and the user doesn't get any feedback.
03:53So, since we have our handlerid set to buildContactForm I'm going to copy that
03:58and paste it down here.
03:59There I can make sure I have all my casing correct.
04:04Now our handler type is going to be CFM, as are all ColdFusion Builder extensions,
04:09and then I tell it which filename I wanted to run when this handler is executed.
04:14In this case, we'll just call it index.cfm.
04:17Now we'll go back up to our action tag and beneath that you'll see I have a
04:22dialog tag and a height and width for that dialog.
04:26Inside here, I'm going to place input tags that determine what inputs I want
04:30to show to the user.
04:33Now these are very, very similar to HTML inputs, but we do have some different
04:37attributes for the input tags and an extension that you don't have in HTML.
04:42So, let's start adding one of these.
04:44The first input I want is a file location, a directory that I want to place my new file in.
04:49So, I'm going to add an input tag.
04:52I'm going to give it a name.
04:54We'll call this fileLocation.
04:55Then I can actually specify a default value for this field.
04:59I'm going to leave it blank because I don't want any value in here.
05:03Then I'm going to provide a label.
05:04The label is what will go to the left of the input in the dialog.
05:08So, in this case we're going to say 'Save file to.'
05:12Then I can provide a tooltip, which actually displays at the top of my
05:16dialog, that gives the user some information about what they are supposed to
05:19do inside of this field.
05:22So, in this case we're going to add a tooltip that says, 'The directory to save
05:27the contact form into.'
05:30Then I'm going to specify a type.
05:33Now I have some different types as well.
05:35In this case, the type I'm going to use is project directory.
05:39What this is going to give me is a dialog that lists all of my current projects
05:44and I can dig through there and find a directory inside a project that's already
05:49defined in my Navigator.
05:51Now I could also specify a type as just plain old directory.
05:55That's going to allow me to browse my entire hard drive.
05:58Other valid types are string, boolean, file, which would allow me to select
06:03any file on my hard drive, password, list, where I could actually define a
06:08list of appropriate values, and project file, which would allow me to choose a
06:14file in a predefined project.
06:17Now I don't expect you to remember all those and we don't have them typed out here.
06:21So, if you choose Help and ColdFusion Builder Help, it'll bring up the Adobe
06:26Community AIR Help system and you can find all of this information inside of the
06:30Community Help AIR client.
06:32So, let's go back and finish up our UI here.
06:36So, I'm going to change that back to project directory.
06:39Then I'm going to say that this value is required, true, and close my tag.
06:45So, I know that's a lot to take in, but the key thing to remember is that you
06:49need to provide a label, a tooltip to help out the user, a type and you can find
06:54all those types in the Adobe Community Help and then a required attribute.
06:58But there's even more we can do here.
07:00I'm going to add one more and we'll call this fileName and if you recall when we
07:06walked through the UI, I actually had some validation that made sure that a
07:10proper filename was typed in.
07:12So, the way we do that - I'm going to go ahead and add my default and my label,
07:17The name of the new file.
07:18We're going to specify a type as string.
07:22We'll say required is true, and then I'm going to add a pattern attribute.
07:28And with the pattern, I can actually provide a regular expression that will
07:31validate the input of that field to make sure that it matches what I want them to put in.
07:36So, in this case I'm going to use a regular expression that requires they
07:40enter a CFM filename.
07:43So, there's my regular expression.
07:45And then I can provide a custom error message.
07:48So, we'll say errormessage equals= "The file name must be a valid .cfm file."
07:54Now I've created a required field that also must match a specific pattern.
07:59So, as you see we can do a lot more with ide_config inputs than we can with
08:06regular old HTML inputs, at least without writing a bunch of custom JavaScript
08:11to do our validation for us.
08:12So, I'm going to make things a little bit easier to finish this off. In my Snippets here,
08:17I have some additional inputs I'm going to add.
08:23So, all I've done is inserted input tags for the mailServer, Username, Password,
08:31Subject and the e-mail address that all the content is going to be sent to.
08:35As you can see, for the mailTo I've also made that required.
08:39And that's how you build out your UI for the extension.
08:43Now I've realized at this point that you haven't actually seen anything.
08:46So, in the next video we're going to cover packaging your extension so that we
08:51can actually see it in ColdFusion Builder and start debugging.
Collapse this transcript
Packaging the extension
00:00Now that you have the basics of your extension dialog built, it's time to
00:03actually install and test your extension.
00:05I know this may seem like a bit of a chicken and egg kind of problem, "why would
00:08I install my Extension before I am doing building it," but there's no good way to
00:12debug a CFBuilder extension without actually packaging and installing it, so you
00:17can actually run the UI.
00:18The nice thing is that once you have installed the extension, you can tweak it
00:21and rerun it over and over again, until you have things right.
00:24So, to package an extension, it's as easy as creating a zip file.
00:27What we are going to do in our Ch8Test folder is to create a new folder
00:32here called handlers.
00:37If you recall in our ide_config.xml file, we specified a handler here called index.cfm.
00:45CFBuilder extensions will always look for this file inside of the
00:48handlers directory.
00:49So, everything besides your ide_ config file should go inside of the
00:53handlers directory.
00:54So, I am going to drag the formTemplate .cfm inside of here, and then we will
00:59create a new file called index.cfm, so that we have our handler ready to go when
01:06we actually start building out our ColdFusion code.
01:08So, now to package our extension, it's as simple as creating a zip file.
01:12I will switch over to Finder, and I am in my ColdFusion webroot, and here we
01:18see my Ch8Test folder.
01:19I will just select the handlers directory and the ide_config file, right-click,
01:24and choose Compress.
01:25If you are not on Leopard or Snow Leopard on the Mac, you will need to use
01:29something like StuffIt to create your zip file, or if you are on Windows,
01:32the built-in Windows zipping functionality or WinZip will work just as well.
01:36But select the ide_config file and your handlers directory and compress those
01:40two items into your zip file.
01:42And I will just rename this Ch8TestExtension.
01:46You can name the zip file whatever you want.
01:48It has no bearing on the name of the extension once its actually installed into CFBuilder.
01:53So, now we will go back to CFBuilder, and in the Extensions view, we will click
01:59plus, find our test extension we just created. Click Open.
02:07Here, we can see the description.
02:08We are doing a Beta 1 version of our extension.
02:12Click Next, accept the terms of the license agreement. Choose our server.
02:20Browse to where we want it installed, and click Finish.
02:28Once the installation is successful, I will afresh my CFBExtensions folder over
02:32here, and here's our Simple Contact Form Test.
02:38So, now, instead of this index file and ide_config in my Chapter 8 folder, I am
02:43going to open the two files here and start editing them.
02:47So, let's run the extension and make sure everything is working correctly.
02:51If I right-click in my project, you notice here's my menu that I added to the
02:55lynda.com Viewer menu and here's the name of my action, Simple Contact Form. I will run that.
03:02Here's the UI that we created.
03:04If I cancel this dialog, and we will go back over to our ide_config file, in my
03:09ide_config, I am going to change the label of the Mail Server to say Mail Server Address.
03:14I will Save my file.
03:16Then because I have changed the ide_ config file and not a ColdFusion file
03:20that's executed on the server,
03:22I need to go down here in the Extensions view.
03:24I will click Reload all Extensions.
03:27What this does is forces CFBuilder to go back and reread all the
03:31ide_config.xml files.
03:33Now, I will go run my extension again.
03:37We can see the label has changed for the Mail Server Address.
03:41Now that you know how easy it is to package and get your extension running,
03:45I would encourage you to package and start testing sooner rather than later.
03:49Since we now have the UI for our extension complete, it's time to start
03:53building the handler.
Collapse this transcript
Building the handler
00:00Extensions use handlers or regular old ColdFusion pages to accept the user's
00:05input and do all the necessary processing for the extension.
00:08The user inputs are sent as a form field, which contains a block of XML.
00:12So, it takes a small bit of processing to make the data usable in
00:15your ColdFusion pages.
00:16Let's start by building our handler to dump exactly what's sent to the
00:20extension, so we know what we are dealing with.
00:22So, in our handlers directory, we will open up the index.cfm file.
00:26At the top, I am just going to dump out the entire form scope.
00:29Now, one thing you also need to do inside of your handlers is to make sure that
00:34debug output is turned off.
00:35If you are using debugging output on your local development machine, all of
00:39the JavaScript and extra CSS that get sent to the extension will mess up the display.
00:44So, you need to make sure that at the top of every extension, you have your
00:48showdebugoutput set to false.
00:51Now that we have that done, let's run our extension.
00:54So, I am just going to fill out the bare minimum of fields here so we can get
01:00on to the next portion.
01:01We will choose where to save the file to, the name of our file, and our e-mail address.
01:07We will click OK, and here we can see the XML that gets sent to the handler.
01:15At the root, we have an event tag, which also has an IDE tag, and then a View tag
01:20depending on the type of contribution that we set up in our ide_config.
01:25The View tag will give you the project name and the location for the project,
01:29where the user right- clicked to execute the extension.
01:32The Resource tag inside that will tell you exactly which file or folder they
01:36clicked on to execute the extension.
01:38So, if you need to take a particular action on the folder they selected,
01:42you will be able to grab that from the path attribute of the Resource tag.
01:46After the closing IDE tag, you then have a User tag, which contains all of the
01:51inputs that the user filled out and their values.
01:54This is what we are going to need to use for this extension in order to
01:57determine what replacements we need to make.
01:59So, let's start working with the XML to pull out just the pieces that we need.
02:03So, I will close the extension.
02:06So, in my handler, I am going to start by pulling out all of the user inputs.
02:10So, I am going to parse the IDEEVENTINFO field into an XML object and then use
02:15the XMLSearch function to pull out all of the input tags in the user node.
02:19This is going to give me an array of inputs.
02:22So, I am going to take my dump here, move it down, and then let's dump out
02:28exactly what the userInputs is returning.
02:30I will save my handler and we will execute our extension once more.
02:36Fill out the bare minimum of fields.
02:43Click OK.
02:44It will execute my ColdFusion code, and here we can see my array.
02:48So, inside each array node, I have an input that has a name and a value.
02:52mailPassword is blank, but as you can see here, my fileLocation is not blank.
03:00My fileName is test.cfm and my mailTo has my e-mail address.
03:04So, we will close that and we can go on to the next portion, which is to create
03:08a usable structure of fields.
03:11So, an array isn't easy to reference via names.
03:14So, if I wanted to get just the file location, I have to loop through my array
03:18and figure out which array node has it and then pull out the value and go
03:21through a bunch of rigamarole to find exactly what I want to use.
03:25So, these next few lines of code is going to loop through our array, userInputs,
03:31and it's going to create a userData structure with the name and value.
03:36I will make this a little bit bigger, here we go. With the name and value of
03:42each of the userInputs.
03:44So, this is going to give me something on the lines of userData.filename.
03:48So, let's move our dump once more and take a look at that.
03:52Unfortunately, part of building extensions is going to be lots of dumping of
03:58variables and rerunning of extensions, in order to make sure that you have
04:02exactly what you need.
04:04So, we will fill out our dialog again.
04:09You will get really good at this part.
04:14Now we have a nice structure that has our fileLocation, our fileName, and our mailTo.
04:22So, these few lines of code, from Line 2 to Line 10, will allow you to take all
04:27of the inputs and convert them into a usable structure that you can then
04:31reference through the rest of your handler code.
04:33You can take that eight lines of code and reuse it in any extension you build,
04:37in order to easily get to the user input data.
04:40So, the next block of code isn't exactly extension-specific, but it is going to
04:44take care of all the replacements that we need in our formTemplate.
04:48So, here, I will make my file a little bit bigger.
04:51We are going to actually read in our formTemplate and take note of the fact
04:57that I am using the ExpandPath function, because I don't actually know where my
05:02formTemplate is going to exist when the user installs this extension.
05:06They can put it anywhere on their hard drive or on a remote server and I have no
05:10idea where that file is actually going to live.
05:13So, when you are building your extensions, make sure that you make them flexible
05:16enough that the files they are referencing can live anywhere.
05:19So, once I have written my formTemplate .cfm, I am just going to loop over my
05:24userInputs array, and for each item in that array, I am going to replace the
05:29field name, for example, the Mail Server, mailTo, and Subject, and replace them
05:34with their appropriate value.
05:36Then after we are all done doing the replacements, we will actually write
05:39out the file to the fileLocation the user specified, and the fileName that they typed in.
05:47We are just going to use the formTemplate as the output for that file.
05:53So, we have one last thing to do, which is to show the user a response and let
05:57them know that everything was successful.
05:58So, now I will insert my last snippet.
06:04This bit of ColdFusion code determines that the output for this file is going to
06:08be of an XML MIME type, and inside of my cfoutput tags, I have a response tag,
06:14an ide tag, and a dialog.
06:17So, what this does is tells ColdFusion Builder that I want to show a dialog
06:21that's 500 pixels wide by 300 pixels tall and I want this to be the content of that dialog.
06:28So, all I am telling the user is that a new file has been written to and I am
06:31giving them back the fileLocation and the fileName, so that they know exactly
06:36where that file got written to.
06:37So, the last thing I will do is get rid of my cfdump tag.
06:41We will save my CFM file, and we will go back and run this extension one more time.
06:47So, this time I am going to complete the entire UI.
06:54We will put our file inside of the Chapter 8 folder.
06:59We will name it contact.cfm.
07:03We will give it a server address, mymailserver.com.
07:08Give it a username of dan, and a password of password.
07:13We will say it's the 'Contact Form Results' for the subject, and where we want
07:18it to be e-mailed to. Click OK.
07:24Here's our UI that we wrote.
07:25A new file has been written to and it gives me the exact location for that file. Click Close.
07:30Go to the Chapter 8 folder.
07:33We will open up our contact.cfm.
07:35As we can see, here in the cfmail tag, there is the e-mail address, the subject,
07:42the server, my username, and my password. That's it.
07:46You have now built an extension UI and hooked it directly to a
07:49ColdFusion handler.
07:50Now you just need to take these files and repackage them in a zip and you are ready to go.
07:55You can now venture out into the wild to build your own extensions.
07:58You can also find a collection of ColdFusion extensions at www.riaforge.org by
08:03clicking on ColdFusion Builder Extensions.
08:06That way, you don't have to build something that someone else has already built for you.
Collapse this transcript
Using the Builder extension
00:00We're going to use an extension to build an extension? You've got it.
00:04We're going to use the Extension Builder extension, which ships with CFBuilder,
00:08to do all the dirty work in building out our ide_config.xml file.
00:12Now if you haven't already watched the rest of the videos in this chapter, be
00:16sure to go back and watch them all, so that you understand how all the moving
00:19parts fit together before you try and take the easy way out.
00:22With that being said, let's start learning how to use the Extension Builder.
00:26So, you can right-click anywhere in your project, choose Adobe Extension Builder and New.
00:34The first page of the Extension Builder just asks where you want your new
00:38extension to be placed.
00:39By default, it's going to specify the folder that you right-clicked on, and then
00:43we can choose to create a folder with the extension name.
00:46If you uncheck this box, CFBuilder is going to place all of your extension files
00:51in the Chapter 8 folder, which is not what we want, since we have a bunch of
00:55other stuff in there already.
00:56So, we're going to leave this box checked, and after we give our extension a name,
01:00CFBuilder will create the folder for us.
01:03Now that the easy part is done, we'll click OK.
01:07Now we need to configure everything about the extension.
01:10As we go through each of the tabs, you'll need to make sure you click Save in
01:13all the right spots, so your data is maintained for when you finally click
01:17Finish and generate the extension.
01:19So, let's go through each of the tabs.
01:21The first one is all of our extension details, basically what the user sees
01:25when they install the extension.
01:26So, let's just call this Test Extension.
01:29We're going to specify our author and the version, as well as an E-mail address,
01:36our description, and our license.
01:42Once we have all that complete, click Save.
01:44Then we can go on to the next tab.
01:47The next one specifies all of our menu contributions.
01:50Basically, what we want to display when a user right-clicks in any of
01:54the appropriate spots.
01:55So, I click Add menu, and I just need to fill out my details for that main flyout menu.
02:02If you recall in our previous videos, this is what's going to display in the
02:06Name attribute of the menu tag.
02:07So, we'll call this Test menu, and specify our target.
02:12You can see we have rdsview, projectview, outlineview, and editor.
02:16I'm going to stick with projectview, which we used in the Creating
02:20User Interfaces video.
02:21Once I have that saved, I can click on Action and start creating our Action tags.
02:26The Name attribute is going to be that secondary flyout on our menu.
02:31So, in this case, let's just call it Test Action, and if I had previously
02:34defined any handlers, I would see them listed here in this list, but I need to
02:38create a new handler Id, since I haven't yet defined any.
02:41Call this testHandler. For our handler file,
02:45we'll just name it testHandler.cfm.
02:48I can then define if I want that handler to show a response, and how big I want
02:52the dialog to be for this particular handler.
02:55For our title, let's call it Test Action Inputs.
02:59And then we'll specify a dialog height and width.
03:02Let's make it 600 wide and 400 tall.
03:05I can then specify a close handler file, which is a ColdFusion file that will be
03:09run if the user closes the dialog without actually clicking OK or Finish.
03:14When I have that action complete, I can click Save and then start adding my inputs.
03:19I'll click Add Input, and I can specify all of the attributes for our Input tag.
03:24Let's create an input for an E-mailAddress, no spaces or special characters, and then a Label.
03:31I can specify a tooltip, and I have a handy list of all the valid types for our inputs.
03:37For this one, we'll leave it as a string.
03:39And then I can specify defaults.
03:42I can either hardcode a default here, or I have a handy list of system variables
03:47that can be used as a default.
03:49For example, the project name that they clicked on, the project location, the
03:53server home, or even the wwwroot for the ColdFusion server that's associated with this project.
04:00The rest of the dialog allows me to add some validation, such as the Pattern,
04:03Error Message, Help Message, for Boolean values, whether this box is checked by
04:08default, and whether it's required.
04:12I'll click Save and Done.
04:16Now I can see the input for my action.
04:19I can continue clicking Add Input, and add as many as I'd like.
04:23If I see something I need to edit or remove, I can just click the appropriate
04:26links here in the Actions column.
04:28When I'm through defining this action, I'll scroll down, click Done, and then
04:34I'm back to my menu contributions list.
04:37I can see all the actions that are associated with this menu.
04:41I can also add filters from here.
04:44A filter allows me to limit this menu to a particular folder, project, or file
04:50by using a regular expression.
04:51For example, if I only wanted the extension to be available to a folder that was
04:55named Chapter8, I could choose folder, and then type Chapter8 into the Pattern.
05:00For now, I'm going to leave the filters off, so we'll click Done without
05:03filling out anything.
05:05So, we still have no filters added.
05:08When I'm done with this menu, I'll click Done, and now I have a list of defined menus.
05:14I can continue adding as many menus as I want.
05:16For now, we'll stick with the one and move on to our handlers.
05:20Now because I've already defined at least one handler in my menu, I can see that
05:25handler here in my list.
05:27I can edit or delete it directly from here or add new ones.
05:31If I click Add Handler, I'm going to end up with the same dialog that I had
05:35through the Menu Contributions tab.
05:38Now the last tab is Install Wizards.
05:41ColdFusion Builder extensions can actually have multi-page wizards that will
05:46guide a user through all the necessary inputs for your extension.
05:49So, if you have a large extension that requires many inputs from the user,
05:53it might make sense to break it up into more digestible pieces.
05:57To configure a wizard, you first need to give it a width and height. We'll do 600x400,
06:02the same as our previous menu contributions.
06:05We can then specify a handler for the wizard.
06:08We'll leave it as testHandler.
06:10If I wanted a new one, I can specify here. And then click Save.
06:14Once the wizard is defined, I can then click Add Page.
06:18The setup is almost exactly the same as an action.
06:20You're going to specify a title for the page.
06:22Let's call this Page 1, click Save, and then start adding inputs.
06:30We'll just do a quick input here. We'll ask for the user's project name.
06:37Leave it as string and for the default, we'll choose the currently selected
06:40project, and make it required.
06:43Click Save and Done.
06:46Now I have my input for this first page of the wizard. Click Done again.
06:52And now I can see each of my pages.
06:55I can continue to click Add Page and add as many pages to the wizard as I'd like.
07:00Now that I've been through all the tabs, saved each of them as I've gone,
07:04I'm now ready to click Finish.
07:06I'm going to get a complete summary of exactly what the Extension Builder is
07:11going to generate for me.
07:12It shows where it's going to be installed, all of my details, each of my menus,
07:17their actions and inputs, as well as the installation wizard.
07:21At this point, I can return to the Home and actually go through and double-check
07:25everything if I see something wrong.
07:27I can click Cancel, which is going to remove all of the information and you
07:31won't get a confirmation, so make sure that's actually what you want to do, or
07:35the button I really want to click is Generate Extension.
07:40Extension then tells me everything that it did.
07:42It created a folder for me, created my ide_config.xml file, created the handlers
07:48directory, and added my testHandler.
07:49And it also created a framework directory and copied a bunch of framework files
07:54that I'm going to be able to use to build out my ColdFusion handlers.
07:58It's also created an application.cfm, which actually disables debugging and does
08:03some other fancy tricks to make sure that there's no variable clashing as I
08:06execute my extensions.
08:07Then it has installed the extension for me at this particular location.
08:11So, I'll click Close.
08:14If I go to my Test Extension folder, I can see my ide_config.xml file.
08:19Go ahead and open that up and you can see it's done a whole lot of work for me.
08:25Now it didn't add many inputs, so this isn't quite as impressive as it could be,
08:28but as you can imagine writing all of these input fields is far more tedious
08:32than just filling out the dialogs through the Extension Builder UI.
08:37But the more interesting part is in the handlers directory.
08:40Here, I have my application.cfm and my testHandler, and inside my testHandler,
08:46it's actually running part of this ColdFusion Extension framework.
08:51It's processing all of my request information into a variable, which it then
08:55dumps to the page and tells me where I need to add all of my handler logic.
09:00Now if you're serious about developing extensions, it's worth your time to go to
09:04the framework directory,and take a look at some of the tools available to you.
09:07There are CFCs for not only processing the request from the extension, but
09:12also pulling out field information from tables, getting info on tables
09:16themselves, and even taking a look at Outline nodes and pulling project info
09:20directly from the Navigator.
Collapse this transcript
Conclusion
Goodbye
00:00This is an exciting time for us as ColdFusion developers.
00:03Not only is the ColdFusion community growing with the release of ColdFusion 9,
00:07but we now have a dedicated ColdFusion IDE directly from Adobe.
00:11By getting started with ColdFusion Builder, you're on the ground level of what I
00:14think is a renewed commitment to ColdFusion from Adobe.
00:17I've shown you the essentials of using and extending ColdFusion Builder.
00:20I hope you're just as excited as I am about the productivity improvements ahead of you.
Collapse this transcript


Suggested courses to watch next:

ColdFusion 9 Essential Training (7h 21m)
David Gassner

ColdFusion 9 New Features (2h 40m)
Daniel Short


ColdFusion 8 Beyond the Basics (6h 52m)
David Gassner


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 98,609 instructional videos.

start free trial learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 1,894 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.


site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

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.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

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

   
submit Lightbox submit clicked