| Subclipse HOWTO |
| Written by David Torre | |||||
|
For the ColdFusion developer seeking a decent IDE, the two choices have traditionally been either the pricey Adobe Dreamweaver, or a selection of half-baked HTML editors with no ColdFusion tag support. Thankfully, this all changed in 2004 with the advent of CFEclipse, a ColdFusion plug-in for the uber-popular Eclipse integrated development environment. In this article, I'll describe how to get up and running using the Eclipse IDE with both ColdFusion and Subversion plug-ins.
Installing Eclipse First things first. Eclipse is a Java-based application, and therefore requires a recent Java Runtime Environment or “JRE.” If you plan on using Eclipse to write web applications in ColdFusion, then the bare bones JRE from www.java.com will suffice. If you decide you want to write full-blown Java applications in addition to your ColdFusion apps, then you must download the full Java software development kit. The JDK includes the JRE for running Java applications, as well as a compiler for building actual Java applications. The JDK may be downloaded from java.sun.com.
Now that you have Java installed, head over to www.eclipse.org/downloads
and grab the latest copy of Eclipse. Any version of Eclipse with plug-in
development environment (PDE) support will suffice. (The two versions tested for this article included the Classic version, as well as the "PDT" bundle which is essentially a version of Eclipse pre-compiled with PHP editing support.) Once downloaded, unzip the Eclipse archive to a permanent location, such as C:\program Files\eclipse for Windows or /home/your-username/eclipse
for UNIX. Once unzipped, create shortcuts to the Eclipse binary on your
Desktop. Note that the entire Eclipse package is completely
self-contained in one folder. As such, there are no installation
routines, registry settings, or other invasive system hooks.
Installing CFEclipse Now that Eclipse is installed, it's time to install some plug-ins. For this tutorial, we'll install CFEclipse for ColdFusion development, as well as “Subclipse” which is a Subversion (SVN) client, used for source version control. Launch Eclipse, then navigate to the HELP menu, Software Updates, Find and Install...
Choose the “Search for new features to install” radio button, and click next.
Within the Install dialog, choose the “New Remote Site...” button.
In the New Update Site dialog, enter a name and download URL for CFEclipse. The name may be anything you like-- we'll simply use CFEclipse. The download URL will be the primary CFEclipse plug-in site, located at http://www.cfeclipse.org/update. Finally, click OK within the New Update Site dialog.
Once the new site has been added to the update sites list, ensure that it's selected, and hit the Finish button. When finished searching, the Search Results page should provide you with the option to install CFEclipse:
With CFEclipse selected, hit Next to begin the installation. Accept any license agreements, and hit Finish. Ignore any “Unsigned Feature” verification warnings by hit the “Install All” button. Restart Eclipse when asked to do so.
Testing CFEclipse Once Eclipse has been restarted, verify that the CFEclipse “perspective” is available by creating a new ColdFusion project and sample CFML files. This may be accomplished as follows: Launch Eclipse, and open a new project by going to File > New > Project...
Within the Project Selection Wizard, choose “CFML Project” Under CFEclipse, then hit Next.
Finally, give the project a name, such as “Test2,” and hit Finished. Do not select any other projects to reference.
You may be asked to open the project using the CFEclipse “perspective.” This essentially loads the ColdFusion user-interface, rather than the default Java programming IDE interface. Choose yes, and click the “Remember by decision” check box:
At this point, you should be able to right-click on your project, select new, and choose ColdFusion files, such as CFM or CFC files:
Upon typing your CF code, your editor should now have context-sensitive ColdFusion tag-completion, as well as ColdFusion documentation references:
Installing Subclipse Installing Subclipse will basically follow the same process we used during the CFEclipse installation. However, the download URL, as well as the installation options will differ slightly. Again, go to Help > Software Updates > Find and Install... Select “Search for new features to install” and click Next. Uncheck any existing site to search, and click the “New Remote Site” location. Again, choose an identifying name, and the URL of the Subclipse donwload site. For Eclipse version 3.2 and greater, the download URL should be: http://subclipse.tigris.org/update_1.2.x (Note the 'x' in the URL is a literal value, not a variable. In other words, leave as-is and do not substitute with your actual version number.)
With the new site added, ensure that it's checked in the “Sites to include in search” dialog, and hit Finish.
Within the Search Results dialog, choose the “Subclipse” and “Subclipse Plugin” items. However, uncheck the optional “Integrations” item and all sub-items.
Hit Next, and accept any agreements.
Finally, accept any license agreements, and hit Finish. Ignore any “Unsigned Feature” verification warnings by hit the “Install All” button.
Restart Eclipse when prompted to do so.
Testing Subclipse Verify the Subclipse plug-in has been added by opening a new perspective (located in the upper right-hand corner) and choosing “Other...”
Choose the SVN Repository Exploring Plugin, and hit Ok.
To verify the installation of Subclipse, you may now checkout a sample project from any SVN server on the Internet. For our example, we'll check out the most recent copy of ColdFusion IMAP CFC Client from sourceforge.net, located at: http://sourceforge.net/projects/cfimap-cfc/
Within the SVN repository view, right-click in the white space area and select New > Repository Location...
Type in the URL: https://cfimap-cfc.svn.sourceforge.net/svnroot/cfimap-cfc and click Finish. (Note you may need to accept Source Forge's SSL certificate).
You should now have a repository which looks similar to the following:
Now that you have access to the SVN repository, it's time to “check-out” a copy of the source. Much like a tree, SVN repositories have a trunk, as well as branches. In SVN lingo, the trunk is the “main” program. The trunk should be thought of as the most recent working copy of a program. Branches, on the other hand, are parallel versions used for testing or debugging. For this exercise, we'll check out the main program by checking out the trunk. Start by simply right-clicking on the “trunk” folder, and then choose “Checkout...”
From the “Checkout from SVN” menu, choose: Check out as a project configured using the New Project Wizard.
From the “Select a Wizard” dialog, choose: CFML Project.
Finally, give your project a name (it should be the same project name from the SVN repository. In this case: “cfimap-cfc.”) and hit Finish.
After editing your CFML files, you would submit your changes back into SVN through a “commit” action. While anonymous commits are not allowed for this project, an authorized developer would submit his or her changes by right-clicking on the project name in the Navigator view, choosing Team, then Commit...
Note you must be a registered developer to commit source code changes to most SVN projects.
Summary Between the backing from corporate giants such as IBM, as well as widespread developer adoption, it's safe to say that Eclipse is here to stay. Its vast popularity, coupled with an extensive assortment of plug-in modules, has made Eclipse a truly viable alternative to expensive (and more importantly, proprietary) integrated development environments.
|
|||||