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