User Guide
364 Chapter 21: C-Level Extensibility
File Access and Multiuser Configuration API
Macromedia recommends that you always use the File Access and Multiuser Configuration API
to access the file system through C-level extensions. For files other than configuration files, the
functions access the specified file or folder.
Dreamweaver supports multiple-user configurations for the Windows XP, Windows 2000, and
Mac OS X operating systems.
Typically, you install Dreamweaver in a restricted folder such as C:/Program Folders in Windows.
As a result, only users with Administrator privileges can make changes in the Dreamweaver
Configuration folder. To enable users on multiuser operating systems to create and maintain
individual configurations, Dreamweaver creates a separate Configuration folder for each user.
Whenever Dreamweaver or a JavaScript extension writes to the Dreamweaver Configuration
folder, Dreamweaver automatically writes to the user Configuration folder instead. This process
lets each user customize Dreamweaver configuration settings without disturbing the customized
configurations of other users.
Dreamweaver creates the user Configuration folder in a location where the user has full read and
write access. The location of the user’s Configuration folder depends on the user’s platform.
For Windows 2000 and Windows XP platforms:
<drive>:\Documents and Settings\<username>\ ¬
Application Data\Macromedia\Dreamweaver MX 2004\Configuration
Note: In Windows XP, this folder may be inside a hidden folder.
For Mac OS X platforms:
<drive>:Users:<username>:Library:Application Support: ¬
Macromedia:Dreamweaver MX 2004:Configuration
There are many cases where JavaScript extensions open files and write to the Configuration
folder. JavaScript extensions can access the file system by using DWFile, MMNotes, or passing a
URL to the
dreamweaver.getDocumentDOM() function. When an extension accesses the file
system in a Configuration folder, it generally uses the
dw.getConfigurationPath() function
and adds the filename, or it gets the path by accessing the
dom.URL property of an open document
and adding the filename. An extension can also get the path by accessing the
dom.URL and
stripping the filename. The
dw.getConfigurationPath() function and the dom.URL property
always return a URL in the Dreamweaver Configuration folder, even if the document is located in
the user Configuration folder.
Any time a JavaScript extension opens a file in the Dreamweaver Configuration folder,
Dreamweaver intercepts the access and checks the user Configuration folder first. If a JavaScript
extension saves data to disk in the Dreamweaver Configuration folder through DWFile or
MMNotes, Dreamweaver intercepts the call and redirects it to the user Configuration folder.
For example, in Windows 2000 or Windows XP, if the user asks for "
file:///C|/Program
Files/Macromedia/Dreamweaver/Configuration/Objects/Common/Table.htm
",
Dreamweaver searches for a Table.htm file in the C:/Documents and Settings/username/
Macromedia/Dreamweaver/Configuration/Objects/Common folder and, if it exists, uses
it instead.