A Simple Server Behavior Example - Adobe 38040334 - Dreamweaver CS3 User Manual

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

Participant files
A participant represents a single code block on the page, such as a server tag, an HTML tag, or an attribute. A partic-
ipant file must be listed in a group file to be available to a Dreamweaver document author. Several group files can use
a single participant file.
For example, the moveTo_declareParam.edml file contains the following code:
<participant>
<quickSearch><![CDATA[MM_paramName]]></quickSearch>
<insertText location="aboveHTML+80">
<![CDATA[
<% var MM_paramName = ""; %>
]]>
</insertText>
<searchPatterns whereToSearch="directive">
<searchPattern><![CDATA[/var\s*MM_paramName/]]></searchPattern>
</searchPatterns>
</participant>
When Dreamweaver adds a server behavior to a document, it needs to have detailed information, including where
to insert the code, what the code looks like, and what parameters the Dreamweaver author or data replaced at
runtime. Each participant EDML file describes these details for each block of code. Specifically, the participant file
describes the following data:
• The code and where to put the unique instance are defined by the
following example:
<insertText location="aboveHTML+80">
• How to recognize instances already on the page are defined by the
example:
<searchPatterns whereToSearch="directive">
<searchPattern><![CDATA[/var\s*MM_paramName/]]></searchPattern>
</searchPatterns>
In the
block tag, each
searchPatterns
and extracts specific parameters. For more details, see "Server behavior techniques" on page 279.
The script file
Each server behavior also has an HTML file that contains functions and links to the scripts that manage the
integration of the server behavior code with the Dreamweaver interface. The functions that are available for editing
in this file are discussed in "Server behavior implementation functions" on page 253.

A simple server behavior example

This example shows the process of creating a new server behavior so you can see the files that Dreamweaver
generates and how to handle them. For details about working with the Server Behavior Builder interface, see "Adding
Custom Server Behaviors" in Getting Started with Dreamweaver. The example displays "Hello World" from the ASP
server. The Hello World behavior has only one participant (a single ASP tag) and does not modify or add anything
else on the page.
To create the behavior, you perform the following steps:
tag contains a pattern that finds instances of runtime code
searchPattern
tag parameters, as shown in the
insertText
tag, as shown in the following
searchPatterns
DREAMWEAVER CS3
245
Extending Dreamweaver

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents