beautypg.com

The connection api – Adobe Dreamweaver API Reference CS5 User Manual

Page 85

background image

80

DREAMWEAVER API REFERENCE

The database connectivity API

Last updated 8/27/2013

function getServerModelFolderName()

{

return "ASP_JS";

}

You can also look at the MMDocumentTypes.xml file, which is located in the Configuration/DocumentTypes
folder, to determine the mapping between server models and document types.

2 Create a JavaScript file that implements at least the following elements:

You can select any name for this implementation file, but it must have a .js extension (for example,
myConnectionImpl.js). You can store this implementation file on either your local or a remote computer. You
might want to store your implementation file in the appropriate subfolder within the Configuration/Connections
folder.

Note: The HTML file that you defined in Step 1, Create the layout for the connection dialog box, must include this
connection type implementation file.

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.

Note: The title of the dialog box that the user sees is in the

title

tag, which is specified in the HTML document.

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 55.

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:).

Element

Description

Examples

A set of variables

Each variable defines a specific connection
property

Type of connection, data source name,
and so on

A set of buttons

Each button appears in the connection dialog box

Test, Help, and so on (OK and Cancel are
automatically included)

Connectivity functions

Together, these functions define the Connectivity
API

findConnection()

applyConnection()

inspectConnection()