6.6 Preparing an Existing Site for Use


How do you use Dreamweaver to manage an existing site? Whether you've created an entire site with another site-management tool such as FrontPage or simply created some HTML files in another program, it's easy to "import" an existing site into Dreamweaver. Dreamweaver 4 also reads site definition files from earlier versions of Dreamweaver.

You don't literally import your existing site files into Dreamweaver. Instead, you tell Dreamweaver about your existing site by creating a site definition . The next section ensures that you have your web site prepared for use within Dreamweaver so you can benefit from the later advice on checking and fixing broken links. See the Macromedia TechNote 14031 "How to convert an existing site into a Dreamweaver site" for additional details, including how to convert from FrontPage. The TechNote can be found at http://www.macromedia.com/support/dreamweaver/ts/documents/existing_site.htm.

Refer to Section 7.1 in Chapter 7, especially when using HTML files from another program.

6.6.1 Importing an Existing Site

If you already have a local copy of your web site on your hard drive, you can create a site definition for it, as described in Section 6.2 earlier in this chapter. (If you modify a file without having defined the site, relative links will be changed to absolute file:/// links.) If you don't have a copy of your site on your local drive already, you can use Dreamweaver to download an entire site from a remote server. To download a site with Dreamweaver, you must have authorized access to the FTP site or network drive on which the site is stored; Dreamweaver will not download someone else's site via HTTP (although other utilities will). If you already have your local and remote sites set up in Dreamweaver but want to make sure they're synchronized before continuing, see Section 6.8.4 later in this chapter.

To download a remote site using Dreamweaver:

  1. Create a new site definition using Site figs/u2192.gif Define Site, as described earlier.

  2. In the Local Info category of the Site Definition dialog box (see Figure 6-2), specify the local folder to which you want to download the site.

  3. Provide the information necessary to access the site, such as its FTP address, in the Remote Info category of the Site Definition dialog box (see Figure 6-3). Click OK to save your site definition.

  4. Open the Site window using Window figs/u2192.gif Site Files.

  5. Choose Site figs/u2192.gif Refresh Remote in the Site window (Windows) or Site figs/u2192.gif Site Files figs/u2192.gif Refresh Remote (Macintosh). Dreamweaver downloads the directory structure of the remote site, but not all the files within it. If you click the plus (+) button to display a folder's contents in the Remote Files pane, Dreamweaver downloads the folder listing as needed.

  6. Click once in the Remote Files pane to make it active, and then choose Site figs/u2192.gif Synchronize. Instead, you can select the root folder in the Remote Files pane and use Site figs/u2192.gif Get. However, Site figs/u2192.gif Synchronize has several advantages over Get: it lets you preview the list of files to be transferred, allows you to deselect individual files, gives you an ongoing progress bar, and outputs a report when finished.

  7. In the Synchronize Files dialog box (see Figure 6-16), you can choose to synchronize the Entire Site or Selected Remote Files Only (if the latter option is not available, you forgot to click in the Remote Files pane, as directed in Step 6). For the Direction, select Get Newer Files from Remote and then click the Preview button. It may take Dreamweaver a few minutes to read the directory structure of a large site. Dreamweaver will show you the size of remote files in the Remote Files pane; if not, make sure that the Size column isn't hidden under View figs/u2192.gif File View Columns in the Site window (Windows) or Site figs/u2192.gif Site Files View figs/u2192.gif File View Columns (Macintosh).

  8. In the Synchronization Preview dialog box (see Figure 6-17), Dreamweaver will show a list of files to be downloaded. Uncheck the checkbox in the Action column next to files that you don't want to download. Click OK to proceed with the download.

Downloading a large site can take a long time (several hours), even over a fast connection. Dreamweaver shows the size of each file as it downloads, plus an overall progress bar. The progress bar shows the percentage of the total number of files downloaded; it doesn't consider differences in file sizes. During an FTP download, you can't use Dreamweaver for anything else (although you can use other programs during this time). To interrupt the download, click the Stop Current Tasks icon in the Synchronize Preview dialog box.

As files are downloaded, their Status changes to Updated in the Synchronize Preview dialog box. If a file can't be downloaded from the remote server, Dreamweaver displays an error. You must click OK in response to the error to download the remaining files. After the transfer completes (or is aborted), save the Log file for further inspection. (The Log file is simply a text file and can be opened in any text reader.) The problematic file's status will be shown as Not Updated and be listed in the Log file under, "Files Not Updated Due To User Interaction."

Dreamweaver should preserve the remote server's file dates in the Local Files and Remote Files panes and also in the Windows File Explorer or Macintosh Finder. In practice, Dreamweaver sometimes assign today's date to local files during synchronization; such files may be reuploaded unnecessarily during the next synchronize operation. Use Site figs/u2192.gif Get to download selected files from the server; it doesn't seem to suffer from the same file date problem.

Dreamweaver may write a zero-length file or a corrupted file if the transfer of a specific file fails. If you don't delete this incomplete file and redownload the correct version from the remote server, Dreamweaver won't remember that it is corrupted. Worse yet, if Dreamweaver has mistakenly assigned today's date to the corrupted file, it will think that it is more recent than the server version. Therefore, the corrupted file may be uploaded to the server during the next synchronization. Again, check the file log and file dates and sizes carefully to avoid problems.

Dreamweaver doesn't compare file sizes to determine which files need to be transferred, only file dates. If a file is corrupted, use the Site figs/u2192.gif Get command to download a file from the remote server manually, or use Site figs/u2192.gif Put to manually upload a file to the server.



Dreamweaver in a Nutshell
Dreamweaver in a Nutshell
ISBN: B000C4SPTM
EAN: N/A
Year: 2005
Pages: 208

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