Site functions handle operations that are related to files in the site files. These functions let you perform the following tasks:
Create links between files
Get, place, check in, and check out files
Select and deselect files
Create and remove files
Get information about the sites that the user has defined
Import and export site information
dom.getSiteURLPrefixFromDoc()
Availability
Dreamweaver 8.
Description
This function gets the site URL prefix that is extracted from the HTTP address defined in the Local Info section of the Site Definition dialog box.
Arguments
None.
Returns
A string, which specifies the site URL prefix.
Example
The following example gets the site URL prefix for the current document:
var currentDOM = dw.getDocumentDOM(); var sitePrefix = currentDOM.getSiteURLPrefixFromDoc();
dom.localPathToSiteRelative()
Availability
Dreamweaver 8.
Description
This function converts a local file path to a site-relative URI reference.
Arguments
localFilePath
The localFilePath attribute, which is required, is a string that contains the path to a local file on your local computer.
Returns
A string, which specifies the site-relative URI.
Example
The following example returns "/myWebApp/myFile.cfm", based on your site mappings and the HTTP address specified in the Local Info section of the Site Definition dialog box.
var dom = dw.getDocumentDOM(); var siteRelativeURI = dom.localPathToSiteRelative("C:\Inetpub\wwwroot\siteA\myWebApp\myFile.cfm")
dom.siteRelativeToLocalPath()
Availability
Dreamweaver 8.
Description
This function converts a site-relative URI reference to a local file path.
Arguments
siteRelativeURI
The siteRelativeURI attribute, which is required, is a string that contains the site-relative URI.
Returns
A string, which specifies the path to a local file on your local computer.
Example
The following
var filePath = siteRelativeToLocalPath("/myWebApp/myFile.xml");
returns "C:\Inetpub\wwwroot\siteA\myFile.xml", based on your site mappings and the HTTP address specified in the Local Info section of the Site Definition dialog box.
dreamweaver.compareFiles()
Availability
Dreamweaver 8.
Description
This function launches the file comparison tool that the user installed in the Diff section of the Preferences dialog box.
Arguments
file1, file2
The file1 attribute, which is required, is a string that contains the full path to the first file to compare.
The file2 attribute, which is required, is a string that contains the full path to the second file to compare.
Returns
Nothing.
Example
The following example compares two files, red.htm and blue.htm:
dw.compareFiles(hc:\data\red.htm", "e:\data\blue.htm");
dreamweaver.loadSitesFromPrefs()
Availability
Dreamweaver 4.
Description
Loads the site information for all the sites from the system registry (Windows) or the Dreamweaver Preferences file (Macintosh) into Dreamweaver. If a site is connected to a remote server when this function is called, the site is automatically disconnected.
Arguments
None.
Returns
Nothing.
dreamweaver.saveSitesToPrefs()
Availability
Dreamweaver 4.
Description
Saves all information for each site that the user has defined to the system registry (Windows) or the Dreamweaver Preferences file (Macintosh).
Arguments
None.
Returns
Nothing.
dreamweaver.siteSyncDialog.compare()
Availability
Dreamweaver 8.
Description
This function runs the file compare application specified in the File Compare Category of the Preferences dialog box to compare the selected files on the local and remote sites.
Arguments
None.
Returns
Nothing.
Enabler
dreamweaver.siteSyncDialog.markDelete()
Availability
Dreamweaver 8.
Description
This function changes the action for the selected items in the Site Synchronization dialog box to Delete.
Arguments
None.
Returns
Nothing.
Enabler
dreamweaver.siteSyncDialog.markGet()
Availability
Dreamweaver 8.
Description
This function changes the action for the selected items in the Site Synchronization dialog box to Get.
Arguments
None.
Returns
Nothing.
Enabler
dreamweaver.siteSyncDialog.markIgnore()
Availability
Dreamweaver 8.
Description
This function changes the action for the selected items in the Site Synchronization dialog box to Ignore.
Arguments
None.
Returns
Nothing.
Enabler
dreamweaver.siteSyncDialog.markPut()
Availability
Dreamweaver 8.
Description
This function changes the action for the selected items in the Site Synchronization dialog box to Put.
Arguments
None.
Returns
Nothing.
Enabler
dreamweaver.siteSyncDialog.markSynced()
Availability
Dreamweaver 8.
Description
This function changes the action for the selected items in the Site Synchronization dialog box to Synced.
Arguments
None.
Returns
Nothing.
Enabler
dreamweaver.siteSyncDialog.toggleShowAllFiles()
Availability
Dreamweaver 8.
Description
This function lets you see which files Dreamweaver thinks are the same on the remote and local sites in the Site Synchronize preview dialog box. If the function is called when the Show All Files checkbox is selected, it deselects it; conversely, if the Show all Files checkbox is not selected, this function selects it.
Arguments
None.
Returns
Nothing.
site.addLinkToExistingFile()
Availability
Dreamweaver 3.
Description
Opens the Select HTML File dialog box to let the user select a file and creates a link from the selected document to that file.
Arguments
None.
Returns
Nothing.
site.changeLinkSitewide()
Availability
Dreamweaver 3.
Description
Opens the Change Link Sitewide dialog box.
Arguments
None.
Returns
Nothing.
site.changeLink()
Availability
Dreamweaver 3.
Description
Opens the Select HTML File dialog box to let the user select a new file for the link.
Arguments
None.
Returns
Nothing.
site.checkIn()
Availability
Dreamweaver 3.
Description
Checks in the selected files and handles dependent files in one of the following ways:
If the user selects Prompt on Put/Check In in the Site FTP preferences, the Dependent Files dialog box appears.
If the user previously selected the Don’t Show Me Again option in the Dependent Files dialog box and clicked Yes, dependent files are uploaded and no dialog box appears.
If the user previously selected the Don’t Show Me Again option in the Dependent Files dialog box and clicked No, dependent files are not uploaded and no dialog box appears.
Arguments
siteOrURL
The siteOrURL argument must be the keyword "site", which indicates that the function should act on the selection in the Files panel or the URL for a single file.
Returns
Nothing.
Enabler
See site.canCheckIn().
site.checkLinks()
Availability
Dreamweaver 3.
Description
Opens the Link Checker dialog box and checks links in the specified files.
Arguments
scopeOfCheck
The scopeOfCheck argument specifies the scope of the link checking. The value must be "document", "selection", or "site".
Returns
Nothing.
site.checkOut()
Availability
Dreamweaver 3.
Description
Checks out the selected files and handles dependent files in one of the following ways:
If the user selects Prompt on Get/Check Out in the Site FTP preferences, the Dependent Files dialog box appears.
If the user previously selected the Don’t Show Me Again option in the Dependent Files dialog box and clicked Yes, dependent files are downloaded and no dialog box appears.
If the user previously selected the Don’t Show Me Again option in the Dependent Files dialog box and clicked No, dependent files are not downloaded and no dialog box appears.
Arguments
siteOrURL
The siteOrURL argument must be the keyword "site", which indicates that the function should act on the selection in the Files panel or the URL for a single file.
Returns
Nothing.
Enabler
See site.canCheckOut().
site.checkTargetBrowsers()
Availability
Dreamweaver 3.
Description
Runs a target browser check on the selected files.
Arguments
None.
Returns
Nothing.
site.cloak()
Availability
Dreamweaver MX.
Description
Cloaks the current selection in the Files panel or the specified folder.
Arguments
siteOrURL
The siteOrURL argument must contain one of the following two values:
The keyword "site", which indicates that cloak() should act on the selection in the Files panel.
The URL of a particular folder, which indicates that cloak() should act on the specified folder and all its contents.
Returns
Nothing.
Enabler
See site.canCloak().
site.compareFiles()
Availability
Dreamweaver 8.
Description
This function launches the Diff tool integration application to compare two files.
Arguments
url
The url argument, which is required, must contain one of the following two values:
The keyword "site", which indicates that compare() should act on the selection in the Files panel.
The URL of a local file to compare with its remote version.
Returns
A Boolean value: true if the compare succeeded; false otherwise.
Enabler
Example
The following example compares the files selected in the Files panel with their remote versions:
site.compareFiles("site");
site.defineSites()
Availability
Dreamweaver 3.
Description
This function opens the Site Definition dialog box.
Arguments
None.
Returns
Nothing.
site.deleteSelection()
Availability
Dreamweaver 3.
Description
Deletes the selected files.
Arguments
None.
Returns
Nothing.
site.deployFilesToTestingServerBin()
Availability
Dreamweaver MX.
Description
Puts a specified file (or files) in the testing server’s bin folder. If the current site does not have any settings defined for deploying supporting files, this function starts the Deploy Supporting Files To Testing Server dialog box.
Arguments
filesToDeploy
The filesToDeploy argument is an array of filenames that Dreamweaver will deploy.
Returns
A Boolean value: true if the files deploy successfully; false otherwise.
Example
This example deploys the files image1.jpg and script1.js to the testing server’s bin folder:
site.deployFilesToTestingServerBin("image1.jpg", "script1.js");
site.displaySyncInfoForFile()
Availability
Dreamweaver CS3.
Description
Presents a dialog box that contains the local, remote, and testing times of the file corresponding to the parameter passed. This information is stored in the synchronization dwsync.xml file.
The dialog box displays four times:
The Local Remote Time, which indicates for the local file, the time stamp of the last put or get command to the remote server.
The Remote Time, which indicates for the file on the remote server, the time stamp of the last get or put command to the remote server.
The Local Testing Time, which indicates for the local file, the time stamp of the last get or put command to the testing server.
The Testing Time, which indicates for the file on the testing server, the time stamp of the last get or put command to the testing server.
If the dwsync.xml file does not contain any information for the file, a message appears indicating that no information is available. If the time is set in the XML file, it is displayed in the date/time format for the locale (such as: 6/24/05 2:43pm). If the time isn't set in the entry for the file, a dash (-) is displayed.
This function works on the selected file in the Local File View, if 'site' is passed, or the file corresponding to the local URL, if a URL is passed.
Arguments
path, 'site'
path is the URL to a local file.
'site' indicates that the function uses the file selected in the Files panel.
Returns
Nothing.
Enabler
site.editColumns()
Description
This function displays the Site Definition dialog box, which shows the File View Columns section.
Arguments
None.
Returns
Nothing.
site.exportSite()
Availability
Dreamweaver MX; updated in Dreamweaver CS4.
Description
Exports a Dreamweaver site to an XML file, which can be imported into another Dreamweaver instance to duplicate the former site.
All the information that is contained in the Site Definition dialog box is saved in an XML file. It includes the list of cloaked folders and information about the default document type. The exception is that the user can omit the user login and password when FTP access is set.
Arguments
siteName, {askAboutLoginInfo}, {warnAboutSCS}, {savePath}
The siteName argument identifies the site to export. If siteName is an empty string, Dreamweaver exports the current site.
The askAboutLoginInfo argument specifies whether the user is shown a dialog box asking them if they want to save their login information. This argument is optional.
The warnAboutSCS argument lets you control whether the user is shown a warning about login information not being saved if they access their site via source control. This argument is optional.
The savePath argument is the local path to a folder (for example, C:\sites\mySites\). If you supply a savePath, the .ste file is always saved with the name of the site. This argument is optional.
Returns
A Boolean value: true if the named site exists and if the XML file is successfully exported; false otherwise.
Example
The following example shows a sample XML file that Dreamweaver creates when you export a site:
<?xml version="1.0" ?> <site> <localinfo sitename="DW00" localroot="C:\Documents and Settings\jlondon\Desktop\DWServer\" imagefolder="C:\Documents and Settings\jlondon\Desktop\DWServer\Images\" spacerfilepath="" refreshlocal="TRUE" cache="FALSE" httpaddress="http://" curserver="webserver" /> <remoteinfo accesstype="ftp" host="dreamweaver" remoteroot="kojak/" user="dream" checkoutname="Jay" emailaddress="jay@Adobe.com" usefirewall="FALSE" usepasv="TRUE" enablecheckin="TRUE" checkoutwhenopen="TRUE" /> <designnotes usedesignnotes="TRUE" sharedesignnotes="TRUE" /> <sitemap homepage="C:\Documents and Settings\jlondon\Desktop\DWServer\Untitled-2.htm" pagesperrow="200" columnwidth="125" showdependentfiles="TRUE" showpagetitles="FALSE" showhiddenfiles="TRUE" /> <fileviewcolumns sharecolumns="TRUE"> <column name="Local Folder" align="left" show="TRUE" share="FALSE" builtin="TRUE" localwidth="180" remotewidth="180" /> <column name="Notes" align="center" show="TRUE" share="FALSE" builtin="TRUE" localwidth="36" remotewidth="36" /> <column name="Size" align="right" show="TRUE" share="FALSE" builtin="TRUE" localwidth="-2" remotewidth="-2" /> <column name="Type" align="left" show="TRUE" share="FALSE" builtin="TRUE" localwidth="60" remotewidth="60" /> <column name="Modified" align="left" show="TRUE" share="FALSE" builtin="TRUE" localwidth="102" remotewidth="102" /> <column name="Checked Out By" align="left" show="TRUE" share="FALSE" builtin="TRUE" localwidth="50" remotewidth="50" /> <column name="Status" note="status" align="left" show="TRUE" share="FALSE" builtin="FALSE" localwidth="50" remotewidth="50" /> </fileviewcolumns> <appserverinfo servermodel="ColdFusion" urlprefix="http://dreamweaver/kojak/" serverscripting="CFML" serverpageext="" connectionsmigrated="TRUE" useUD4andUD5pages="TRUE" defaultdoctype="" accesstype="ftp" host="dreamweaver" remoteroot="kojak/" user="dream" usefirewall="FALSE" usepasv="TRUE" /> <cloaking enabled="TRUE" patterns="TRUE"> <cloakedfolder folder="databases/" /> <cloakedpattern pattern=".png" /> <cloakedpattern pattern=".jpg" /> <cloakedpattern pattern=".jpeg" /> </cloaking> </site>
site.get()
Availability
Dreamweaver 3.
Description
Gets the specified files and handles dependent files in one of the following ways:
If the user selects Prompt on Get/Check Out in the Site FTP preferences, the Dependent Files dialog box appears.
If the user previously selected the Don’t Show Me Again option in the Dependent Files dialog box and clicked Yes, dependent files are downloaded and no dialog box appears.
If the user previously selected the Don’t Show Me Again option in the Dependent Files dialog box and clicked No, dependent files are not downloaded and no dialog box appears.
Arguments
siteOrURL
The siteOrURL argument must be the keyword "site", which indicates that the function should act on the selection in the Files panel or the URL for a single file.
Returns
Nothing.
Enabler
See site.canGet().
site.getAppServerAccessType()
Availability
Dreamweaver MX.
Description
Returns the access method that is used for all files on the current site’s application server. The current site is the site that is associated with the document that currently has focus. If no document has focus, the site that you opened in Dreamweaver is used.
ColdFusion Component Explorer uses this function; see site.getAppServerPathToFiles() and site.getLocalPathToFiles().
Arguments
None.
Returns
One of the following strings:
"none"
"local/network"
"ftp"
"ftps"
"source_control"
site.getAppServerPathToFiles()
Availability
Dreamweaver MX.
Description
Determines the path to the remote files on the application server that is defined for the current site. The current site is the site that is associated with the document that currently has focus. If no document has focus, the site that you opened in Dreamweaver is used.
ColdFusion Component Explorer uses this function; see site.getAppServerAccessType() and site.getLocalPathToFiles().
Arguments
None.
Returns
If the access type to the application server file is local/network, this function returns a path; otherwise, this function returns an empty string.
site.getAppURLPrefixForSite()
Availability
Dreamweaver MX.
Description
Gets the value of the URL prefix that is extracted from the HTTP address defined in the Local Info section of the site definition dialog. It is the path that appears after the http://hostname:portnumber/.
Arguments
{siteName}
The siteName argument, which is optional, is the name of the site for which you want to get the URL prefix. If you do not specify a site, the function gets the URL prefix for the current site.
Returns
A string that contains the URL prefix of the currently selected site.
Example
var sitePrefix = site.getAppURLPrefixForSite();
site.getCheckOutUser()
Availability
Dreamweaver 3.
Description
Gets the login and check-out name that is associated with the current site.
Arguments
None.
Returns
A string that contains a login and check-out name, if defined, or an empty string if Check In/Check Out is disabled.
Example
A call to site.getCheckOutUser() might return "denise (deniseLaptop)". If no check-out name is specified, only the login name returns (for example, "denise").
site.getCheckOutUserForFile()
Availability
Dreamweaver 3.
Description
Gets the login and check-out name of the user who has the specified file checked out.
Arguments
fileName
The fileName argument is the path to the file being queried, which is expressed as a file://URL.
Returns
A string that contains the login and check-out name of the user who has the file checked out or an empty string if the file is not checked out.
Example
A call to site.getCheckOutUserForFile("file://C:/sites/avocado8/index.html") might return "denise (deniseLaptop)". If no check-out name is specified, only the login name returns (for example, "denise").
site.getCloakingEnabled()
Availability
Dreamweaver MX.
Description
Determines whether cloaking is enabled for the current site.
Arguments
None.
Returns
A Boolean value: true if cloaking is enabled for the current site; false otherwise.
site.getConnectionState()
Availability
Dreamweaver 3.
Description
Gets the current connection state.
Arguments
None.
Returns
A Boolean value that indicates whether the remote site is connected.
Enabler
See site.canConnect().
site.getCurrentSite()
Availability
Dreamweaver 3.
Description
Gets the current site.
Arguments
None.
Returns
A string that contains the name of the current site.
Example
If you defined several sites, a call to site.getCurrentSite() returns the one that is currently showing in the Current Sites List in the Files panel.
site.getFocus()
Availability
Dreamweaver 3, and updated in CS4.
Description
Determines which pane of the Files panel has focus.
Arguments
None.
Returns
One of the following strings local or remote.
site.getLocalPathToFiles()
Availability
Dreamweaver MX.
Description
Determines the path to the local files that are defined for the current site. The current site is the site that is associated with the document that currently has focus. If no document has focus, the site that you opened in Dreamweaver is used.
ColdFusion Component Explorer uses this function; see site.getAppServerAccessType() and site.getAppServerPathToFiles().
Arguments
None.
Returns
The path to the files residing on the local computer for the current site.
site.getLocalRootURL()
Availability
Dreamweaver CS4.
Description
Gets the local root folder of the site.
Arguments
siteName
The siteName argument is a string that specifies the name of the site.
Returns
A string that contains the local root folder of the named site, expressed as file://URL. The string is empty when the specified site does not exist.
site.getSelection()
Availability
Dreamweaver 3.
Description
Determines which files are currently selected in the Files panel.
Arguments
None.
Returns
An array of strings that represents the paths of the selected files and folders, which is expressed as a file:// URL or an empty array if no files or folders are selected.
site.getSiteForURL()
Availability
Dreamweaver MX.
Description
Gets the name of the site, if any, that is associated with a specific file.
Arguments
fileURL
The fileURL argument is the fully qualified URL (including the string "file://") for a named file.
Returns
A string that contains the name of the site, if any, in which the specified file exists. The string is empty when the specified file does not exist in any defined site.
site.getSites()
Availability
Dreamweaver 3.
Description
Gets a list of the defined sites.
Arguments
None.
Returns
An array of strings that represents the names of the defined sites, or an empty array if no sites are defined.
site.getSiteRootForURL()
Availability
Dreamweaver CS4.
Description
Gets the local root folder of the site associated with a specific file URL.
Arguments
fileURL
The fileURL argument is a string argument that contains the fully qualified URL (including the string file://) for a named file.
Returns
A string that contains the local root folder of the site, expressed as a file://URL, in which the specified file exists. The string is empty when the specified file does not exist in any defined site.
Example
var dom = dw.getDocumentDOM(); var siteRoot = site.getSiteRootForURL(dom.URL);
site.getSiteURLPrefix()
Availability
Dreamweaver 8.
Description
Gets the site URL prefix that is extracted from the HTTP Address defined in Local Info section.
Arguments
None.
Returns
A string that contains the site URL prefix.
Example
sitePrefix = getSiteURLPrefix();
site.importSite()
Availability
Dreamweaver MX.
Description
Creates a Dreamweaver site from an XML file. Dreamweaver uses the localroot attribute of the <localinfo> element to identify the local root folder for the site. During import, if this folder does not exist on the local computer, Dreamweaver prompts for a different local root folder. Dreamweaver behaves the same way when it tries to locate the default images folder that the imagefolder attribute of the <localinfo> element specifies.
Arguments
pathToSteFile
The pathToSteFile argument is a string that contains the URL for the STE file. Dreamweaver uses this file to create a site. If pathToSteFile is an empty string, Dreamweaver prompts the user to select a STE file to import.
Returns
A Boolean value: true if the named STE file exists and if the site is created successfully; false otherwise.
site.isCloaked()
Availability
Dreamweaver MX.
Description
Determines whether the current selection in the Files panel or the specified folder is cloaked.
Arguments
siteOrURL
The siteOrURL argument must contain one of the following two values:
The keyword "site", which indicates that the isCloaked() function should test the selection in the Files panel.
The file URL of a particular folder, which indicates that isCloaked() should test the specified folder.
Returns
A Boolean value: true if the specified object is cloaked; false otherwise.
site.locateInSite()
Availability
Dreamweaver 3.
Description
Locates the specified file (or files) in the specified pane of the Files panel and selects the files.
Arguments
localOrRemote, siteOrURL
The localOrRemote argument must be either "local" or "remote".
The siteOrURL argument must be the keyword "site", which indicates that the function should act on the selection in the Files panel or the URL for a single file.
Returns
Nothing.
Enabler
site.makeEditable()
Availability
Dreamweaver 3.
Description
Turns off the read-only flag on the selected files.
Arguments
None.
Returns
Nothing.
Enabler
site.makeNewDreamweaverFile()
Availability
Dreamweaver 3.
Description
Creates a new Dreamweaver file in the Files panel in the same folder as the first selected file or folder.
Arguments
None.
Returns
Nothing.
Enabler
site.makeNewFolder()
Availability
Dreamweaver 3.
Description
Creates a new folder in the Files panel in the same folder as the first selected file or folder.
Arguments
None.
Returns
Nothing.
Enabler
site.newSite()
Availability
Dreamweaver 3.
Description
Opens the Site Definition dialog box for a new, unnamed site.
Arguments
None.
Returns
Nothing.
site.open()
Availability
Dreamweaver 3.
Description
Opens the files that are currently selected in the Files panel. If any folders are selected, they are expanded in the Site Files view.
Arguments
None.
Returns
Nothing.
Enabler
See site.canOpen().
site.put()
Availability
Dreamweaver 3.
Description
Puts the selected files and handles dependent files in one of the following ways:
If the user selects Prompt on Put/Check In in the Site FTP preferences, the Dependent Files dialog box appears.
If the user previously selected the Don’t Show Me Again option in the Dependent Files dialog box and clicked Yes, dependent files are uploaded and no dialog box appears.
If the user previously selected the Don’t Show Me Again option in the Dependent Files dialog box and clicked No, dependent files are not uploaded and no dialog box appears.
Arguments
siteOrURL
The siteOrURL argument must be the keyword "site", which indicates that the function should act on the selection in the Files panel or the URL for a single file.
Returns
Nothing.
Enabler
See site.canPut().
site.recreateCache()
Availability
Dreamweaver 3.
Description
Re-creates the cache for the current site.
Arguments
None.
Returns
Nothing.
Enabler
site.refresh()
Availability
Dreamweaver 3, and updated in CS4.
Description
Refreshes the file listing on the specified side of the Files panel.
Arguments
whichSide
The whichSide argument must be local, or remote.
Returns
Nothing.
Enabler
See site.canRefresh().
site.remoteIsValid()
Availability
Dreamweaver 3.
Description
Determines whether the remote site is valid.
Arguments
None.
Returns
A Boolean value that indicates whether a remote site has been defined and, if the server type is Local/Network, whether the drive is mounted.
site.renameSelection()
Availability
Dreamweaver 3.
Description
Turns the name of the selected file into a text field, so the user can rename the file. If more than one file is selected, this function acts on the last selected file.
Arguments
None.
Returns
Nothing.
site.selectAll()
Availability
Dreamweaver 3, and updated in CS4.
Description
Selects all files in the active view.
Arguments
None.
Returns
Nothing.
site.selectNewer()
Availability
Dreamweaver 3.
Description
Selects all files that are newer on the specified side of the Files panel.
Arguments
whichSide
The whichSide argument must be either "local" or "remote".
Returns
Nothing.
Enabler
site.serverActivity()
Availability
Dreamweaver 8.
Description
This function determines whether Dreamweaver is currently interacting with a server. Because Dreamweaver cannot do more than one server activity at a time, this function lets you determine whether to disable functionality that requires server interaction.
Arguments
None.
Returns
A Boolean value that indicates whether Dreamweaver is currently interacting with a server.
Example
The following example, from the menus.xml file, displays a menu item if there is no server activity (and if there is a current site specified in Dreamweaver):
<menuitem name="Remove Connection Scripts" enabled="!site.serverActivity() && site.getCurrentSite() != ''" command="alert(MMDB.removeConnectionScripts())" id="SiteOptionsSiteMenu_RemoveConnectionScripts" />
site.setCloakingEnabled()
Availability
Dreamweaver MX.
Description
Determines whether cloaking should be enabled for the current site.
Arguments
enable
The enable argument is a Boolean value that indicates whether cloaking should be enabled. A value of true enables cloaking for the current site; a value of false disables cloaking for the current site.
Returns
None.
site.setConnectionState()
Availability
Dreamweaver 3.
Description
Sets the connection state of the current site.
Arguments
bConnected
The bConnected argument is a Boolean value that indicates if there is a connection (true) or not (false) to the current site.
Returns
Nothing.
site.setCurrentSite()
Availability
Dreamweaver 3.
Description
Opens the specified site in the local pane of the Files panel.
Arguments
whichSite
The whichSite argument is the name of a defined site (as it appears in the Current Sites list in the Files panel or the Site Definition dialog box).
Returns
Nothing.
Example
If three sites are defined (for example, avocado8, dreamcentral, and testsite), a call to site.setCurrentSite("dreamcentral"); makes dreamcentral the current site.
site.setFocus()
Availability
Dreamweaver 3, and updated in CS4.
Description
Gives focus to a specified pane in the Files panel. If the specified pane is not showing, this function displays the pane and gives it focus.
Arguments
whichPane, nextTextView
The whichPane argument must be one of the following strings: local or remote.
The nextTextView argument toggles focus between views in split view.
Returns
Nothing.
site.setSelection()
Availability
Dreamweaver 3.
Description
Selects files or folders in the active pane in the Files panel.
Arguments
arrayOfURLs
The arrayOfURLs argument is an array of strings where each string is a path to a file or folder in the current site, which is expressed as a file:// URL.
Note: Omit the trailing slash (/) when specifying folder paths.
Returns
Nothing.
site.siteRelativeToLocalPath()
Availability
Dreamweaver 8.
Description
Converts a site-relative URI reference to a local file path.
Arguments
siteRelativeURI
The siteRelativeURI attribute, which is required, is a string that contains the site-relative URI.
Returns
A string, which specifies the path to a local file on your local computer.
Example
The following example
var filePath = site.siteRelativeToLocalPath("/myWebApp/myFile.xlml");
returns "C:\Inetpub\wwwroot\siteA\myFile.xml" based on your site mappings and HTTP address specified in the Local info of the Site Definition dialog box.
site.synchronize()
Availability
Dreamweaver 3.
Description
Opens the Synchronize Files dialog box.
Arguments
None.
Returns
Nothing.
Enabler
site.uncloak()
Availability
Dreamweaver MX.
Description
Uncloaks the current selection in the Files panel or the specified folder.
Arguments
siteOrURL
The siteOrURL argument must contain one of the following values:
The keyword "site", which indicates that the unCloak() function should act on the selection in the Files panel.
The URL of a particular folder, which indicates that the unCloak() function should act on the specified folder and all its contents.
Returns
Nothing.
Enabler
See site.canUncloak().
site.uncloakAll()
Availability
Dreamweaver MX.
Description
Uncloaks all folders in the current site and deselects the Cloak Files Ending With: checkbox in the Cloaking settings.
Arguments
None.
Returns
Nothing.
Enabler
See site.canUncloak().
site.undoCheckOut()
Availability
Dreamweaver 3.
Description
Removes the lock files that are associated with the specified files from the local and remote sites, and replaces the local copy of the specified files with the remote copy.
Arguments
siteOrURL
The siteOrURL argument must be the keyword "site", which indicates that the function should act on the selection in the Files panel or the URL for a single file.
Returns
Nothing.
Enabler