beautypg.com

Deleting server behaviors – Adobe Extending Dreamweaver CS4 User Manual

Page 294

background image

288

EXTENDING DREAMWEAVER CS4

Server behaviors

Response.Write

/(\w+)\.EOF/

/if\s*\([^\r\n]*\)\s*Response\.Redirect\("([^\r\n]*)"/i

These shortened search patterns are flexible, so the user can add to the code. However, if the server behavior changes
the URL when the user clicks OK, the participant is replaced and the customizations are lost. To update more precisely,
add an

updatePatterns

tag that contains a pattern for updating each parameter:

/(\b)\w+(\.EOF)/\

/(Response\.Redirect\(")[^\r\n]*(")/i

In update patterns, the parentheses are reversed and are placed around the text before and after the parameter. For
search patterns, use the

textBeforeParam(param)textAfterParam

parameter. For update patterns, use the

(textBeforeParam)param(textAfterParam)

parameter. All the text between the two parenthetical subexpressions

is replaced with the new value for the parameter.

Deleting server behaviors

You can delete server behaviors by:

Default deletion and dependency counts

Using delete flags to limit participant deletion

Default deletion and dependency counts
The user can delete an instance that is selected in the Server Behaviors panel by clicking the Minus (-) button or
pressing Delete. All the participants are removed except for the ones that other server behaviors share. Specifically, if
more than one server behavior has a participant pointer to the same node, the node is not deleted.

By default, participants are deleted by removing an entire tag. If the insert location is

wrapSelection

, only the outer

tag is removed. For attributes, the entire attribute declaration is removed. The following example shows an attribute
participant on the

ACTION

attribute of a

form

tag:

After deleting the attribute, only

form

remains.

Using delete flags to limit participant deletion
To limit the way that participants are deleted, add a delete tag to the EDML file. The following example shows a
participant that is an

href

attribute of a link:

Link Text

When this attribute participant is deleted, the resulting tag is

Link Text

, which no longer appears as a link

in Dreamweaver. Deleting only the attribute value is preferred. Deletion is done by adding the following tag to the
participant EDML file:

This manual is related to the following products: