Opening a document in Adobe Dreamweaver
When a user opens a file, Adobe Dreamweaver follows a series of steps to identify the document type based on the file's extension.
If Adobe Dreamweaver successfully finds a unique document type, Adobe Dreamweaver uses that type and loads the associated server model (if any) for the document that the user is opening. If the user has selected to use Adobe Dreamweaver UltraDev 4 server behaviors, Adobe Dreamweaver loads the appropriate UltraDev 4 server model.
If the file extension maps to more than one document type, Adobe Dreamweaver performs the following actions:
- If a static document type is among the list of document types, it gets preference.
- If all the document types are dynamic, Adobe Dreamweaver creates an alphabetical list of the server models that are associated with these document types and then calls the
canRecognizeDocument()
function in each server model (see canRecognizeDocument()). Adobe Dreamweaver collects the return values and determines which server model returned the highest valued positive integer. The document type whose server model returns the highest integer is the document type that Adobe Dreamweaver assigns to the document being opened. If, however, more than one server model returns the same integer, Adobe Dreamweaver goes through the alphabetical list of those server models, picks the first in the list, and uses that document type. For example, if both ASP-JS and ASP-VB claim an ASP document and if their respectivecanRecognizeDocument()
functions return equal values, Adobe Dreamweaver assigns the document to ASP-JS (because, alphabetically, ASP-JS is first).
If Adobe Dreamweaver cannot map the file extension to a document type, Adobe Dreamweaver opens the document as a text file.