110
Chapter 8: The Database Connectivity API
Note:
If you change the format of your include file or define an include file for a new server model, you
need to map the connection parameters with the Dreamweaver UI, Live Data, and Preview In
Browser. The following sample EDML file, which is associated with the default ASP JS server model,
maps all connection page variables with their respective live values before sending the page to the
server. For more information on EDML and regular expression search patterns, see “Server
Behaviors” in
Extending Dreamweaver
.
<participant name="connection_includefile" version="5.0">
<quickSearch>
<![CDATA[// HTTP=]]></quickSearch>
<insertText location="">
<![CDATA[<%
// FileName="@@filename@@"
// Type="@@type@@" @@designtimeString@@
// DesigntimeType="@@designtimeType@@"
// HTTP="@@http@@"
// Catalog="@@catalog@@"
// Schema="@@schema@@"
var MM_@@cname@@_STRING = @@string@@
%>
]]>
</insertText>
<searchPatterns whereToSearch="directive">
<searchPattern paramNames="filename">
<![CDATA[/\/\/\s*FileName="([^"]*)"/]]></searchPattern>
<searchPattern paramNames="type,designtimeString">
<![CDATA[/\/\/\s+Type="(\w*)"([^\r\n]*)/]]></searchPattern>
<searchPattern paramNames="designtimeType" isOptional="true">
<![CDATA[/\/\/\s*DesigntimeType="(\w*)"/]]></searchPattern>
<searchPattern paramNames="http">
<![CDATA[/\/\/\s*HTTP="(\w+)"/]]></searchPattern>
<searchPattern paramNames="catalog">
<![CDATA[/\/\/\s*Catalog="(\w*)"/]]></searchPattern>
<searchPattern paramNames="schema">
<![CDATA[/\/\/\s*Schema="(\w*)"/]]></searchPattern>
<searchPattern paramNames="cname,string">
<![CDATA[/var\s+MM_(\w*)_STRING\s*=\s*([^\r\n]+)/]]></searchPattern>
</searchPatterns>
</participant>
Tokens in an EDML file—such as
@@filename@@
in this example—map values in the include
file to properties of a connection object. You set the properties of connection objects in the
JavaScript implementation file.
All the default connection dialog boxes that come with Dreamweaver use the
connection_includefile.edml mapping file. To let Dreamweaver find this file, its name is set in the
JavaScript implementation file, as shown in the following example:
var PARTICIPANT_FILE = "connection_includefile";
When you create a custom connection type, you can use any mapping file in your custom dialog
boxes. If you create a mapping file, you can use a name other than connection_includefile for
your EDML file. If you use a different name, you need to use this name in your JavaScript
implementation file when you specify the value that is assigned to the
PARTICIPANT_FILE
variable, as shown in the following example:
var PARTICIPANT_FILE = "myConnection_mappingfile";
000_DW_API_Print.book Page 110 Wednesday, August 20, 2003 9:14 AM
Summary of Contents for DREAMWEAVER MX 2004-DREAMWEAVER API
Page 1: ...Dreamweaver API Reference...
Page 24: ...24 Contents...
Page 32: ......
Page 70: ...70 Chapter 5 Fireworks Integration...
Page 76: ...76 Chapter 6 Flash Integration...
Page 116: ...116 Chapter 9 The JavaBeans API...
Page 140: ......
Page 152: ...152 Chapter 11 Application...
Page 218: ...218 Chapter 12 Workspace...
Page 248: ...248 Chapter 13 Site...
Page 292: ...292 Chapter 14 Document...
Page 378: ...378 Chapter 17 Design...
Page 430: ...430 Chapter 18 Code...
Page 486: ...486 Index...