Adobe 38040334 - Dreamweaver CS3 User Manual page 289

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

Advertisement

In resolving a
searchPatterns
1
Look for the
whereToSearch
If the attribute value starts with
2
in the tag name).
Look for the
3
limitSearch
If the attribute value starts with
4
are allowed in the attribute name).
If these four steps are successful, Dreamweaver assumes a tag/attribute combination. Otherwise, Dreamweaver starts
looking for
searchPattern
defined. (For information about regular expressions, see "Regular expressions" on page 255.)
The following example of a
an attribute (
) to isolate the URL for dependency file checking, path fixing, and so forth:
template
<searchPatterns whereToSearch="tag+cfinclude">
<searchPattern paramNames="include_url" limitSearch="attribute+template" />
</searchPatterns>
The tag/attribute combination (see the previous example) does not apply to translation because Dreamweaver always
translates to straight text in the JavaScript layer. File dependency checking, path fixing, and so on occurs in the C
layer. In the C layer, Dreamweaver internally splits the document into directives (straight text) and tags (parsed into
an efficient tree structure).
Updating server behaviors
By default, participant EDML files do not have an
Replacement update
the participant are updated in the document by replacing them entirely. When a user edits an existing server
behavior and clicks OK, any participant that contains a parameter whose value has changed is removed and
reinserted with the new value in the same location.
If the user customizes participant code in the document, the participant might not be recognized if the search
patterns look for the old code. Shorter search patterns can let the user customize the participant code in their
document; however, updating the server behavior instance can cause the participant to be replaced, which loses the
custom edits.
In some cases, it can be desirable to let users customize the participant code after it is inserted
Precision update
in the document. This situation can be achieved by limiting the search patterns and providing update patterns in the
EDML file. After you add the participant to the page, the server behavior updates only specific parts of it. The
following example shows a simple participant with two parameters:
<% if (Recordset1.EOF) Response.Redirect("some_url_here") %>
This example might use the following search patterns:
<quickSearch>Response.Write</quickSearch>
<searchPatterns whereToSearch="directive">
<searchPattern paramNames="rs,new__url">
/if\s*\((\w+)\.EOF\)\s*Response\.Redirect\("([^\r\n]*)"\)/i
</searchPattern>
</searchPatterns>
The user might add another test to a particular instance of this code, as shown in the following example:
<% if (Recordset1.EOF || x > 2) Response.Redirect("some_url_here") %>
tag, Dreamweaver uses the following algorithm:
attribute within the
searchPatterns
, the remaining string is assumed to be the tag name (no spaces are allowed
tag+
attribute within the
searchPattern
, the remaining string is assumed to be the attribute name (no spaces
attribute+
tags with a
attribute that has a
paramName
tag has no search pattern because it combines a tag (
searchPatterns
tag.
tag.
suffix and a regular expression that is
_url
<updatePatterns>
DREAMWEAVER CS3
Extending Dreamweaver
) with
cfinclude
tag, and instances of
283

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents