Adobe 38040334 - Dreamweaver CS3 User Manual page 286

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

Advertisement

The search string is defined as a regular expression by starting and ending with a slash (/) and is followed by
means that it is not case-sensitive. Within the regular expression, special characters such as parentheses () and
periods (.) are escaped by preceding them with a backslash (\). The two parameters
from the string by using parenthetical subexpressions (the parameters must be enclosed in parentheses). In this
example,
and
(\w+)
([^\r\n]*)
that are normally returned by
Optional search patterns
are not found. You might have a participant that stores some optional information such as a telephone number. For
such an example, you could use the following ASP code:
<% //address block
LNAME = "joe";
FNAME = "smith";
PHONE = "123-4567";
%>
You could use the following search patterns:
<quickSearch>address</quickSearch>
<searchPatterns whereToSearch="directive">
<searchPattern paramNames="lname">/LNAME\s*=\s*"([^\r\n]*)"/i</searchPattern>
<searchPattern paramNames="fname">/FNAME\s*=\s*"([^\r\n]*)"/i</searchPattern>
<searchPattern paramNames="phone">/PHONE\s*=\s*"([^\r\n]*)"/i</searchPattern>
</searchPatterns>
In the previous example, the telephone number must be specified. However, you can make the telephone number
optional, by adding the
isOptional
<quickSearch>address</quickSearch>
<searchPatterns whereToSearch="directive">
<searchPattern paramNames="lname">/LNAME\s*=\s*"([^\r\n]*)"/i</searchPattern>
<searchPattern paramNames="fname">/FNAME\s*=\s*"([^\r\n]*)"/i</searchPattern>
<searchPattern paramNames="phone" isOptional="true">/PHONE\s*=\s*"([^\r\n]*)"/i¬
</searchPattern>
</searchPatterns>
Now the participant is recognized, even if the telephone number is not found.
How participants are matched
identified in the user's document and matched. If the user applies multiple instances of the server behavior to a
document, each group of participants must be matched accordingly. To ensure participants are matched correctly,
you might need to change or add parameters and construct participants so they can be uniquely identified.
Matching requires some rules. Participants are matched when all parameters with the same name have the same
value. Above and below the
values. Within the
html.../html
common nodes that are used for insertion.
Participants without parameters are automatically matched, as shown in the following example of a server behavior
with group file:
indicate the parameters. These values correspond to the regular expression values
and
.
$1
$2
There might be cases where you want to identify a participant even if some parameters
attribute, as shown in the following example:
If a server behavior has more than one participant, the participants must be
tag, there can be only one instance of a participant with a given set of parameter
html
tags, participants are also matched by their position relative to the selection or to
DREAMWEAVER CS3
Extending Dreamweaver
, which
i
and
are extracted
rs
new_url
280

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents