Making Sense of the .MXI format
Dreamweaver's .mxi format for creating an extension with the Extension manager may seem very confusing at first, but it's actually quite simple once you break it down. Below I describe a very basic .mxi file used to package one of my own extensions. You can also view the entire example without any comments.
The first tag, 'macromedia-extension' encloses all of your data, and describes your extension name, version and type. Almost all extensions will require a restart, so leave it as "True" if you're unsure. The whole file is in XML format, so make sure all the tags are closed and nested properly (well-formed).
<macromedia-extension
name="DW Backup"
version="1.0.1"
type="command"
requires-restart="True">
The 'products' tag describes what products the extension works with, and the version. Version 6 is the MX series of products, there is no version 5.
<products>
<product name="Dreamweaver" version="6" primary="true" />
<product name="Dreamweaver" version="4" />
</products>
The 'author' tag simply indicates your name and/or company.
<author name="Benjamin S. Shive @ Cybra.Net" />
The 'description tag' describes your extension and what it does. To have an empty line when the text is displayed you must insert two blank lines, not one.
<description>
<![CDATA[Summary of ... textcut ... 2003/. ]]>
</description>
The 'ui-access' tag describes how to access your extension once in the application.
<ui-access>
<![CDATA['Backup Preferences' resides ... textcut ... the preferences.]]>
</ui-access>
The 'files' tag contains information about what files are part of the extension and where they go in Dreamweaver's configuration folder. I've found the simplest way when packaging is to place all of the files involved in a folder with the .mxi file, so you don't have to worry about the source paths. The 'source' attribute will then be the name of the file, and the 'destination' where the file will be placed when the extension is installed. The '$dreamweaver' is a variable for the Dreamweaver root directory.
<files>
<file source="BackupPreferences.htm" destination="$dreamweaver/Configuration/Commands" />
<file source="TimestampBackup_afterSave.htm" destination="$dreamweaver/Configuration/Commands" />
<file source="TimestampBackup_onOpen.htm" destination="$dreamweaver/Configuration/Commands" />
<file source="TimestampBackup.js" destination="$dreamweaver/Configuration/Shared/Cybra.Net" />
<file source="backup_settings.xml" destination="$dreamweaver/Configuration/Shared/Cybra.Net" />
<file source="cybranet.gif" destination="$dreamweaver/Configuration/Shared/Cybra.Net" />
</files>
The 'configuration-changes' details the changes to insert the new extension to Dreamweaver's menus if needed. It is very flexible, and has many other options, but at the simplest level you just want to add your command to an existing menu.
<configuration-changes>
The 'menu-insert' tag describes where the new entry will go. I would reccomend always using 'appendTo' when adding a menu item. It's value, 'DWMenu_Edit' corresponds to the 'Edit' menu, and 'DWMenu_Commands' corresponds to the 'Commands' menu, and so on. In this case, we are adding the new menu entry at the end of the 'Edit' menu.
<menu-insert appendTo="DWMenu_Edit" skipSeparator="true">
The 'menuitem' tag gives the text of the new menu item and the file that is called when the menu item is selected. The 'id' is also defined and must be unique, so use something long and descriptive to be safe.
<menuitem name="Backup Preferences"
file="Commands\BackupPreferences.htm"
id="MENU_CYBRANET_BACKUP"
/>
Closing tags.
</menu-insert>
</configuration-changes>
</macromedia-extension>
That's it! Once you understand the basics and gotten one extension packaged, it's a snap. There are other options available, but once you get the basics the documentation and all of the options won't seem so overwhelming.



