Specifications
Chapter 14188
The tag/attribute combination (see the previous example) does not apply to translation because
Dreamweaver always translates to straight text in the JavaScript layer, whereas 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
Replacement update By default, participant EDML files do not have an <updatePatterns> tag,
and instances of 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.
Precision update In some cases, it can be desirable to let users customize the participant code after
it is inserted in the document. This can be achieved by limiting the search patterns and providing
update patterns in the EDML file. After the participant is added to the page, only specific parts
of it are updated by the server behavior. The following example shows a simple participant with
two parameters:
<% if (Recordset1.EOF) Response.Redirect("some_url_here") %>
The 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") %>
The search patterns fail because they are looking for a parenthesis after the EOF. To make the
search patterns more forgiving, you can shorten them by splitting them up:
<quickSearch>Response.Write</quickSearch>
<searchPatterns whereToSearch="directive">
<searchPattern paramNames="rs">/(\w+)\.EOF/</searchPattern>
<searchPattern paramNames="new__url">
/if\s*\([^\r\n]*\)\s*Response\.Redirect\("([^\r\n]*)"/i
</searchPattern>
</searchPatterns>