< 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:
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
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
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
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:
Arguments siteOrURL
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
Returns Nothing. site.checkOut()Availability Dreamweaver 3. Description Checks out the selected files and handles dependent files in one of the following ways:
Arguments siteOrURL
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:
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:
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
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
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:
Arguments siteOrURL
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:
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
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:
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
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
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
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
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:
Arguments siteOrURL
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
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
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
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
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
Returns None. site.setConnectionState()Availability Dreamweaver 3. Description Sets the connection state of the current site. Arguments bConnected
Returns Nothing. site.setCurrentSite()Availability Dreamweaver 3. Description Opens the specified site in the local pane of the Site panel. Arguments whichSite
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
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
Returns Nothing. site.setSelection()Availability Dreamweaver 3. Description Selects files or folders in the active pane in the Site panel. Arguments arrayOfURLs
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
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
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
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 > |