Using File Check In and Check Out


As I've just mentioned, your collaborative team can use Dreamweaver's file Check In and Check Out functionality to work with individual files. The benefit to using file Check In and Check Out is simple and is best explained given the following scenario. Assume that you're working in a team of two or more developers. Also assume that although you're the primary developer for the project, a second developer decides to help you out and copies a file from the remote server to his local computer to do some work on the file. Unbeknownst to the other developer, you've already copied the file and begun doing work on it. When you've finished work for the day, you copy the file back to the remote server and assume everything is fine. The other developer, thinking he's helping you out, makes changes to the file and also uploads the file to the remote server, essentially overwriting all the work that you just spent a better part of a day working on. Situations such as this can easily be prevented by enabling and working with the file Ccheck In and Check Out features built directly into Dreamweaver.

Working with these features, however, requires some initial setup. Up until this point we've been working specifically with local files, meaning that you downloaded the files from the book's web site, you extracted them, copied them to a folder on your hard drive, and then defined a site directly to the local files in Dreamweaver. With file Check In and Check Out, this simplistic model wouldn't make sense. Remember that file Check In and Check Out assumes that you're working with teams. Members of your team won't be connecting directly to your computer; instead, they'll be connecting to a remote server, possibly even the company's web server. The remote server in this case not only acts as the web server, but as a central repository for web files. Because this is the case, we'll have to emulate our fictitious company's web architecture model by defining a remote server (the fictitious company's web server) and a local site (your computer). When we're finished, the model will resemble Figure 12.1.

Figure 12.1. The ideal scenario has you as a single developer connecting to a remote computer that acts as the company's web server.


Before you scramble to find a web hosting provider, it's important to understand that the file Check In and Check Out features can easily be integrated with computers that reside within the same network (because your company's web server could be a computer that resides on the company's network). What this means is that you can work with examples in this chapter using your computer (assuming your computer is the development and web server) or two computers that might share the same network. If you're using your computer as both the development and web server, your web architecture model might resemble Figure 12.2.

Figure 12.2. Realistically, many readers of this book will be developing and testing from the same computer they use to access the Internet.


Either model you choose to implement is fine. Although the first model is much more flexible when it comes to working in teams, the second model works just fine for the examples in this chapter.

NOTE

If you've downloaded the files form the web site, you'll notice that files contained in the Dorknozzle folder are separated into two folders called Local and Remote. I'll make the assumption that most readers of this book don't have a second server running on their home network or don't have the ability to connect to a web hosting provider. Because this is the case, I'll run through the examples in this chapter using the second model, shown in Figure 12.2.


Enabling Check-In and Check-Out

Now that you understand the model that the file Check In and Check Out functionality works under, let's set it up. To do this, follow these steps:

1.

If you've haven't defined a new site for the Chapter 12 files it's okay, we'll use this time to do that. With Dreamweaver open, select the Manage Sites option from the Site menu.

2.

If you have a previously defined Dorknozzle site in the Manage Sites list, you can use this opportunity to change its properties to point to this chapter's files by selecting the site within the list and clicking the Edit button. The Site Definition for Dorknozzle dialog appears.

3.

In the Local Info category, we'll want to make one change: We'll change the Local Root Folder to point to C:\Dorknozzle\Local\. When you've made that change, the screen resembles Figure 12.3.

Figure 12.3. Define the Local Root Folder in the Local Info category to point to the location where you want local files to be stored while in development.


TIP

If you're implementing the first model, where your local and remote files are located on two separate machines, your local root folder might simply point to C:\Dorknozzle\.

4.

With the local root folder set, switch over to the Remote Info category. Select the Local/Network option from the Access list. More options become available. In the Remote Folder text box, enter the path to the fictitious company's remote server. In our case, the remote files are located in C:\Dorknozzle\Remote\.

TIP

If you're implementing the first model, where your local and remote files are located on two separate machines, your remote folder might point to the organization's web folder on the network using the following model: \\<computername>\<foldername>. Of course, this path works, assuming that your site is shared on the network. If it's not, you'll need to contact your system administrator for further details.

5.

Your next step is to click the Enable File Check In and Check Out check box.

6.

With the check box enabled, we can now set other options for identifying the person checking files in and out. Specifically, we can enter the name and email address of the user (you). Second, we can also click the Check Out Files When Opening check box. Doing this guarantees that whenever we open a file that has already been checked in on the local side, the file will automatically be checked out on the remote side. When you finish setting the final three options, your Remote Info screen should resemble mine, shown in Figure 12.4.

Figure 12.4. Set the properties to identify the person checking files in and out.


7.

Click OK to close the Site Definition for Dorknozzle window.

8.

Click Done to close the Manage Sites dialog.

Before we start checking out files, we'll want to synchronize the local folder with the files contained in the remote folder. This will ensure that the files in the local folder are exact copies of those in the remote folder. You can synchronize the files by following these steps:

1.

Select the Synchronize Sitewide option from the Site menu.

2.

When the Synchronize Files dialog appears, select the Entire 'Dorknozzle' Site option from the Synchronize menu. Also choose the Get Newer Files from Remote option from the Direction menu.

3.

Click Preview.

4.

When the Synchronize preview window appears, click OK to proceed with the synchronization.

Now you can click the Expand/Collapse icon in the Files panel to expand the Files panel into the Site Management window. As you can see from Figure 12.5, the remote files (located in the C:\Dorknozzle\Remote\ folder) appear in the left pane while the local files (located in the C:\Dorknozzle\Local\ folder) appear on the right.

Figure 12.5. Opening the Site Management window reveals the remote files on the left and the local files on the right.


Also notice that the local files appear with small lock icons next to them. Because we haven't checked these files out, we can view them in only read-only mode. To edit these files, we'll have to check them out. Let's do that now.

Checking Files In and Out

Now that you've enabled the Check In and Check Out feature, you can begin using it for the Dorknozzle project. To do so, simply right-click a file in the Files panel and choose the Check Out option from the context menu. Dreamweaver then asks you if you want to include dependent files when checking out the HTML file. Because we have read-only copies in our local folder, we'll select No. As you can see from Figure 12.6, the file is checked out to you.

Figure 12.6. The file is checked out to you. You can tell by the icon change and the user's name in the Checked Out By column.


TIP

When we defined our site in Chapter 4, "Dreamweaver Site Management," we enabled the Check Out Files When Opening check box. Because this is the case, we need only to open the local file (by double-clicking to open it) in Dreamweaver. As soon as you do this, the file is automatically checked out.


You can tell the file is checked out to you because the file's icon changes from a lock icon to a green check mark icon. This means the file is checked out. Furthermore, your name appears in the Checked Out By column. As you can see, these properties are set in both the Remote and Local panes. What this means is that when a member of your collaborative team defines a site to the same remote folder, your name appears as the user who has checked out the file. If the other user tries to check out the same file, he won't be able to. He can only view the file, not write to it. Now that the file has been checked out to you, you can open it and make any necessary changes. When you finish, you can check it back in by right-clicking the file in the Files panel and choosing the Check In option.

If you check out a file and aren't happy with the changes you've made, you can also select the Undo Check Out option from the context menu. This command replaces the local file with the last version that was checked in from the remote.




Macromedia Dreamweaver 8 Unleashed
Macromedia Dreamweaver 8 Unleashed
ISBN: 0672327600
EAN: 2147483647
Year: 2005
Pages: 237
Authors: Zak Ruvalcaba

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