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.
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
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the competition, or worse, just keep up. Each new opportunity, whether embracing machine learning, IoT, or a cloud migration, seems to bring new development, deployment, and management models. The results are more diverse and federated computing models than any time in our history.
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...
Japan DX Pavilion at @CloudEXPO Silicon Valley
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
The graph represents a network of 1,329 Twitter users whose recent tweets contained "#DevOps", or who were replied to or mentioned in those tweets, taken from a data set limited to a maximum of 18,000 tweets. The network was obtained from Twitter on Thursday, 10 January 2019 at 23:50 UTC. The tweets in the network were tweeted over the 7-hour, 6-minute period from Thursday, 10 January 2019 at 16:29 UTC to Thursday, 10 January 2019 at 23:36 UTC. Additional tweets that were mentioned in this...
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...
Where many organizations get into trouble, however, is that they try to have a broad and deep knowledge in each of these areas. This is a huge blow to an organization's productivity. By automating or outsourcing some of these pieces, such as databases, infrastructure, and networks, your team can instead focus on development, testing, and deployment. Further, organizations that focus their attention on these areas can eventually move to a test-driven development structure that condenses several l...
The term "digital transformation" (DX) is being used by everyone for just about any company initiative that involves technology, the web, ecommerce, software, or even customer experience. While the term has certainly turned into a buzzword with a lot of hype, the transition to a more connected, digital world is real and comes with real challenges. In his opening keynote, Four Essentials To Become DX Hero Status Now, Jonathan Hoppe, Co-Founder and CTO of Total Uptime Technologies, shared that ...
Over the course of two days, in addition to insightful conversations and presentations delving into the industry's current pressing challenges, there was considerable buzz about digital transformation and how it is enabling global enterprises to accelerate business growth. Blockchain has been a term that people hear but don't quite understand. The most common myths about blockchain include the assumption that it is private, or that there is only one blockchain, and the idea that blockchain is...
Never mind that we might not know what the future holds for cryptocurrencies and how much values will fluctuate or even how the process of mining a coin could cost as much as the value of the coin itself - cryptocurrency mining is a hot industry and shows no signs of slowing down. However, energy consumption to mine cryptocurrency is one of the biggest issues facing this industry. Burning huge amounts of electricity isn't incidental to cryptocurrency, it's basically embedded in the core of "mini...