beautypg.com

Server behavior functions, Dreamweaver.getparticipants() – Adobe Dreamweaver API Reference CS5 User Manual

Page 376

background image

371

DREAMWEAVER API REFERENCE

Dynamic documents

Last updated 8/27/2013

Dreamweaver 13.1 and later

DW code:
liveViewBrowser = document.getElementById('browser');
liveViewBrowser.getWindow().SetExtensionName("DreamweaverExtension");
Live View () Code:
function SetExtensionName(name)
{
document.extensionName = name;
}

Server behavior functions

Server behavior functions let you manipulate the Server Behaviors panel, which you can display by selecting Window
> Server Behaviors. Using these functions, you can find all the server behaviors on a page and programmatically apply
a new behavior to the document or modify an existing behavior.

Note: You can abbreviate

dw.serverBehaviorInspector

to dw.sbi.

dreamweaver.getParticipants()

Availability
Dreamweaver UltraDev 4.

Description
The JavaScript function,

dreamweaver.getParticipants()

, gets a list of participants from the user’s document.

After Dreamweaver finds all the behavior’s participants, it stores those lists. Typically, you use this function with the

findServerBehaviors()

function (for more information, see “Server Behaviors” in Extending Dreamweaver) to

locate instances of a behavior in the user’s document.

Arguments
edmlFilename

The edmlFilename argument is the name of the group or participant file that contains the names of the participants
to locate in the user’s document. This string is the filename, without the .edml extension.

Returns
This function returns an array that contains all instances of the specified participant (or, in the case of a group file, any
instance of any participant in the group) that appear in the user’s document. The array contains JavaScript objects,
with one element in the array for each instance of each participant that is found in the user’s document. The array is
sorted in the order that the participants appear in the document. Each JavaScript object has the following properties:

The participantNode property is a pointer to the participant node in the user’s document.

The participantName property is the name of the participant’s EDML file (without the .edml extension).

The parameters property is a JavaScript object that stores all the parameter/value pairs.

The matchRangeMin property defines the character offset from the participant node of the document to the
beginning of the participant content.

The matchRangeMax property is an integer of the participant that defines the offset from the beginning of the
participant node to the last character of the participant content.