Specifications

191
CHAPTER 15
Data Sources
The Dreamweaver MX Data Sources API functions let you add data sources, which appear in the
plus (+) menu of the Bindings panel (see dreamweaver.dbi.getDataSources on page 408).
Data source files are stored in the Configuration/DataSources folder. Each of the following server
models has its own folder: ASP.Net/C#, ASP.Net/VisualBasic, ASP/JavaScript, ASP/VBScript,
ColdFusion, JSP, and PHP/MySQL. Within each server model subfolder are HTML and EDML
files that are associated with the data sources for that server model.
How data sources work
Dreamweaver users can add dynamic data by using the Bindings panel. The dynamic data objects
shown on the plus (+) menu are based on the server model that is specified for the page. For
example, users can insert recordsets, commands, request variables, session variables, and
application variables for ASP applications.
The following steps describe the process that is involved in adding dynamic data:
1 When the user clicks the plus (+) menu in the Bindings panel, a pop-up menu appears.
To determine the contents of the menu, Dreamweaver first looks for a DataSources.xml file in
the same folder as the data sources (for example, Configuration/DataSources/ASP_Js/
DataSources.xml). The DataSources.xml file describes the contents of the pop-up menu; it
contains references to the HTML files that should be placed in the pop-up menu.
Dreamweaver checks each referenced HTML file for a title tag. If the file contains a title tag,
the content of the title tag appears in the menu. If the file does not contain a title tag, the
filename is used in the menu.
After Dreamweaver finishes reading the DataSources.xml file or if the file does not exist,
Dreamweaver scans the rest of the folder to find other items that should appear in the menu. If
Dreamweaver finds files in the main folder that arent in the menu, it adds them to the menu.
If subfolders contain files that arent in the menu, Dreamweaver creates a submenu and adds
those files to the submenu.
2 When the user chooses an item from the plus (+) menu, Dreamweaver calls the
addDynamicSource() function, so that code for the data source is added to the users document.