YOUR FEEDBACK
sahil wrote: help
AJAXWorld RIA Conference
October 20-22 San Jose, CA
Register Today and SAVE !..


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TOP COLDFUSION LINKS


Getting to Know Dreamweaver MX
A powerful tool that keeps getting better

For as long as I can remember, I've been using ColdFusion Studio to develop my applications. Unfortunately, CF Studio appears to be on its last legs. It is still included with Dreamweaver under the name HomeSite+, but has not gone through any major revisions for quite some time.

The future of Macromedia IDEs lies with Dreamweaver, and if you aren't familiar with it, it's time to start getting up to speed. That is what this article is about. Download an evaluation copy here: www.macromedia.com/cfusion/tdrc/index.cfm?product=dreamweaver.

Setting up the Site
To access many features within Dreamweaver, such as file synchronization, source control integration, and database panel access, you will need to create a site. This is how you do it:

  1. Create the site: From the site menu, select manage sites. Click the new button, then click site. Or, from the files panel you could select Site --> New Site. The basic wizard. I prefer to use the advanced. Figure 1 shows the advanced tab.
  2. Local info: On the local info section, you can enter some basic information about the site. You can name the site anything you want. I like to use descriptive names. The local root is the location of the site files on your hard drive. I usually deselect "Refresh Local File Lists Automatically" for performance reasons. You can also specify the default images folder and the HTTP address of the site. The HTTP address is used for the link checker to check links that refer to the site. You can also enable the cache, which speeds up various features.
  3. Remote info: This section is used to define your remote access to the site. In most cases I have either FTP access or network access. RDS, SourceSafe, and WebDAV are also supported. I will often select the "Upload files to server on save" option. If RDS is an option for you, it will open up some other features in the application panel, such as server bindings and databases.
  4. Testing server: The testing server section can be used to set the type of server you are testing against (ColdFusion, of course), and how you access it. I'm sure in many cases, the testing server will be your local machine.
  5. Cloaking: The cloaking section allows you to enable or disable cloaking. Cloaked files or folders will be ignored when doing site operations such as synchronize or a site-wide search.
  6. Design notes: Design notes are designed to let you share extra information about files with other developers. If you're working in a team these can be useful. Working solo, I will usually disable this feature.
  7. Site map layout: Allows you to specify how the site map will look. You can view the site map by selecting Map View in the files panel.
  8. File view columns: This specifies the columns that will be displayed in the expanded version of the files panel. You can expand the files panel by clicking on the expand/collapse button. I usually keep the defaults.
  9. Contribute: If you want to make your site contribute-friendly, this is the place to do it.
If you don't want to use a site you don't have to; you can always edit files directly in the file system without problems. I've found that sites are a great way to help organize the files and different projects that I have going on at once.

Dealing with Components
One area where Dreamweaver excels is in its handling of ColdFusion Components (CFCs). If you go to the components tab of the application panel, you should see a list of all components on your current server. If you do not have all the proper settings set up in the site, you'll get a list of what you need to correct before components will be displayed.

The component panel also offers a wizard for creating components. Wizards are often much nicer than typing everything by hand. Use these instructions to use the component wizard:

  1. Start the wizard: Open up the application panel if it is not already open. You can do so by selecting components from the window menu. Click the plus sign (+) on the component panel to bring up the create component wizard.
  2. Enter component information: Here is where you will enter the attributes of the component tag, such as the display name, the hint, and which component this component is extending. You can also specify the directory that the component will be created in and its file name.
  3. Enter property information: The properties section is used to specify the cfproperty tag. When using components only within CF, you do not need to specify properties. However, properties are used in conjunction with Web services, so if you want to open up your CFC as a Web service, then you'll need to enter data here. Click the plus sign to create a property. Type in its name, display name, hint, and type. You can remove a property by selecting it and clicking on the minus sign (-) button.
  4. Enter function information: The function section allows you to specify functions that will be in your component. You can specify the attributes of the cffunction tag, such as name, hint, access, returntype, roles, output, and display name. Using this wizard, there is no place to put your function code. It will only create the shell of the method for you to use. You can always remove a function by selecting it and clicking the minus sign button.
  5. Enter argument information: The arguments section allows you to specify arguments for each individual method. Select the function from the list of available functions, and then click the plus sign to create an argument. Fill in the argument data, such as the name of the argument, its displayname, the hint, type, default value, and whether it is required or not.
  6. Complete the wizard: Click the okay button and the component will be created and opened in the Dreamweaver edit window.
  7. Fill in your functions: Now you can flesh out your functions as needed and fill in any pseudoconstructor initialization code.
You'll probably notice that the component you just created now shows up in the components panel. If you need to use the component inside a page, you can just click and drag the relevant method onto your page and the cfinvoke tag will be created automatically. Since many CFCs maintain state between individual method calls, you will probably want to modify the generated code to reference an instance of an object instead of the CFC directly. Create the instance of the object with the cfobject tag and then change the component value of cfinvoke to the component reference.

You can use the component panel to access Web services in a very similar manner. In the component panel, select Web services from the drop-down menu. Click the add button and enter the Web Service Definition Language (WSDL) location of the Web service. Dreamweaver will parse the WSDL and give you a list of all the methods and their arguments. Just as with components, you can click and drag the method into your cfm page to generate code for calling that component.

Miscellaneous Features
There are a few other features of Dreamweaver that I find helpful in my development. Here they are in no particular order:

  1. Tag insight: If you've ever written code by hand, I'm sure you'll appreciate how great this is. Start typing the name of the tag, and choose it from the list. Hit the space bar and the tag's attributes are listed for you. For many attributes, the default values are even specified. When you close the tag, the end tag, if applicable, is automatically displayed.
  2. Hide panels: You can hit F4 to hide all panels on a screen. Then hit F4 again to replace them on the screen. This is very helpful when you want more screen estate for the code portion of your editor window. To hide the side panel bar without affecting the panels on top or below the editor, click the arrow button in the bar between the panel window and the edit window. Clicking it again restores the panel.
  3. CFML insert bar: From the window menu select insert, then the CFML tab. This gives you access to many commonly used CFML language features, including a cfquery wizard, CFML comments, those pesky number signs, cfoutput, cflocation, and cfinclude. Sometimes it's easier to click a button than to type code from scratch. There is plenty of other nonCF-related stuff on the insert bar that can be useful in many situations.
  4. Search and replace: I wouldn't last a day without using search (and replace) in some manner. Dreamweaver provides many search or replace options. You can search in a current document, within a selected block of text, across all open documents, across all documents in a site, within a folder, or within selected documents of a site. You can also search within source code, text, or within a specific tag. Regular expressions are supported and you can ignore white space. You can also save search information for later use. Control+F is your friend. (Although, I do wish they had a find previous option in addition to find next.)
  5. Synchronize: In any given week, I'll cycle through multiple projects at more than one client. Since I do all development locally, the first thing I do when I plug into a client's network is synchronize my local site with the most up to date version of their code. The synchronize process deletes any files on my machine that are no longer relevant and it also updates old versions of files. When I'm done with my development for the day, I can always synchronize right back to them.
  6. Snippets: Snippets are small blocks of code that you can just click and drag onto your own page. You'll find them in the code panel on the snippet tab; you can also create your own. Some of my own custom snippets include a comment header that I place on every document, a dump of application, and session variables.
Conclusions
I'm sure you'll find that Dreamweaver is a very powerful tool that keeps getting better. If you find it lacking in some area, there are many extensions available to help you expand it. A good place to start looking for extensions is in Macromedia's Developer Exchange at www.macromedia.com/cfusion/exchange/ index.cfm#loc=en_us&view=sn100&viewName=Macromedia%20Exchange&avm=1 . I hope you've found this article enlightening. Let me know which features in Dreamweaver that I didn't cover here help your development.
About Jeffry Houser
Jeffry Houser has been working with computers for over 20 years and in Web development for over 8 years. He owns a consulting company and has authored three separate books on ColdFusion, most recently ColdFusion MX: The Complete Reference (McGraw-Hill Osborne Media).

CFDJ LATEST STORIES . . .
Kevin Lynch, who will be keynoting on October 21, 2008, helped originally coin the term "Rich Internet Application" in 2002. He has been at the center of innovation in Flash and Adobe AIR since their inception, and currently drives Adobe’s technology platform for designers and develo...
Rich Internet Applications offer the potential to fundamentally change the user experience and in doing so, yield significant business benefits. The theme of this October's AJAX World Conference & Expo 2008 West is 'Beyond AJAX to the RIA Era' and the Call for Papers, which is still op...
Join Scott Guthrie as he discusses Microsoft’s commitment to web standards development, Rich Internet Applications and how Microsoft is contributing to help move the web forward. Join Adobe’s Kevin Lynch as he demonstrates how Flash and HTML come together to make the most engaging,...
Virtualization has become a critical part of Enterprise IT strategy. Why and how has it become one of the most important change agents in our industry? To answer these questions I had the good fortune recently to be able to speak to a select group of top IT industry executives who join...
SQL Injection attacks are one of the easiest ways to hack into a website. One recent hack, using a script from verynx.cn, involves injecting sql into a web form that then appends some JavaScript code into fields in a database that then gets executed on the client side when a user views...
Recursion Software released a private beta version of their Voyager mobile platform, with powerful interoperability for Android, Microsoft .NET and Compact Framework (CF), all Java editions (JME CDC, JSE and JEE), and more than 15 embedded operating systems. The Voyager platform is a p...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS

MOST READ THIS WEEK
ADS BY GOOGLE