Introduction

 < Day Day Up > 

This guide describes the Macromedia Dreamweaver 8 framework and application programming interface (API) that lets you build extensions to Dreamweaver. It provides information about how each type of extension works; the API functions that Dreamweaver calls to implement the various objects, menus, floating panels, server behaviors, and so on, that make up the features of Dreamweaver; and a simple example of each type of extension. This guide also explains how to customize Dreamweaver by editing tags in various HTML and XML files to add menu items or document types, and so on.

To add an object, menu, floating panel, or other feature to Dreamweaver, you must code the functions that the particular type of extension requires. This guide describes the arguments that Dreamweaver passes to these functions and also the values that Dreamweaver expects these functions to return.

For information on the utility and general purpose JavaScript APIs that you can use to perform various support operations in your Dreamweaver extensions, see the Dreamweaver API Reference. If you plan to create extensions that work with databases, you might also want to review the sections in Getting Started with Dreamweaver about making connections to databases.

Background

Most Dreamweaver extensions are written in HTML and JavaScript. This guide assumes that you are familiar with Dreamweaver, HTML, XML, and JavaScript programming. If you are implementing C extensions, the guide assumes that you know how to create and use C dynamic link libraries (DLLs). If you are writing extensions for building web applications, you should also be familiar with server-side scripting on at least one platform, such as Active Server Pages (ASP), ASP.net, PHP: Hypertext Preprocessor (PHP), Macromedia ColdFusion, or Java Server Pages (JSP).

Installing an extension

To become familiar with the process of writing extensions, you might want to explore the extensions and resources that are available through the Macromedia Exchange website (www.macromedia.com/exchange). Installing an existing extension introduces you to some of the tools that you need to work with in your own extensions.

To install an extension, use the following procedure:

1.

Download and install the Extension Manager, which is available on the Macromedia Downloads website (www.macromedia.com/software/downloads).

2.

Log on to the Macromedia Exchange website (www.macromedia.com/exchange).

3.

From the available extensions, select one that you want to use. Click the Download link to download the extension package.

4.

Save the extension package in the Dreamweaver 8/Downloaded Extensions folder of your installed Dreamweaver folder.

5.

In the Extension Manager, select File > Install Extension. In Dreamweaver, select Commands > Manage Extensions to start the Extension Manager.

The Extension Manager automatically installs the extension from the Downloaded Extension folder into Dreamweaver.

Some extensions need Dreamweaver to restart before you can use them. If you are running Dreamweaver when you install the extension, you might be prompted to quit and restart the application.

To view basic information on the extension after its installation, go to the Extension Manager (Commands > Manage Extensions) in Dreamweaver.

Creating an extension

Before you create a Dreamweaver extension, visit the Macromedia Exchange website at www.macromedia.com/exchange to see if the extension you plan to create already exists. If you do not find an extension that meets your needs, you then perform the following steps to create the extension:

  • Determine the type of extension you want to create. For more information about the extension types, see "Types of Dreamweaver extensions" on page 100.

  • Review the documentation for the type of extension you plan to create. To become familiar with creating that type of extension, it's a good idea to create the simple extension example in the appropriate chapter.

  • Determine which files you need to modify or create.

  • Plan the user interface (UI), if any, for the extension.

  • Create the necessary files and save them in the appropriate folders.

  • Restart Dreamweaver so that it recognizes the new extension.

  • Test the extension.

  • Package the extension so that you can share it with others. For more information, see "Working with the Extension Manager" on page 109.

Additional resources for extension writers

To communicate with other developers who are involved in writing extensions, you might want to join the Dreamweaver extensibility newsgroup. You can access the website for this newsgroup at www.macromedia.com/go/extending_newsgrp/.

What's new in Dreamweaver

Dreamweaver 8 includes the following new features and interfaces that are extensible. Each of these features has new related functions, which are listed in the Dreamweaver API Reference.

  • Improved site synchronization

    The comparison of local and remote files is more reliable in Dreamweaver 8.

  • Copy and paste improvements

    Copy and paste choices have been simplified. Users can also now set the default behavior of a paste operation to be to paste text only.

  • Site root-relative links mapping has been improved.

  • Code collapse

    Dreamweaver now lets users selectively collapse or expand segments of code.

  • Code view toolbar

    Dreamweaver now provides a toolbar in Code view that allows quick access to commonly used commands.

  • Background file transfer

    This feature lets users to do other things in Dreamweaver while processing server-related tasks.

  • File compare integration

    Dreamweaver now lets users launch a third-party file comparison application to compare two local files, two remote files, or the local and remote versions of a file.

  • Streamlined handling of CSS styles

    The CSS Styles and Relevant CSS panels have been combined. The Design panel is now named CSS; the CSS Styles panel is now named Styles. There is now a menu option for Document CSS Styles and Selection CSS Styles in the Window menu. In addition, an Edit Rule button has been added to the Property inspector.

  • Visual aids for CSS divs and layers

    Dreamweaver now includes visual aids to let users see their CSS page layout.

  • Zooming in and out

    Dreamweaver now lets users zoom in and out while viewing their web pages.

  • Guides

    Dreamweaver now lets users create guides in their documents.

Documentation changes

Extending Dreamweaver includes the following improvements to help new extension authors get started.

  • New and updated examples

    New examples have been added for Reports and Behaviors. The example for Property inspectors has been improved. The steps for creating each type of extension are presented as a tutorial, which you can follow to understand what the files do and how they interact.

  • New organization

    Each chapter now begins with a table that lists the files required to create the type of extension described in the chapter.

For information on the new functions that have been added to the Utility API and the JavaScript API, see the Dreamweaver API Reference.

Macromedia Press

Improve your Dreamweaver skills with books from Macromedia Press. Check out the latest content written by the experts. See www.macromedia.com/go/dw2004_help_mmp.

Deprecated functions

In Dreamweaver 8, several functions have been deprecated. For information on the functions that have been removed from the Utility and JavaScript APIs, see the Dreamweaver API Reference.

Errata

A current list of known issues can be found in the Extensibility section of the Dreamweaver Support Center (www.macromedia.com/go/extending_errata).

Conventions used in this guide

The following typographical conventions are used in this guide:

  • Code font indicates code fragments and API literals, including class names, method names, function names, type names, scripts, SQL statements, and both HTML and XML tag and attribute names.

  • Italic code font indicates replaceable items in code.

  • The continuation symbol (¬) indicates that a long line of code has been broken across two or more lines. Due to margin limits in this guide's format, what is otherwise a continuous line of code must be split. When copying the lines of code, eliminate the continuation symbol, and type the lines as one line.

  • Curly braces ({ }) that surround a function argument indicate that the argument is optional.

  • Function names that have the prefix dreamweaver. as in dreamweaver.funcname, can be abbreviated to dw.funcname when you are writing code. This manual uses the full dreamweaver. prefix when defining the function and in the index. Many examples use the shorter dw. prefix, however.

The following naming conventions are used in this guide:

  • You the developer who is responsible for writing extensions

  • The user the person using Dreamweaver

  • The visitor the person who views the web page that the user created

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

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