Version Control

[ LiB ]

When you work with multiple developers, communication is important. Version control software can prevent miscommunication disasters. Version control software controls the editing of files by allowing a file to be edited by only one person at a time. It also ensures that everyone is working on the latest version of the page. There are a couple of different ways to ensure version control. One is to use Dreamweaver's built-in control system. Another is to install a full-fledged version control program on the server.

Server-Based Version Control

Dreamweaver MX 2004 continues to support source and version control systems such as Microsoft Visual SourceSafe (VSS) and WebDAV-enabled softwaretwo large, complex pieces of administrative software that are installed on web servers to control workflow. These applications act like librarians sitting on the server. Anytime a team member wants to work on a particular file, she must "check it out" from the server, like checking a book out from the library. After a file is checked out, it still exists on the server, but no other team members are allowed to access it until the original member checks it back in. Just like a human librarian would, the server software keeps track of who checks out files and when, so team members and managers can watch the workflow progress by monitoring which files are being accessed.

If your web server uses either of these technologies, you can take advantage of its version control features while working in Dreamweaver by using special protocols to connect to the remote server, as defined in the Remote Info section of the Site Definition dialog box.

Visual SourceSafe Integration

Currently, only Windows computers can connect to a VSS server-side database. Windows users need to obtain and install the Microsoft Visual SourceSafe 6.0 client software on their computer before they can configure Dreamweaver to work with VSS.

Currently, there is no way for Macintosh users to connect to a VSS database. MetroWerks used to make a client that was used to connect Macintoshes to VSS, but it has discontinued that product. Current owners of MetroWerks VSS client should be able to connect with Dreamweaver MX 2004. To find out the latest on this, visit www.macromedia.com/support/dreamweaver/ts/documents/vss_on_mac.htm .


To set up Visual SourceSafe for your site (see Figure 19.7), follow these steps:

Figure 19.7. Using the Site Definition dialog box to set up Visual SourceSafe integration.


  1. Open the Site Definition dialog box for the site, and go to the Remote Info category.

  2. From the Access pop-up menu, choose SourceSafe Database. This is the method Dreamweaver uses to connect to the remote server.

  3. The dialog box changes to present VSS options. Click the Settings button, which appears next to the Access menu. The Open SourceSafe Database dialog box appears. Enter the following settings:

    • For the Database Path, browse to or enter the path of the SourceSafe database you want to use. This is a srcsafe.ini file and is used to initialize SourceSafe.

    • For the Project, enter the SourceSafe project you want to use as the root of the remote site. Note that this field must contain $/, but anything else is optional.

    • Enter your username and password in the remaining fields. You can choose to save your password or require it to be entered each time you connect to the database.

    When you're done, click OK to close the Settings dialog box.

    If you're unsure of any of these settings, contact your system or network administrator for assistance, or consult the Microsoft Visual SourceSafe documentation.


  4. Back in the Site Definition dialog box, choose the Check Out Files When Opening option in the check box if you want Dreamweaver to check out the files from the SourceSafe database when you double-click them in the Site panel.

  5. Click OK to save these changes and close the dialog box.

You now can connect to and disconnect from the SourceSafe database and use normal Dreamweaver file control commands such as Get, Put, Check In, Check Out, and Refresh.

WebDAV Integration

Short for World Wide Web Distributed Authoring and Versioning , WebDAV is a protocol rather than an application. It defines additional HTTP methods and headers and is an extension to the HTTP/1.1 protocol. WebDAV can be integrated into HTTP servers such as Apache and Microsoft's Internet Information Server (IIS). Unlike VSS integration, to connect to a WebDAV server, you don't need any special client software on your computer.

For more information on HTTP servershow they work and what they dosee Chapter 21, "Building Dynamic Sites with Dreamweaver."


To set up WebDAV integration for your site (see Figure 19.8), follow these steps:

Figure 19.8. Using the Site Definition dialog box to set up WebDAV integration.


  1. Open the Site Definition dialog box for the site, and go to the Remote Info category.

  2. From the Access pop-up menu, choose WebDAV. This is the method Dreamweaver will use to connect to the remote server.

  3. The dialog box changes to present WebDAV options. Click the Settings button, which appears next to the Access menu. The WebDAV Connection dialog box appears. Enter the following settings:

    • For the URL, enter the full URL of the site to which you want to connect. This includes the protocol used ( http:// ) as well as the directory, if not just the domain root. Important tip: HTTP requests are usually routed by the server to port 80. If you want to use a port other than 80 to connect to the WebDAV server (recommended), append :PortNumber to the end of the URLfor example, http://www.webdav.org:81 as opposed to http://www.webdav.org .

    • Enter your username and password into their respective fields. You can choose to save your password or require it to be entered each time you connect to the database.

    • Enter a valid email address in the Email text box. This is used on the WebDAV-enabled server to identify who is using a particular file. It offers contact information accessible via the Site panel.

    When you're done, click OK to close the Settings dialog box.

    If you're unsure of any of these settings, contact your system or network administrator for assistance. You can also consult the WebDAV documentation or go to www.webdav.org for help.


  4. Back in the Site Definition dialog box, choose the Check Out Files When Opening option in the check box if you want Dreamweaver to check out the files from the WebDAV site when double-clicking them in the Site panel.

  5. Click OK to save these changes and close the dialog box.

You now can connect to and disconnect from the WebDAV database and use normal Dreamweaver file control commands such as Get, Put, Check In, Check Out, and Refresh.

Version Control Using Check In/Check Out

Unless you're working in a large corporation, you probably won't need the power of VSS or WebDAV. No matter where you're working, your design team might not have any say in the software configuration of the company web server. But you might still benefit from some sort of version control system.

The Dreamweaver Check In/Check Out feature provides a good, inexpensive alternative to server-based version control, along the same lines as that found in VSS and WebDAV, but without any server-based components . Similar to those other solutions, when using Check In/Check Out, Dreamweaver acts as a librarian, keeping track of who has accessed what files, and restricting the same file from being accessed by two different team members at the same time.

Because Dreamweaver doesn't reside on the web server, like VSS and WebDAV do, it approaches this librarianship differently. When Check In/Check Out is enabled on the team members' computers, each member's Dreamweaver program treats the files on the remote server as a repository, like a library. To open files and edit them, users must "check the files out" from the server. When a user does this, Dreamweaver creates an invisible file on the server, stored in the same directory as the file being checked out and named with that file's name followed by the extension .lck. If someone checks out the file about.htm , for example, Dreamweaver creates a file called about.htm.lck . This "lock" file indicates that the file in question is currently checked out and should not be edited. When another user tries to open the same file using Dreamweaver, that user's program tries to check the file out, finds the LCK file on the server, and informs the user that the file is checked out. When the original user is done editing the file, he checks it back in, and the LCK file is deleted from the server. Other copies of Dreamweaver now recognize the file as available.

Although LCK files do not show up in the Dreamweaver interface, you can view them by accessing the remote site with another FTP program or Telnet window. Or, if the remote site is located on a Windows or Macintosh computer, and if you have local network access to that computer, you can view them by setting your system preferences to show hidden files.


Note that because the site documents on the web server are not actually made read-onlythey are just marked with LCK files that only Dreamweaver recognizesonly Dreamweaver considers the files locked. Other programs, such as other FTP programs and web editors, can open and edit the files. This means that Check In/Check Out is not a secure system. It presumes that all team members will play fair and won't try to access locked files while no one else is looking. This system is easily overcome by simply Getting or Putting the file. If Check In/Check Out is being used, everyone has to use it for it to work properly.

When a user checks a file back in, Dreamweaver makes the local version read-only. This prohibits team members from making changes to a file without "permission" to edit it.

Configuring the Check In/Check Out System

The Check In/Check Out system cannot be used until you have established remote site information in your Site Definition. This is because when you check out a file, you are doing so from the remote site (which everyone on the project has access to). Setting up your remote site is discussed in the section "Defining a Remote Site" in Chapter 18, "Site Publishing and Maintenance."

To set up your file Check In/Check Out options, follow these steps:

  1. Access the Site Definition dialog box by choosing Site > Manage Sites. Select the site you want to modify, and click Edit.

  2. In the Site Definition dialog box, go to the Remote Info category. Either FTP or local/network should be the access method used to enable file Check In/Check Out on your site.

  3. Select Enable File Check In and Check Out. When you do this, additional entry boxes appear, as shown in Figure 19.9. Fill them out as follows :

    Figure 19.9. Configuring the Check In/Check Out feature in the Site Definition dialog box.


    • Automatically Upload Files to Server on Save. As it says, this option uploads the new version to the server every time you save. This might be a good choice so that you don't have to manually check in when you are done editing. But if you save the file frequently as you work, which is a good idea, this might not be a good option.

    • Check Out Files When Opening. Selecting this option automatically checks out files whenever you open them by double-clicking them in the local Site Files list. If you open a file by choosing File > Open, you are prompted to check out the file or open it as read-only, even if this option is selected.

    • Check Out Name. This is the name that is displayed in the Site panel next to any file you have checked out. This should be either your name, if you access files from only one computer, or perhaps a location, such as John-Home or John-Office. This helps you and others know who has checked out the file and where that person might be.

    • Email Address. Enter your email address in this area. This causes your Check Out name to become a blue hyperlink in the Site panel. Other team members can then click this link to email you regarding the file. When they do so, their default email application opens with your email address in the To field and the file in question (as well as the site that the file is from) in the Subject line. I highly recommend that you use this feature of the Check In/Check Out system.

  4. After you have selected your options, click OK.

Check In/Check Out in the Site Panel

After you've enabled Check In/Check Out, the Check In and Check Out buttons in the Site panel become available, and the Remote and Local Site Files lists display information indicating their status, as shown in Figure 19.10.

Figure 19.10. The Site panel when Check In/Check Out is in use.


Checking Files in and Out

You can use either the Site panel or the Document window to check files in and out, as shown in Figure 19.11.

Figure 19.11. Site panel toolbars for working with Check In/Check Out.


To check files in and out using the Site panel, do one of the following:

  • Select the file (or files) in the Local Site files pane of the window, go to the Site panel toolbar, and click the Check In or Check Out button.

  • Select the file(s) in the Local Site files list, and choose Site > Check In or Site > Check Out.

  • Right-click (Windows) or Ctrl-click (Mac) the file in the files list to access the context menu, and choose Check In or Check Out.

To check files in from within the Document window, do one of the following:

  • With a checked-out document open, go to the Document toolbar and click the File Management icon. From the File Management menu, choose Check In.

  • With a checked-out document open, select Site > Check In.

After you've checked in an open document, it remains open and editable, but the File > Save command behaves like File > Save As because the original file is now read-only.

Tips for Working with Check In/Check Out

As with any powerful organizational tool, Dreamweaver Check In/Check Out offers various handy options you can take advantage of, and a few pitfalls you can stumble into.

"Undoing" File Checkout

To "undo" a file checkout, select the file(s) you want to discard any changes to, and select Site > Undo Check Out. This differs from just checking the file back in because the original version of the file on the server is downloaded again, overwriting your local copy. You also can right-click the file(s) in the Site panel and select Undo Check Out from the context menu that appears. Choosing this action closes the files, discarding any changes made, and reverts to the version that existed before you checked out the file. It also sets your local copy to read-only and allows other teammates to check out the file.

If you check in the currently active document this way, it is saved (according to your preferencessee Chapter 28, "Customizing and Extending Dreamweaver") and then is checked in to the remote server. If you check out a currently active document this way, the copy on the remote server overwrites it, and any changes you made that don't exist in the remote version are lost.

Remembering to Check In

Many Dreamweaver users have a hard time remembering to check in files. They tend to just use the Put command instead. Although this updates the remote copy of the file, it doesn't check in the file and remove the checked-out status. If you forget to do this, you might get an email from coworkers wondering what's taking you so long with a file you were finished with two days ago. Also, if you use the regular Get and Put commands, you can overwrite files that have been checked out by others, which defeats the point of the system. Remember to use the correct command!

Unlocking Checked-In Files

After you've checked a file in, you no longer have access to it for editing because it has been set to read-only at the system level. But occasionally, you might need to edit these locked files. Your coworker might have checked the file out and gone on vacation, taking his computer with him. Or your company might have decided not to use Check In/Check Out, so you have disabled it on your computer (by deselecting it in the Site Definition dialog box).

Checked-in files can also be unlocked outside Dreamweaver. Right-click the file in Windows Explorer and choose Properties from the context menu, or select the file in the Macintosh Finder and choose File > Get Info. In Windows, turn off the read-only option. In Macintosh, deselect the Lock option.


To unlock a checked-in file, do one of the following:

  • In the Site panel, right-click (Windows) or Ctrl-click (Mac) the file to access the context menu, and choose Turn Off Read Only.

  • If Check In/Check Out has been disabled, select the file in the Site panel and choose File > Open, or double-click the file to open it. Dreamweaver prompts you to choose between viewing the file as read-only and making it writeable (unlocking it).

In Dreamweaver MX 2004, many of the menus have been streamlined and changed. There is no longer a Site menu on the Files panel when collapsed in the window. Right-clicking or Ctrl-clicking brings up the Site menu options. There is a Site menu at the top of the regular document view and also when the Site panel is expanded. The options in this menu change a bit depending on which view you are in.

Right-clicking usually brings up all the relevant commands for the area where you are clicking.


When to Use Check In/Check Out

So when is the Check In/Check Out feature ideally used? It is most often used in a workgroup environment where several people are working as a team on a particular site and plan to work on the same specific files or documents. It should (or could, at least) be used anytime more than one computer is accessing the files and changing them. This could even be a small office/home office environment in which you are the only person changing the site, but may do so from more than one workstation. It is also conceivable that you might take some work on the road with you via a notebook computer and you want to make sure that you or someone else doesn't inadvertently modify files from your work or home workstation.

Exercise 19.2. Checking Files In and Out

In this exercise, you'll work some more with the website created in the previous exercise. You'll enable Check In/Check Out and experiment with checking files in and out.

If you haven't done so already, download the chapter_19 folder from the book's website to your hard drive. Define a site called Chapter 19, with local as the local root folder and remote as the remote folder. (See Chapters 17 and 18 for more about defining local and remote sites.)

  1. To enable Check In/Check Out for the site, access the Site Definition dialog box and go to the Remote Info category.

    Select the Enable Check In/Check Out option.

    Select the Check Out When Opening option.

    For your Check Out Name, enter your name. (It's a matter of choice whether your team will want complete first and last names , or short usernames that will be easy to read in the Site panel.)

    For your Email, enter an email address.

    When you're done, click OK to close the dialog box.

  2. Checking in and out involves working between the local and remote site, so expand the Site panel to show both sets of site files.

  3. Files must be checked in before they can be checked out. Select all files in the Local Site Files list, and click the Check In button in the Site panel toolbar.

    Note how all files in the Local site now have padlock icons next to their names. These files are now locked.

  4. Check out index.htm by selecting it in the Remote site and clicking the Check Out button in the Site panel toolbar.

    This file appears in the Remote site and in the Local site with a green check mark by its name. You have checked out that file. (To all other design team members who access the Remote site, the file appears with a red check mark.)

    Your name also appears in the Remote site file list, in the Checked Out By column. Adjust the size of the Site panel and its panes, if necessary, until you can see this column.

    If you entered an email address when you enabled Check In/Check Out, your name appears as a link (blue and underlined ). When you click it, your default email program launches, ready to send a message regarding the checked-out file.

  5. From your Local site files, try opening solution.htm by double-clicking it. The file opens because you selected the Check Out File When Opening option when you enabled Check In/Check Out. If you look at the Site panel, the file appears with its little green check marks in place, indicating that it has been checked out.

  6. Close any files that are open. Right-click the File Name tab in the Document window, and choose Close All. It's time to check in! In the Local site, select index.htm (it should still be checked out from earlier in the exercise) and click the Check In button on the Site panel toolbar. Its green check marks disappear, and a padlock appears in the Local site file. That file is checked in.

  7. Now see what happens if you put a file without checking it in. Select solution.htm and click the Put button, instead of the Check In button, in the Site panel toolbar. The green check marks are still there. The file has been uploaded to the Remote site but not checked in.

  8. Finally, see what happens when you disable the feature. Access the Site Definition dialog box for the site, and go to the Remote Info category. Deselect the Enable Check In/Check Out option. Click OK to close the dialog box.

  9. Examine the Site panel. All the padlocks are still in place! Try to open one of the HTML files in the Local site. Dreamweaver knows that Check In/Check Out is disabled, so you aren't prompted to check the file out. But because the file is locked, you need to unlock it before you can edit it.

  10. To unlock all the files in the site with one action, select all the files in the Local site, right-click, and choose Turn Off Read Only. All the padlocks disappear.

[ LiB ]


Macromedia Dreamweaver MX 2004 Demystified
Macromedia Dreamweaver MX 2004 Demystified
ISBN: 0735713847
EAN: 2147483647
Year: 2002
Pages: 188
Authors: Laura Gutman

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