Site functions

 < Day Day Up > 

Site functions handle operations that are related to files in the site files or site map. These functions let you perform the following tasks:

  • Create links between files

  • Get, put, 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 = dom.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

 var siteRelativeURI = site.localPathToSiteRelative("C:\Inetpub\wwwroot\siteA\myFile.cfm") 

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.

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

See "dreamweaver.siteSyncDialog.canCompare()" on page 1086.

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

See "dreamweaver.siteSyncDialog.canMarkDelete()" on page 1087.

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

See "dreamweaver.siteSyncDialog.canMarkGet()" on page 1087.

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

See "dreamweaver.siteSyncDialog.canMarkIgnore()" on page 1088.

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

See "dreamweaver.siteSyncDialog.canMarkPut()" on page 1088.

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

See "dreamweaver.siteSyncDialog.canMarkSynced()" on page 1089.

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.

Enabler

See "site.canAddLink()" on page 1090.

site.addLinkToNewFile()

Availability

Dreamweaver 3.

Description

Opens the Link to New File dialog box to let the user specify details for the new file and creates a link from the selected document to that file.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canAddLink()" on page 1090.

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.

Enabler

See "site.canChangeLink()" on page 1091.

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 Site panel or the URL for a single file.

Returns

Nothing.

Enabler

See "site.canCheckIn()" on page 1091.

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 Site panel or the URL for a single file.

Returns

Nothing.

Enabler

See "site.canCheckOut()" on page 1092.

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 Site 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 Site 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()" on page 1092.

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 Site 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

See "site.canCompareFiles()" on page 1093.

Example

The following example compares the files selected in the Site panel with their remote versions:

 site.compareFiles("site"); 

site.defineSites()

Availability

Dreamweaver 3.

Description

This function opens the Edit Sites 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 invokes 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.editColumns()

Description

This function displays the Edit Sites dialog box, which shows the File View Columns section.

Arguments

None.

Returns

Nothing.

site.exportSite()

Availability

Dreamweaver MX.

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 that 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. 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@macromedia.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> 

Arguments

 siteName 

  • The siteName argument identifies the site to export. If siteName is an empty string, Dreamweaver exports the current site.

Returns

A Boolean value: TRue if the named site exists and if the XML file is successfully exported; false otherwise.

site.findLinkSource()

Availability

Dreamweaver 3.

Description

Opens the file that contains the selected link or dependent file, and highlights the text of the link or the reference to the dependent file. This function operates only on files in the Site Map view.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canFindLinkSource()" on page 1094.

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 Site panel or the URL for a single file.

Returns

Nothing.

Enabler

See "site.canGet()" on page 1094.

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.

NOTE

ColdFusion Component Explorer uses this function; see site.getAppServerPathToFiles() and site.getLocalPathToFiles().


Arguments

None.

Returns

One of the following strings:

  • "none"

  • "local/network"

  • "ftp"

  • "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.

NOTE

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 tie, 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()" on page 1093.

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 Site panel.

site.getFocus()

Availability

Dreamweaver 3.

Description

Determines which pane of the Site panel has focus.

Arguments

None.

Returns

One of the following strings:

  • "local"

  • "remote"

  • "site map"

site.getLinkVisibility()

Availability

Dreamweaver 3.

Description

Checks whether all the selected links in the site map are visible (that is, not marked hidden).

Arguments

None.

Returns

A Boolean value: true if all the selected links are visible; false otherwise.

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.

NOTE

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.getSelection()

Availability

Dreamweaver 3.

Description

Determines which files are currently selected in the Site 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.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. During import, if the folder that is specified by the localroot attribute of the <localinfo> element 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 is specified by the imagefolder attribute of the <localinfo> element.

Arguments

 fileURL 

  • The fileURL argument is a string that contains the URL for the XML file. Dreamweaver uses this XML file to create a new site. If fileURL is an empty string, Dreamweaver prompts the user to select an XML file to import.

Returns

A Boolean value: TRue if the named XML file exists and if the site is created successfully; false otherwise.

site.invertSelection()

Availability

Dreamweaver 3.

Description

Inverts the selection in the site map.

Arguments

None.

Returns

Nothing.

site.isCloaked()

Availability

Dreamweaver MX.

Description

Determines whether the current selection in the Site 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 Site 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 Site 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 Site panel or the URL for a single file.

Returns

Nothing.

Enabler

See "site.canLocateInSite()" on page 1095.

site.makeEditable()

Availability

Dreamweaver 3.

Description

Turns off the read-only flag on the selected files.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canMakeEditable()" on page 1095.

site.makeNewDreamweaverFile()

Availability

Dreamweaver 3.

Description

Creates a new Dreamweaver file in the Site panel in the same folder as the first selected file or folder.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canMakeNewFileOrFolder()" on page 1096.

site.makeNewFolder()

Availability

Dreamweaver 3.

Description

Creates a new folder in the Site panel in the same folder as the first selected file or folder.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canMakeNewFileOrFolder()" on page 1096.

site.newHomePage()

Availability

Dreamweaver 3.

Description

Opens the New Home Page dialog box to let the user create a new home page.

NOTE

This function operates only on files in the Site Map view.


Arguments

None.

Returns

Nothing.

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 Site panel. If any folders are selected, they are expanded in the Site Files view.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canOpen()" on page 1096.

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 Site panel or the URL for a single file.

Returns

Nothing.

Enabler

See "site.canPut()" on page 1097.

site.recreateCache()

Availability

Dreamweaver 3.

Description

Re-creates the cache for the current site.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canRecreateCache()" on page 1097.

site.refresh()

Availability

Dreamweaver 3.

Description

Refreshes the file listing on the specified side of the Site panel.

Arguments

 whichSide 

  • The whichSide argument must be "local", or "remote". If the site map has focus and whichSide is "local", the site map refreshes.

Returns

Nothing.

Enabler

See "site.canRefresh()" on page 1098.

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.removeLink()

Availability

Dreamweaver 3.

Description

Removes the selected link from the document above it in the site map.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canRemoveLink()" on page 1098.

site.renameSelection()

Availability

Dreamweaver 3.

Description

Turns the name of the selected file into an 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.runValidation()

Availability

Dreamweaver MX.

Description

Runs the Validator on the entire site or only highlighted items.

Arguments

 selection 

  • The selection argument is the parameter that specifies that the Validator should check only the highlighted items; otherwise, the Validator checks the entire current site.

Returns

Nothing.

site.saveAsImage()

Availability

Dreamweaver 3.

Description

Opens the Save As dialog box to let the user save the site map as an image.

Arguments

 fileType 

  • The fileType argument is the type of image that should be saved. Valid values for Windows are "bmp" and "png"; valid values for the Macintosh are "pict" and "jpeg". If the argument is omitted, or if the value is not valid on the current platform, the default is "bmp" in Windows and "pict" on the Macintosh.

Returns

Nothing.

site.selectAll()

Availability

Dreamweaver 3.

Description

Selects all files in the active view (either the site map or the site files).

Arguments

None.

Returns

Nothing.

site.selectHomePage()

Availability

Dreamweaver 3.

Description

Opens the Open File dialog box to let the user select a new home page.

NOTE

This function operates only on files in the Site Map view.


Arguments

None.

Returns

Nothing.

site.selectNewer()

Availability

Dreamweaver 3.

Description

Selects all files that are newer on the specified side of the Site panel.

Arguments

 whichSide 

  • The whichSide argument must be either "local" or "remote".

Returns

Nothing.

Enabler

See "site.canSelectNewer()" on page 1099.

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())" />

site.setAsHomePage()

Availability

Dreamweaver 3.

Description

Designates the file that is selected in the Site Files view as the home page for the site.

Arguments

None.

Returns

Nothing.

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 Site panel.

Arguments

 whichSite 

  • The whichSite argument is the name of a defined site (as it appears in the Current Sites list in the Site panel or the Edit Sites 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.

Description

Gives focus to a specified pane in the Site panel. If the specified pane is not showing, this function displays the pane and gives it focus.

Arguments

 whichPane 

  • The whichPane argument must be one of the following strings: "local", "remote", or "site map".

Returns

Nothing.

site.setLayout()

Availability

Dreamweaver 3.

Description

Opens the Site Map Layout pane in the Site Definition dialog box.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canSetLayout()" on page 1099.

site.setLinkVisibility()

Availability

Dreamweaver 3.

Description

Shows or hides the current link.

Arguments

 bShow 

  • The bShow argument is a Boolean value that indicates whether to remove the Hidden designation from the current link.

Returns

Nothing.

site.setSelection()

Availability

Dreamweaver 3.

Description

Selects files or folders in the active pane in the Site 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

See "site.canSynchronize()" on page 1100.

site.uncloak()

Availability

Dreamweaver MX.

Description

Uncloaks the current selection in the Site 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 Site 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()" on page 1101.

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

Nothing.

Returns

Nothing.

Enabler

See "site.canUncloak()" on page 1101.

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 Site panel or the URL for a single file.

Returns

Nothing.

Enabler

See "site.canUndoCheckOut()" on page 1101.

site.viewAsRoot()

Availability

Dreamweaver 3.

Description

Temporarily moves the selected file to the top position in the site map.

Arguments

None.

Returns

Nothing.

Enabler

See "site.canViewAsRoot()" on page 1102.

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net