Creating the data source definition file

The data source definition file tells Adobe Dreamweaver the name of the data source as it will appear in the Bindings Plus (+) menu and also tells Adobe Dreamweaver where to find the supporting JavaScript files for the data source implementation.

When a user clicks on the Bindings Plus (+) menu, Adobe Dreamweaver searches the DataSources folder for the current server model to gather all available data sources defined in the folder's HTML (HTM) files. So, to make a new data source available to the user, you need to create a data source definition file that simply provides the name of the data source using the TITLE tag and the location of all supporting JavaScript files using the SCRIPT tag.

In addition, several supporting files are necessary for implementing this data source. In general, you might not need to use the functions in these supporting files, but they are often useful (and necessary in this example). For example, the dwscriptsServer.js file contains the dwscripts.stripCFOutputTags() function used in the implementation of this data source. And, using the DataSourceClass.js file, you create an instance of the DataSource class to use as the return value of the findDynamicSources() function.

To create the data source definition file:

  1. Create a new blank file.
  2. Enter the following:
    <HTML><HEAD><TITLE>MyDatasource</TITLE><SCRIPT SRC="../../Shared/Common/Scripts/dwscripts.js"></SCRIPT><SCRIPT SRC="../../Shared/Common/Scripts/dwscriptsServer.js"></SCRIPT><SCRIPT SRC="../../Shared/Common/Scripts/DataSourceClass.js"></SCRIPT><SCRIPT SRC="MyDatasource.js"></SCRIPT></HEAD><body></body></HTML>
  3. Save the file as MyDatasource.htm in the Configuration/DataSources/ColdFusion folder.