|[ 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.
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.
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:
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.
If you're unsure of any of these settings, contact your system or network administrator for assistance, or consult the Microsoft Visual SourceSafe documentation.
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.
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:
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.
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.
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.
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.
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:
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.
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.
You can use either the Site panel or the Document window to check files in and out, as shown in Figure 19.11.
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.
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.
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.
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!
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.
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.
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.)
|[ LiB ]|