Implementing Source Control with Visual SourceSafe


As you saw in the beginning of this chapter, Dreamweaver exposes functionality that allows you to use file Check In and Check Out within its framework. The functionality and implementation is simple; you check out a file from Dreamweaver and the program automatically locks it by creating a duplicate of the file name with an LCK extension.

This LCK file contains the username and email address of the user who has checked the file out. This way, when someone else defines the same site, the LCK file is read into Dreamweaver and the user is alerted of the file's checked-out status in the Site Management window. Although this process works fine if your organization exclusively uses Dreamweaver, it wouldn't be the ideal solution when working in large, enterprise-level environments where different departments could potentially be using programs other than Dreamweaver. For instance, although the marketing and web development departments could be using Dreamweaver, the engineering group could be using something completely different in Microsoft Visual Studio .NET. Executives and admins could be making simple edits to web pages using Microsoft Word, while network administrators might wind up using FrontPage to edit web-based network documentation and FAQs. You can begin to see that a train wreck is imminent. A company executive might dislike the wording on his/her bio and instruct their admin to edit the page to their liking. With Microsoft Word in hand, the admin could open the page and make edits. Word, not recognizing the LCK file association, would proceed with the modification. Even worse, anyone with access to the web server could easily go into the folder that contains the LCK files and simply delete them.

To avoid a scenario such as this, you and your organization might decide to integrate a more robust, enterprise-level source control and versioning software package such as Microsoft Visual SourceSafe. Available for just under $50, SourceSafe is an excellent third-party source control and versioning package that you can easily tie right into Dreamweaver. At its heart, SourceSafe functions much like Dreamweaver in that you can check out, make changes to, and then check in files. Beyond the simplicities of Dreamweaver however, SourceSafe also integrates versioning, so that at any time during development, you can revert back to an older version of the same file, also known as rolling back. Furthermore, SourceSafe uses its own proprietary database (an instance of FoxPro), effectively preventing prying eyes from viewing and making changes to files. On top of these benefits, SourceSafe includes features for comparing code (line by line) for one version of a file to any older checked-in version of the same file.

With all this said, it's important to understand SourceSafe's place and its place within your organization. If you're not sure whether or not you need source control, keep the rules outlined in Table 12.1 in mind.

Table 12.1. Deciding to Use Source Control in Your Organization

Organization Size

Rule

1 developer

Source control is not immediately necessary

26 developers

Dreamweaver's integrated source control would suffice

6 or more developers

You may want to think about purchasing a product such as Visual SourceSafe


Dreamweaver's integration with SourceSafe is simple. Although you'll still be required to set a local folder path, the remote path is set up to point to your SourceSafe database.

NOTE

This book isn't intended to cover the installation procedure for SourceSafe. It's important to note however, that you'll need to install the standalone database on the computer that will host the SourceSafe database (the remote computer). The computer you will use to connect Dreamweaver and SourceSafe to (your local computer) needs the SourceSafe's client tools installed.


To configure Dreamweaver to work with SourceSafe, start out by configuring SourceSafe on the server. You can do this by following these steps:

1.

Assuming that you've installed SourceSafe on a separate development computer, start by logging in to the SourceSafe database. When the Visual SourceSafe Login dialog appears, enter your credentials and click OK.

2.

Right-click the database root ($/) and select the Create Project option, similar to Figure 12.19.

Figure 12.19. Create a new project in the database root.


3.

After the Create Project dialog appears, enter the name Dorknozzle and click OK. The new Dorknozzle project appears under the root.

4.

Open the folder that contains the remote files either for your organization or for Dorknozzle and drag all the files (the Assets folder, Images folder, and root files) into the Dorknozzle project within SourceSafe.

5.

When the Add File dialog appears, click OK.

6.

When the Add Folder dialog appears, enable the Recursive check box, similar to Figure 12.20. This option adds all folder and files within that folder to SourceSafe without you having to add everything one by one.

Figure 12.20. Add files and folders into the project in SourceSafe using recursion.


7.

Right-click the Dorknozzle project in SourceSafe and choose the Check Out option. The Check Out Dorknozzle dialog appears. Enable the Recursive check box similar to Figure 12.21 and click OK.

Figure 12.21. Check out all the files in SourceSafe.


8.

Now that all the files are checked out, we'll check them back inbut we'll remove the local copy from the C:\Dorknozzle folder. This will ensure that all file references are contained within SourceSafe exclusively. To do this, right-click the Dorknozzle project in SourceSafe and click the Check In option.

9.

When the Check In dialog appears, enable both the Recursive and Remove Local Copy check boxes and click OK.

With that done, the files are removed from the file system and stored exclusively in SourceSafe. Before we move back to the local development machine and start configuring Dreamweaver to use SourceSafe, make a note of the SourceSafe database path. The default path, C:\Program Files\Microsoft Visual Studio\VSS\srcsafe.ini, is used when defining the site in Dreamweaver.

Now let's configure Dreamweaver. You can do this by following these steps:

1.

With Dreamweaver open, select the Manage Sites option from the Site menu. The Manage Sites dialog appears.

2.

Select the Dorknozzle site and click Edit. The Site Definition for Dorknozzle dialog appears.

3.

Although your Local Info should remain the same, the Remote Info will change to coincide with the SourceSafe configuration. Select the Remote Info category.

4.

Select the Microsoft Visual SourceSafe option from the Access drop-down menu.

5.

Click the Settings button. The Open Microsoft Visual SourceSafe Database dialog appears.

6.

In the Database Path text box, enter the path to the srcsafe.ini file on the server. In my case, the path to my INI file on the remote computer is C:\Program Files\Microsoft Visual Studio\VSS\srcsafe.ini.

7.

Enter the Dorknozzle project name in the Project text box. This text box should read $/Dorknozzle.

NOTE

In SourceSafe, the $/ characters signify the root of the database's folder structure, similar in concept to Window's C:\.

8.

Enter the Username and Password (the username and password you created when installing SourceSafe; if your network administrator installed SourceSafe, you must get this information from the administrator) to log into the SourceSafe database. When you've finished, the configured dialog resembles Figure 12.22.

Figure 12.22. Configure access to the SourceSafe database using the Open Microsoft Visual SourceSafe Database dialog.


9.

Click OK to close the Open Microsoft Visual SourceSafe Database dialog.

10.

Click OK to close the Site Definition for Dorknozzle dialog.

11.

Click Done to close the Manage Sites dialog.

Now expand the Files panel by clicking the Expand/Collapse icon to launch the Site Management window. With the window open, click the Connect icon to open the SourceSafe database in the Remote pane, similar to Figure 12.23.

Figure 12.23. The SourceSafe database opens in the Remote Site pane.


NOTE

SourceSafe client tools are required on the client running Dreamweaver. What this means is that to use the SourceSafe integration built into Dreamweaver, you'll still have to install the client tools available on installation disk.


Now you can right-click files and select the Check Out option to check out files exclusively to you.




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