22.2 Writing Your Own Extensions

If you can write HTML and JavaScript, you can write Dreamweaver extensions. In earlier chapters, we saw how to add custom objects to the Objects panel, create custom dialog boxes, and add commands to the Commands menu. Dreamweaver extensions are merely customized menu options, behaviors, and objects that have been packaged to make them easily shareable.

22.2.1 Resources for Extension Developers

Macromedia provides several resources to help you write Dreamweaver extensions:

  • For a thorough discussion of creating extensions, the Help figs/u2192.gif Extending Dreamweaver option from the Dreamweaver main menu bar accesses the full text of Macromedia's Extending Dreamweaver manual. (The PDF version of the manual, ExtendingDreamweaver.pdf , is included in the ExtendingtheStudio folder of the Dreamweaver 4 installation CD-ROM. The same folder includes ExtendingFireworks.pdf , which documents how to extend Fireworks.)

  • The Help figs/u2192.gif Creating and Submitting Extensions option in the Extension Manager window's menu bar gives an overview of how to create extensions and submit them to the Dreamweaver Exchange.

  • Visit http://www.macromedia.com/support/dreamweaver/extend.html for more detail on customizing and extending Dreamweaver

  • Avail yourself of the Dreamweaver Exchange and the resources cited in the preface.

  • Also see Building Dreamweaver 4 and Dreamweaver UltraDev 4 Extensions by Ray West and Tom Muck (Osborne).

22.2.2 Overview of Developing an Extension

The following steps will help you start creating and distributing your own extensions:

  1. Create the JavaScript, HTML, and icons required for your extension. Use the built-in Dreamweaver objects and commands as a starting point. Consult the resources cited previously for information on the API and Document Object Model (DOM) used by Dreamweaver.

  2. Comply with the Macromedia UI Guidelines as described at http://dynamic.macromedia.com/MM/exchange/ui_guidelines.jsp.

  3. Test your extension thoroughly on multiple configurations, including various flavors of Windows, the Mac OS, and different browsers. See the Macromedia web page "About Extension Testing and Approval" at http://dynamic.macromedia.com/MM/exchange/about_testing.jsp for a testing plan and steps necessary to receive Macromedia Approval certification for your extension.

  4. Move the relevant files to a staging area so they are easily accessible when creating the package for distribution.

  5. Write the installation file (an .mxi file) that controls extension installation. For a sample, see the Blank.mxi file in the ExtensionManagerSamples/Dreamweaver folder. The .mxi file also defines how a developer accesses the extensions features, such as via a keyboard shortcut, menu item, or the Objects panel. For details on the .mxi file format, see "The Macromedia Extension Installation File Format," available at http://download.macromedia.com/pub/exchange/mxi_file_format.pdf.

  6. Use the Extension Manager's File figs/u2192.gif Package Extension command to create an Extension package ( .mxp file) from the .mxi file created in Step 5. The same package is used on both platforms in most cases. (Use a filename that is valid on both Windows and Macintosh and does not contain spaces.) The .mxp file contains compressed versions of the necessary files, plus installation instructions used by the Extension Manager.

  7. Install the .mxp file on your own machine using the Extension Manager's File figs/u2192.gif Install Extension command to ensure that the extension installs properly (preferably, you should test it on a fresh machine to ensure that the necessary files are installed by the package and are not simply left over from your development efforts). Retest the extension's features to verify that the installation is correct.

  8. Submit the extension to the Exchange by using the Extension Manager's File figs/u2192.gif Submit Extension command by or going directly to http://dynamic.macromedia.com/bin/MM/exchange/about_submission.jsp. This action accesses the Macromedia Exchange site where you must log in and follow on-screen instructions to submit your extension.

The next chapter covers the CourseBuilder extension, which simplifies the creation of web-based training courses.

Dreamweaver in a Nutshell
Dreamweaver in a Nutshell
Year: 2005
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net