The Server Model Api Functions - Adobe 38040334 - Dreamweaver CS3 User Manual

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

DREAMWEAVER CS3
320
Extending Dreamweaver

The server model API functions

This section describes the functions that configure server models for Dreamweaver.
canRecognizeDocument()
Availability
Dreamweaver MX.
Description
When opening a document (and when more than one server model claims a file extension), Dreamweaver calls this
function for each of the extension-associated server models to see whether any of the functions can identify whether
the document is its file. If more than one server model claims the file extension, Dreamweaver gives priority to the
server model that returns the highest integer.
Note: All Dreamweaver-defined server models return a value of 1, so third-party server models can override the file-
extension association.
Arguments
dom
The
argument is the Adobe document object, which is returned by the
dom
dreamweaver.getDocumentDOM()
function.
Returns
Dreamweaver expects an integer that indicates the priority that you give to the server model for the file extension.
This function should return a value of
if the server model does not claim the file extension; otherwise, this
-1
function should return a value greater than zero.
Example
In the following example, if the user opens a JavaScript document for the current server model, the sample code
returns a value of
. This value lets the current server model take precedence over the Dreamweaver default server
2
model.
var retVal = -1;
var langRE = /@\s*language\s*=\s*(\"|\')?javascript(\"|\')?/i;
// Search for the string language="javascript"
var oHTML = dom.documentElement.outerHTML;
if (oHTML.search(langRE) > -1)
retVal = 2;
return retVal;
getFileExtensions()
Availability
Dreamweaver UltraDev 1, deprecated in Dreamweaver MX.
Description
Returns the document file extensions with which a server model can work. For example, the ASP server model
supports .asp and .htm file extensions. This function returns an array of strings, and Dreamweaver uses these strings
to populate the Default Page Extension list that is found in the App Server category in the Site Definition dialog box.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents