Welcome!

You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion

ColdFusion: Article

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.

More Stories By Jeffry Houser

Jeffry is a technical entrepreneur with over 10 years of making the web work for you. Lately Jeffry has been cooped up in his cave building the first in a line of easy to use interface components for Flex Developers at www.flextras.com . He has a Computer Science degree from the days before business met the Internet and owns DotComIt, an Adobe Solutions Partner specializing in Rich Internet Applications. Jeffry is an Adobe Community Expert and produces The Flex Show, a podcast that includes expert interviews and screencast tutorials. Jeffry is also co-manager of the Hartford CT Adobe User Group, author of three ColdFusion books and over 30 articles, and has spoken at various events all over the US. In his spare time he is a musician, old school adventure game aficionado, and recording engineer. He also owns a Wii. You can read his blog at www.jeffryhouser.com, check out his podcast at www.theflexshow.com or check out his company at www.dot-com-it.com.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


IoT & Smart Cities Stories
Moroccanoil®, the global leader in oil-infused beauty, is thrilled to announce the NEW Moroccanoil Color Depositing Masks, a collection of dual-benefit hair masks that deposit pure pigments while providing the treatment benefits of a deep conditioning mask. The collection consists of seven curated shades for commitment-free, beautifully-colored hair that looks and feels healthy.
The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today. According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today. According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
We all love the many benefits of natural plant oils, used as a deap treatment before shampooing, at home or at the beach, but is there an all-in-one solution for everyday intensive nutrition and modern styling?I am passionate about the benefits of natural extracts with tried-and-tested results, which I have used to develop my own brand (lemon for its acid ph, wheat germ for its fortifying action…). I wanted a product which combined caring and styling effects, and which could be used after shampo...
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
There are many examples of disruption in consumer space – Uber disrupting the cab industry, Airbnb disrupting the hospitality industry and so on; but have you wondered who is disrupting support and operations? AISERA helps make businesses and customers successful by offering consumer-like user experience for support and operations. We have built the world’s first AI-driven IT / HR / Cloud / Customer Support and Operations solution.
Codete accelerates their clients growth through technological expertise and experience. Codite team works with organizations to meet the challenges that digitalization presents. Their clients include digital start-ups as well as established enterprises in the IT industry. To stay competitive in a highly innovative IT industry, strong R&D departments and bold spin-off initiatives is a must. Codete Data Science and Software Architects teams help corporate clients to stay up to date with the mod...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Druva is the global leader in Cloud Data Protection and Management, delivering the industry's first data management-as-a-service solution that aggregates data from endpoints, servers and cloud applications and leverages the public cloud to offer a single pane of glass to enable data protection, governance and intelligence-dramatically increasing the availability and visibility of business critical information, while reducing the risk, cost and complexity of managing and protecting it. Druva's...
BMC has unmatched experience in IT management, supporting 92 of the Forbes Global 100, and earning recognition as an ITSM Gartner Magic Quadrant Leader for five years running. Our solutions offer speed, agility, and efficiency to tackle business challenges in the areas of service management, automation, operations, and the mainframe.