Packaging Your Extensions

[ LiB ]

The Extension Manager has become the standard method of installing and sharing extensions. Although you could share your extensions by just giving away the raw files, along with instructions on where to put them, it's much safer, and more user -friendly, to provide an installation package or MXP file for use with the Extension Manager.

Luckily, the Extension Manager not only installs extensions, it also neatly packages them into special installation files. The process is even relatively painless:

  1. Put all the required files (help files, HTML files, JS files, GIF icons) in one folder, outside the Configuration folder.

  2. Create an installation file. This is an XML document named extension.mxi . It contains all the instructions needed for installation: where the files should be stored, what versions of Dreamweaver and what platforms the extension requires, author's name , type of extension, and description. The formatting required is very exact. The best approach for beginners is to start from the Samples included with the Extension Manager. These files include a blank file ( blank.mxi ) to use as a template and a sample file ( sample.mxi ) filled in with information for a simple command.

  3. Launch the Extension Manager, and select File > Package Extension.

Figure 29.15 shows a sample folder containing all the proper files to package the Copyright Statement file.

Figure 29.15. The assembled elements of the Copyright Statement object, all ready for packaging.


Exercise 29.8. Packaging an Extension

This last exercise takes you through the steps to create an MXP file from this extension.

  1. Start by copying all needed files into one folder. Somewhere on your hard drive, outside the Configuration folder, create a new folder. Name it whatever you like and will remembersomething like Copyright Statement Files .

    Find the files that make up the object, and copy them there. This includes Copyright Statement.htm and Copyright Statement.gif .

  2. On your hard drive, find the Extension Manager application folder. Inside that folder, find the Dreamweaver/Samples folder. Inside there, you'll see blank.mxi . (Figure 29.16 shows where to find these items.) Duplicate that file in your Collection folder, and call it C_Statement.mxi . (Naming conventions apply here. You can't use spaces, special characters , or long names .)

    Figure 29.16. The Extension Manager application folder structure, showing sample.mxi and blank.mxi.


    After you've made the duplicate file, open it in your text editor.

    You can download a PDF file containing detailed instructions for creating installation files from the Macromedia website. Go to the Macromedia Exchange for Dreamweaver page (www.macromedia.com/exchange/dreamweaver), and click the Site Help topic Macromedia Approved Extensions.


  3. Fill in the blanks with the information for your object.

    The blank file has all the framework you need. By examining the sample file, you can get an idea how it should be formatted. For your extension, fill in the blanks until your code looks like that shown in Listing 29.1. Information that has been added to the framework from blank.mxi is in bold. Pay special attention to the following when filling in the code:

    • For the author name Enter your name. (You've already entered Tom Thumb, Big-Time Genius there's no law against being fanciful.)

    • For the filenames Enter the relative path from the MXI file you're creating to the copies of the extension files you've saved for packaging. If all these files are in the same folder, you can just enter the filename.

    • For the destination Enter the complete path from the Dreamweaver application folder root, as shown. If you want your extension to create any new folders in existing folders, enter them as part of the path. (You have entered ThumbThings to create a new folder within the Objects folder.)

    • For the version number Your extension, like any other piece of software, gets its own version number. Start with 1.0, and increment the number if you later revise the extension.

    • For the insertbar-changes area The insertbar-insert element governs where the new category will be inserted. Set the insertAfter attribute to the ID of whatever category you want your category to follow. (In this case, the ThumbThings category follows the Application category, which has an ID of DW_Insertbar_Server .) Within the insertbar-insert tag, the code is the same code you entered in insertbar.xml when you created this object. This code tells Dreamweaver to automatically enter that code.

    Listing 29.1. The Complete Code for C_Statement.mxi
     <macromedia-extension       name="Copyright Statement"       version="  1.0.0  "       type="  object  ">       <!-- List the required/compatible products -->       <products>             <product name="Dreamweaver" version="3" primary=  "true" />       </products>       <!-- Describe the author -->       <author name="  Tom Thumb  " />       <!-- Describe the extension -->       <description>       <![CDATA[       Inserts a formatted copyright statement, with user input  for name and year.       ]]>       </description>       <!-- Describe where the extension shows in the product's  UI -->       <ui-access>       <![CDATA[       Access this extension via the ThumbThings category in the  Insert bar.       ]]>       </ui-access>       <!-- Describe the files that comprise the extension -->       <files>             <file name="Copyright Statement.gif" destination="$dreamweaver/configuration/Objects/ThumbThings/" /> <file name="Copyright Statement.htm" destination="$dreamweaver/configuration/Objects/Thumbthings/" />       </files>       <!-- Describe the changes to the configuration -->       <configuration-changes>           <insertbar-changes>                 <insertbar-insert insertAfter="DW_Insertbar_  Server">                    <category folder="ThumbThings"  id="DW_Insertbar_ThumbThings">                    <button enabled="" file="ThumbThings\Copyright Statement.htm" id="DW_ThumbThings_  Copyright" image="ThumbThings\Copyright Statement.gif" showIf="" />                    </category>                 </insertbar-insert>           </insertbar-changes>     </configuration-changes> </macromedia-extension> 

  4. Finally, you package everything together with the Extension Manager. Launch the Extension Manager, and select File > Package Extension. For the name of your extension, choose something descriptive that obeys the standard naming conventions (no empty spaces, no more than 20 characters, no special characters). It's good practice to use the same name you used for the MXI file, just to keep your file organization tidy. Make sure you leave the .mxp extension in place.

    When you're asked to choose a file, choose C_Statement.mxi .

    If there aren't any problems, the Extension Manager generates an extension file in the same folder as the MXI file. If there are problems, you get an error report. Most often, these are problems with the MXI file. Go back to your text editor, fix the reported errors, and try again. Figure 29.17 shows how this process looks in the Extension Manager.

    Figure 29.17. The steps through the packaging process as they appear in the Extension Manager.


  5. Use the Extension Manager to install the new extension. Start by quitting Dreamweaver if it's running. Open the Configuration/Objects folder, and remove the development version. Then open insertbar.xml and delete the code that created your Development category. Finally, install the MXP file using the Extension Manager. (See Chapter 28 for a full discussion of using the Extension Manager to install MXP files.) If everything's hunky dory, you should get an alert message telling you that the extension was installed successfully.

    Your custom extension also should now appear in the Extension Manager window, as shown in Figure 29.18.

    Figure 29.18. The Extension Manager window showing the installed Copyright Statement object.


  6. Finish up by launching Dreamweaver and checking that everything installed correctly.

Submitting Your Extension to the Macromedia Exchange

The ultimate in sharing is submitting your extension file to the Macromedia Exchange. After you have the MXP file, the procedure is simple: Go to the Macromedia Exchange website, and click the Uploads button (in the Your Exchange category, on the right side of the page). Then follow the instructions to submit, as shown in Figure 29.19.

Figure 29.19. The Macromedia Exchange Uploads page.


After you submit an extension, Macromedia engineers run it through a series of tests. One of three things will happen:

  • If it fails, it gets returned to you with comments.

  • If it passes the basic tests, it gets put on the website with Basic Approval.

  • If it also passes the more comprehensive tests, it becomes a Macromedia Approved Extension.

To keep track of your submission's progress, visit the Uploads page periodically.

To learn more about the testing process and how to get your extensions accepted and approved, visit the Dreamweaver website, and click any one of the Site Help FAQ topics. This takes you to an extensive categorized list of questions and answers.

[ LiB ]


Macromedia Dreamweaver MX 2004 Demystified
Macromedia Dreamweaver MX 2004 Demystified
ISBN: 0735713847
EAN: 2147483647
Year: 2002
Pages: 188
Authors: Laura Gutman

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