Sharing Extensions

Team-Fly    

Macromedia® DreamWeaver® MX Unleashed
By Matthew Pizzi, Zak Ruvalcaba
Table of Contents
Chapter 20.  Extending Dreamweaver MX


After you've created your first distributable object or behavior, you may want to share it with the world. Sharing extensions is not all that uncommon, in fact Macromedia has a whole section of its Web site devoted to extension sharing: The Macromedia Exchange. This section focuses on preparing your extensions for submission to the Macromedia Exchange, including the following:

  • Documentation Documentation means creating a help file so everyone who is using your extension knows how it works.

  • Distribution Distribution means using the installer file to create an MXI file and bundling it into an extension using the Extension Manager.

  • Submission Submitting your extension to the Macromedia Exchange is the final step performed.

Documentation

A good extension is useful only if people know how to use it. You've probably noticed by now that when you select a preinstalled behavior that contains a dialog box, you're either given a textual explanation toward the bottom of the text box, explaining how the behavior works, or you're given a Help button. The Help button is used to allow the user of the behavior to access online help, providing more in-depth analysis of what the behavior can do and how it can be used. To create documentation for your extension, follow these steps:

  1. Create a new HTML file in Dreamweaver MX and write some information about how your extension works, as shown in Figure 20.15. You may also include a screen capture if you think that is necessary.

    Figure 20.15. Create an HTML page describing your extension.

    graphics/20fig15.jpg

  2. Save the HTML file into a working folder within the Configuration\Shared folder. Copy any necessary images into that folder because they will be needed for the HTML page to work correctly. Figure 20.16 illustrates this point.

    Figure 20.16. Save your HTML file and optional images into a custom folder that you create within the Configuration\Shared folder.

    graphics/20fig16.jpg

  3. Open the Window Resizer.js file and create a new function called displayHelp(). This function is also part of the API. Notice that the code makes calls to other methods within the API, specifically getConfigurationPath() and browseDocument(). getConfigurationPath() dynamically maps a path to the users configuration folder. After the folder has been found, you append the path to the location where the file should reside. Then, call the browseDocument() method, which opens the file that resides in that path.

     function displayHelp() { var theURL = dw.getConfigurationPath(); theURL += "/Shared/CustomBehaviors/sizerwindow.htm"; dw.browseDocument(theURL); } 
  4. Save that file and restart Dreamweaver MX. This time, create a new HTML file with a link and insert the new behavior. If you click the Help button, it launches the HTML help file that you created, similar to Figure 20.17.

    Figure 20.17. A browser window is launched complete with your help file.

    graphics/20fig17.jpg

NOTE

Complete guidelines for how extensions should be created are available from Macromedia's Web site at http://www.macromedia.com/exchange/dreamweaver. Click the Site Help topic Macromedia Approved Extensions.


Distribution

After you've completely documented how your behavior should work, you are ready to package it up for distribution. Using the Extension Manager shown in Figure 20.18, you can package your extension into a special installation file known as a Macromedia Extension Installation, or an MXI.

Figure 20.18. The Extension Manager enables you to package your extension into a special installation file also known as an MXI.

graphics/20fig18.jpg

NOTE

You must have the latest release of Macromedia's Extension Manager to create extensions for the new MX releases. For Dreamweaver MX, you can download the newest release of the Extension Manager from http://dynamic.macromedia.com/bin/MM/exchange/main.jsp?product=dreamweaver.


The process is easier than you may think and can be accomplished by following these simple steps:

  1. Put all the necessary files (help files, HTML files, JS files, and GIF files) into a separate folder outside of the Configuration folder, as shown in Figure 20.19.

    Figure 20.19. Place all your files into a separate folder outside of the Configuration folder.

    graphics/20fig19.jpg

  2. Copy one of the sample.mxi files from the Extension Manager's sample directory into the directory that you created to store all your files and rename it WindowSizer.mxi. You can use this as a template for building your own installation file. The MXI file is basically an XML file that contains information, such as the platform the extension requires, the author's name, the type of extension, and a brief description.

  3. Fill in all the required information for name, version, type, product name, author name, description, and filenames. Note that the filenames require a location from where to grab the files and a destination to install the files. The finished code should look similar to Figure 20.20.

    Figure 20.20. Modify the MXI file to include all relevant information.

    graphics/20fig20.jpg

  4. From the Extension Manager, select File, Package Extension. Locate the MXI file and select OK. The MXP, or Macromedia Extension Package, will appear in the same directory as the MXI file.

To install the extension, follow these directions:

  1. Open the Extension Manager.

  2. Select File, Install Extension.

  3. The package will be installed into the appropriate folders and the extension will appear within the Extension Manager, as shown in Figure 20.21.

    Figure 20.21. The extension will appear within the Extension Manager.

    graphics/20fig21.jpg

Submission

After you have completely documented, tested, and packaged your extension, you are ready to share it with the rest of the development community on the Macromedia Exchange. The process is relatively simple and can be completed in these steps:

  1. Visit the Macromedia Dreamweaver exchange at http://dynamic.macromedia.com/bin/MM/exchange/main.jsp?product=dreamweaver shown in Figure 20.22.

    Figure 20.22. The Macromedia Exchange.

    graphics/20fig22.jpg

  2. Click Submit Extension.

  3. Follow the checklist and submit your extension when you are ready.


    Team-Fly    
    Top


    Macromedia Dreamweaver MX Unleashed
    Macromedia Dreamweaver MX 2004 Unleashed
    ISBN: 0672326310
    EAN: 2147483647
    Year: 2002
    Pages: 321

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