User Guide
The Connection API 103
Unless you need to define connection parameters other than the ones provided in the
standard connection_includefile.edml file, these two steps are the minimum to create a new
connection dialog box.
The functions listed in the next section let you create a connection dialog box. Along with
implementing the calls for generating include files for the user, you can register your
connectivity type within the server model section of the connection XML file.
For information about the Database Connectivity API that is associated with creating a new
connection, see “Database connection functions” on page 70.
The Connection API
To create a new type of connection, including the dialog box with which users interact, you
must implement the following three functions:
findConnection(), inspectConnection(),
and
applyConnection(). You write these three functions and include them in the JavaScript
implementation file that is associated with your new connection type (see Step 2 “Create a
JavaScript file that implements at least the following elements:” on page 102).
The
applyConnection() function returns an HTML source within an include file. You can
see examples of the HTML source in “The generated include file” on page 107. The
findConnection() function takes the HTML source and extracts its properties. You can
implement
findConnection() to use the search patterns in XML files to extract the
information that returns from
applyConnection(). For an example of such an
implementation, see the following two JavaScript files:
■ connection_ado_conn_string.js is located in Configuration/Connections/ASP_Js
folder.
■ connection_common.js is located in Configuration/Connections/Shared folder.
When the user opens a site, Dreamweaver goes through each file in the Connections folder,
opens it, and passes the contents to
findConnection(). If the contents of a file match the
criteria for a valid connection,
findConnection() returns a connection object. Dreamweaver
then lists all the connection objects in the Database Explorer panel.
When the user opens a connection dialog box and selects to create a new connection or
duplicate or edit an existing connection, Dreamweaver calls the
inspectConnection()
function and passes back the same connection object that
findConnection() created. This
process lets Dreamweaver populate the dialog box with the connection information.
NOTE
The title of the dialog box that the user sees is in the title tag, which is specified in the
HTML document.
000_DW_API_Print.book Page 103 Wednesday, July 20, 2005 11:58 AM