Section 15.3. Check In and Check Out

15.3. Check In and Check Out

If you're the sole developer for a Web site, the Files panel's Get and Put buttons are fine for transferring your files. But if you're on a team of developers, these simple tools can get you in trouble.

For example, suppose your boss emails you an important announcement that she wants posted on the home page immediately. So you download the home page from the Web server and start to edit it. At the same time, your co-worker Bob notices a typo on the home page. He downloads it, too.

You're a much faster worker than Bob, so you've added the critical news to the home page and moved it back to the Web server. But now Bob transfers his corrected home page to the Web server, overwriting your edits and eliminating that urgent notice you just uploaded. (An hour later, your phone rings. It's the boss.)

Without some kind of system to monitor who has what file, and to prevent people from overwriting each other's work, collaborative Web development is a chaotic mess. Fortunately, Dreamweaver's Check In and Check Out system provides a civilized answer to this problem. It works like your local public library: When you check a file out, no one else can have it. When you're finished, you check the file back in, releasing control of it, and allowing someone else on the team to check it out and work on it.

To use the Check In/Check Out feature effectively, it helps to keep a few things in mind:

  • When you're developing a Web site solo, your local site usually contains the most recent versions of your files. You make any modifications or additions to the pages on your computer first and then transfer them to the Web server.

    But in a collaborative environment where many people are working on the site at once, the files on your hard drive may not be the latest ones. After all, your co-workers , like you, have been updating pages and transferring them to the Web server. The home page file sitting in the local site folder on your computer may be several days older than the file on the remote site, which is why checking out a file from the remote site, rather than editing from the copy on your computer, is so important. It guarantees that you have the latest version of the file.

  • In a collaborative environment, nobody should post files to the Web server using any method except Dreamweaver's Check In and Check Out system.

  • The reason is technical, but worth slogging through: When Dreamweaver checks out a file, it doesn't actually lock the file. Instead, it places a small, invisible text file (with the three-letter suffix .lck) on both the remote server and in your local site folder. This text file indicates who has checked out the file. When Dreamweaver connects to a remote site, it uses these files to know which Web files are in use by others.

    But only Dreamweaver understands these .lck files. Other FTP programs, like WSFTP (Windows) or Fetch (Mac), gladly ignore them and can easily overwrite any checked-out files. This risk also applies when you simply copy files back and forth over the office network.


    Note: Dreamweaver's word processorlike Web page editing program, Contribute, also takes advantage of this Check In/Check Out feature, so you can use the two programs on the same site.
  • All Dreamweaver people must configure their remote site to use Check In and Check Out (see Section 15.3). If just one person doesn't do it, you risk overwritten files.


Note: Visual SourceSafe and WebDAV people are free of these last two constraints. As long as everyone working on the site uses programs that support the Visual SourceSafe client or the WebDAV protocol, they can work seamlessly with Dreamweaver people. And vice versa.

15.3.1. Checking Out Files

When you want to work on a file in a collaborative site, you check it out from the Web server. Doing so makes sure that you have the latest version of the file, and that nobody else can make changes to the file.

If you're used to creating sites by yourself, this business may feel a little strange ; after all, your local site (the files on your computer) contains the latest versions of all files. When working with a group , however, you should consider the remote sitewhere everyone can access, edit, and add new Web pagesto be the master copy of your site's files.


Note: There's nothing to check out when you're creating a new page for the site. Since the only version of the file in the universe is on your computer, there's no fear that someone else may work on it at the same time as you. In this case, you only need to check the file into the site when you're done (see Section 15.3.3).

You check out a file using the Files panel; if it's not open , press F8 or use any of the methods described on Section 13.1.4. Then choose the remote site you wish to work on from the Site pop-up menu (shown at top in Figure 15-11).

Figure 15-11. The Check In/Out buttons transfer files between the local site and the Web server. A padlock identifies files that are checked into the remote site. Ironically, the lock means that the file is open for anyone to check out and edit. If a file is currently checked out, a checkmark appears next to its name . A green checkmark indicates you've checked out the file; a red checkmark means someone else has checked it out.

Now you're ready to begin. From the Local Folder file list in the Files panel, click to select the files you wish to check out from the Web serveror, to check out an entire folder and every file inside it, just select the folder.

You may in some instances want to select a file from the Remote Site list as well. For example, maybe you need to modify a page that you didn't create, and which you've never before checked out. In this case, the file isn't in your local folder, so you must select it from the Remote Site list. First, connect to the Web server by clicking the Connect button (see Figure 15-7). After Dreamweaver connects to the server, the remote files appear in the Remote Site list. Select the ones you wish to check out.


Tip: If, when you define the remote site (Section 15.1.1), you select the Check Out File when Opening option, you can also check out (and open) a file by double-clicking it in the Files panel. This is a quick way to open a page for editing while still using Dreamweaver's Check Out feature.

In any case, now just click the Check Out files button on the Files panel (see Figure 15-11), or use the keyboard shortcut Ctrl+Alt+Shift+D ( -Option-Shift-D). (Not enough fingers? See Section 19.1 to learn how to change Dreamweaver's shortcuts.)

Dreamweaver asks if you wish to also check out any dependent files. Click Yes if you think the page you're checking out uses files you haven't yet downloaded. Dreamweaver 8 acts differently (and more intelligently) than previous versions of Dreamweaver, which used to also check out the dependent files, locking them so nobody else could modify them on the server. Now Dreamweaver 8 simply copies the dependent files to your computer, so the page you've checked out and are working on displays the current images, CSS style sheets, and other linked files correctly. If you do want to edit a dependent filefor example, you need to also edit styles on a linked external style sheet that's used by the page you checked outyou must also check out that file.

When you check out files, Dreamweaver copies them to your computer and marks them as checked out so others can't change them. As when uploading and downloading files, checking out files can take time, depending upon the speed of your Internet connection.

After you've checked out a file, a green "checked-out" checkmark appears next to its name in the Files panel (see Figure 15-11). You can now open and edit it, and (when you're done) check the file back in.

If you attempt to check out a file someone else has already checked out, Dreamweaver tells you as much. It also gives you the option to override the person's checkoutbut unless you're the boss, resist the temptation , for two reasons. First, your colleagues may have made some important changes to the page, which you'll wipe out with your shenanigans. Second, because you so rudely stole the file, they may decide to stop talking to you.

WORKAROUND WORKSHOP
Manual Checkout Override

Occasionally, you may wish to erase the checked-out status of a file. Suppose, for example, someone who's checked out a lot of files suddenly catches the plague and can't continue working on the site. To free those files so others can work on them, you should undo his checkout (and quarantine his cubicle ).

To do this, make sure the Files panel is in Remote view (this trick won't work when looking at the Local Files). Then, right-click (Control-click) the checked-out file in the Files panel and select Undo Checkout from the menu that appears.

You'll get two warnings. First, Dreamweaver informs you that whoever checked out the file won't be able to check it back in. (This is, in fact, false. That person can still check in the file, overwriting whatever's on the Web server. So you can see why you should override the check-out only when the person who checked it out is very unlikely to check it back in. Stranded on a deserted island, perhaps.)

Second, Dreamweaver warns you that overriding a checkout also copies the remote site version of the file to your local site. You can stop the process, if necessary, by clicking No in either of these warning boxes.

When complete, a padlock icon appears next to the file.

You can also use this technique if, after checking out a file, you've made a horrible mistake on the page and wish to revert to the copy on the Web server.


A better way to work with someone who's checked out a file you need is to use Dreamweaver's email feature. You can see who checked out a file by consulting the Checked Out By column (only visible when you've expanded the Files panel; see the circled entries in Figure 15-11). Even better, if you click the name, Dreamweaver opens your email program and addresses an email to that person, so you can say: "Hey Bob, you've had the home page checked out for two days! I need to work on it, so check it back in!"


Note: Dreamweaver 8 starts with the Checked Out By column turned off. To make it appear in the expanded view of the Files panel, see "Organizing the Columns in the Files Panel" on Section 15.5.4.

The name and email address Dreamweaver uses depends on the information your co-workers provided, just as you did when you configured your computer for remote site use (see Section 15.1.1).

FREQUENTLY ASKED QUESTION
Get and Put, In and Out

I'm using Dreamweaver's Check In and Check Out buttons to transfer my files. What do the Get and Put buttons do when the Check In/Out feature is in use ?

If you're using Check In and Out, the Get and Put commands function slightly differently than described on Section 15.2. Get copies the selected file or files to your local site. However, Dreamweaver draws a small lock icon next to each of these "gotten" files in your Local Folder list. The files are locked, and you shouldn't edit them. Remember, checking out a file is the only way to prevent others from working on it. If you edit a locked file on your computer, nothing is stopping someone else from checking the page out from the Remote site, editing it, and checking it back in.

But using the Get command in such a situation can still be useful. For example, suppose someone just updated the site's external style sheet. Pages you're editing use this style sheet, so you'd like to get the latest version. You don't want to edit the style sheet itself, so you don't need to check it out. If you use Get instead of checking out the pages, you can keep a reference copy on your computer without locking it for anyone else and without having to check it back in later.

Put, on the other hand, simply transfers the file on your local site to the remote site. If you're using the Check In/Check Out feature and you haven't also checked out the file, using Put is a bad idea. The remote site should be your reference copy; several rounds of revisions may have been made to a file since you last checked it out. Your local copy will be hopelessly out of date, and moving it to the server using Put destroys the most recent version of the file.

However, if you do have the file checked out, you can use Put to transfer your local copy to the server so it can be viewed by your site's visitors . For example, say you're updating the home page with 20 new news items. To keep your site "up-to-the-minute" fresh, you can Put the home page after you add each news item. Then the whole world will see each news item as soon as possible. When you're completely finished editing the home page, check it in.


15.3.2. Checking In Files

When you're ready to move a page you've edited back onto the server, you check it in. (You also check in new files you've created.)

To check in files, open the Files panel (press F8), choose the site you're checking into from the Site pop-up menu, and (using the Local Folder file list in the Files panel) select the files you wish to check in to the Web server. As always, you can click a folder to check it in, along with every file inside it.

The files you select should be files you've checked out, or brand-new files that have never been on the Web server. If you attempt to check in a file that someone else has checked out, Dreamweaver warns you with a message box. Click Cancel to stop the check-in procedure, so that you won't overwrite the checked-out file on the server. Dreamweaver also warns you if you try to check in a file that's older than the server copy. Again, unless you're sure this is what you want to do, click Cancel.


Tip: If you want to check the page you're currently working on into the remote site, use the toolbar in the document window (see Figure 15-9).

You can check in the selected files in any of the usual ways:

  • Click the Check In files button on the Files panel (see Figure 15-11).

  • Use the keyboard shortcut Ctrl+Alt+Shift+U ( -Option-Shift-U). (See Section 19.1 to learn how to change the Dreamweaver shortcut to something less cumbersome.)


Note: The Site Check In menu option checks in only the document youre currently working on, not any files you've selected in the Files panel.

Dreamweaver asks if you wish to also check in any dependent files (see Figure 15-8). You should transfer dependent files only if you first checked them out, or if the dependent files are new and have never been uploaded to the server. If you attempt to check in a dependent file that someone else has checked out, Dreamweaver warns you with a message box.

After you've clicked through all message boxes, Dreamweaver copies the files to the remote site. Once you've checked in a file, a padlock icon appears next to its name in the Files panel (see Figure 15-11); checking in locks the file so that you don't accidentally change the local copy. If you wish to modify the file in some way, check it out again (see Section 15.3.1).

15.3.3. Generating a Report on Checked-Out Files

As described in Chapter 14, Dreamweaver can generate a series of reports on the files in your site. One of those reports lets you see which files a specific person has checked out. In this way, for instance, you can identify all the files you've checked out, or all the files that have been checked out by your co-worker Bob (who has since left the company).

To generate a report, follow the steps described on Section 14.6. Turn on the Checked Out By option when specifying the type of report to run. Then click Report Settings. In the dialog box that appears, type the person's name as it appears in the Checked Out By column (Figure 15-11). (To find all checked-out files, leave the box blank.) Click OK, and then click Run to generate the report.

Unfortunately, a couple of issues undermine the usefulness of the "Checked Out By" report. First, if you're connected to the remote server using FTP, you'll wait a while; Dreamweaver needs to download a lot of information, which, even on a small site, can take several minutes.


Note: If you find the report is taking too long, you can stop it in its tracks by clicking the Stop button (the red stop sign icon) in the Site Reports panel (see Figure 15-12).
Figure 15-12. Running a report to see who has checked out which file is a great idea. Unfortunately, this feature may not produce very useful results.

Second, the report you finally get isn't very useful (see Figure 15-12). The operations you're most likely to perform on checked-out fileschecking them back in, undoing their check-out status, or contacting the person who checked them outrequire you to switch to the Files panel. Because there's no link between the report and the Files panel, you can't, for example, make Dreamweaver highlight the reported files in the Files panel.



Dreamweaver 8[c] The Missing Manual
Dreamweaver 8[c] The Missing Manual
ISBN: 596100566
EAN: N/A
Year: 2006
Pages: 233

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