beautypg.com

Server model functions, Dom.servermodel.getappurlprefix(), Dom.servermodel.getdelimiters() – Adobe Dreamweaver API Reference CS5 User Manual

Page 378

background image

373

DREAMWEAVER API REFERENCE

Dynamic documents

Last updated 8/27/2013

Server model functions

In Dreamweaver, each document has an associated document type. For dynamic document types, Dreamweaver also
associates a server model (such as ASP-JS, ColdFusion, or PHP-MySQL).

Server models are used to group functionality that is specific to a server technology. Different server behaviors, data
sources, and so forth, appear based on the server model that is associated with the document.

Using the server model functions, you can determine the set of server models that are currently defined; the name,
language, and version of the current server model; and whether the current server model supports a named character
set (such as UTF-8).

Note: Dreamweaver reads all the information in the server model HTML file and stores this information when it first
loads the server model. So, when an extension calls functions such as

dom.serverModel.getServerName(),

dom.serverModel.getServerLanguage(),

and

dom.serverModel.getServerVersion(),

these functions return

the stored values.

dom.serverModel.getAppURLPrefix()

Availability
Dreamweaver MX.

Description
Returns the URL for the site’s root folder on the testing server. This URL is the same as that specified for the Testing
Server on the Advanced tab in the Site Definition dialog box.

When Dreamweaver communicates with your testing server, it uses HTTP (the same way as a browser). When doing
so, it uses this URL to access your site’s root folder.

Arguments
None.

Returns
A string, which holds the URL to the application server that is used for live data and debugging purposes.

Example
If the user creates a site and specifies that the testing server is on the local computer and that the root folder is named

"employeeapp"

, a call to the

dom.serverModel.getAppURLPrefix()

function returns the following string:

http://localhost/employeeapp/

dom.serverModel.getDelimiters()

Availability
Dreamweaver MX.

Description
Lets JavaScript code get the script delimiter for each server model, so managing the server model code can be separated
from managing the user-scripted code.