beautypg.com

Chapter 9: the database connectivity api, Select a new connection type, Develop a new connection type – Adobe Dreamweaver API Reference CS5 User Manual

Page 84: The database connectivity api

background image

79

Last updated 8/27/2013

Chapter 9: The database connectivity API

As a developer, you can create new connection types and corresponding dialog boxes for new or existing server models
for Adobe® Dreamweaver®. Then, a user can create a connection object when setting up a site to start building pages.
To create a connection object, the user has to first select the particular type of connection that you created.

Select a new connection type

The user can select your new connection type in the following ways:

On the Application panel, the user can click the Plus (+) button and select Recordset. In the Recordset dialog box,
the user can expand the Connection pop-up menu.

On the Database tab of the Databases panel, the user can click the Plus (+) button and select Data Source Name.

Develop a new connection type

The following steps outline the process for creating a new connection type:

1 Create the layout for the connection dialog box.

Create an HTML file that lays out the user interface (UI) for your connection dialog box. Name this file using the
name of the connection (for example, myConnection.htm). For information about creating a dialog box, see
Getting Started with Dreamweaver.

Make sure this HTML file includes a reference to the JavaScript implementation file that you define in Step 2, Create
a JavaScript file that implements at least the following elements, as shown in the following example:

Store this HTML file, which defines your connection dialog box, in the Configuration/Connections/server-
model/platform
folder (where the platform is either Windows or Macintosh).

For example, the default ADO connection dialog box for an ASP JavaScript document on a Windows platform is
stored in the ASP_Js/Win folder and is named Connection_ado_conn_string.htm.

Note: At runtime, Dreamweaver dynamically builds the list of connection types that are available to the user from the
collection of dialog boxes that are in the ASP_Js/Win folder.

The Configuration/ServerModels folder has HTML files that define each server model. Inside each HTML file is
the

getServerModelFolderName()

function, which returns the name of the folder that is associated with the

server model. The following example shows the function for the ASP JavaScript document type: