Search pattern resolution – Adobe Extending Dreamweaver CS4 User Manual
Page 292
286
EXTENDING DREAMWEAVER CS4
Server behaviors
<% total = Recordset1.Fields.Item("itemPrice").Value * 1.0825 %>
<% total = Recordset1.Fields.Item("salePrice").Value * 1.0825 %>
The total0(with taxes) is $<%=total%>
Sale price (with taxes) is $<%=total%>
This server behavior no longer works correctly because only one parameter is named
total
. To solve this problem,
make sure that a parameter with a unique value exists and that it can be used to match the participants. In the following
example, you could make the
total
variable name unique using the column name:
<% itemPrice_total = Recordset1.Fields.Item("itemPrice").Value * 1.0825 %>
<% salePrice_total = Recordset1.Fields.Item("salePrice").Value * 1.0825 %>
The total0(with taxes) is $<%=itemPrice_total%>
Sale price (with taxes) is $<%=salePrice_total%>
The search patterns now uniquely identify and match the participants.
Search pattern resolution
Dreamweaver supports the following actions by using the participant
searchPatterns
functionality:
•
File transfer dependency
•
Updating the file paths for any file reference (such as those for include files)
When Dreamweaver creates server models, it builds lists of patterns by scanning all the participants for special
paramNames
attributes. To find URLs to check file dependency and to fix the pathname, Dreamweaver uses each
searchPattern
tag in which one of the
paramNames
attribute ends with
_url
. Multiple URLs can be specified in a
single
searchPattern
tag.
For each translator
searchPattern
tag that has a
paramNames
attribute value that ends with
_includeUrl
,
Dreamweaver uses that
searchPattern
tag to translate include file statements on the page. Dreamweaver uses a
different suffix string to identify include file URLs because not all URL references are translated. Also, only a single
URL can be translated as an include file.
In resolving a
searchPatterns
tag, Dreamweaver uses the following algorithm:
1
Look for the
whereToSearch
attribute within the
searchPatterns
tag.
2
If the attribute value starts with
tag+
, the remaining string is assumed to be the tag name (no spaces are allowed in
the tag name).
3
Look for the
limitSearch
attribute within the
searchPattern
tag.
4
If the attribute value starts with
attribute+
, the remaining string is assumed to be the attribute name (no spaces
are allowed in the attribute name).
If these four steps are successful, Dreamweaver assumes a tag/attribute combination. Otherwise, Dreamweaver starts
looking for
searchPattern
tags with a
paramName
attribute that has a
_url
suffix and a regular expression that is
defined. (For information about regular expressions, see “
The following example of a
searchPatterns
tag has no search pattern because it combines a tag (
cfinclude
) with
an attribute (
template
) to isolate the URL for dependency file checking, path fixing, and so forth: