DW and VSS Interaction

Source: Internet
Author: User
Because the web project code is very scattered and not concentrated, there are hundreds or more large web project code source files and dozens of small ones, how to properly manage these source codes is still a problem. This article proposes a solution for code control during web project development. We will use Dreamweaver MX and visual sourcesafe to implement full control over web project code development. These two types of software are familiar to everyone, but I will briefly introduce them to keep the integrity of this article.

Dreamweaver MX (dw mx for short) is one of the three musketers of Macromedia's webpage production. Its powerful functions are not repeated here. dw MX integrates all the functions of Dreamweaver 4 and Dreamweaver ultradev 4, he is also suitable for Web interface developers and Web Background developers. dw mx supports almost all common dynamic web programming languages, such as PHP, ASP/Asp.net, and JSP, he integrates the functions developed by the team. For example, design notes can facilitate communication between developers and connect to the vislual sourcesafe database, achieve the purpose of code control.

Visual sourcesafe (VSS) is a member of the Microsoft Visual Studio 6.0 development product family. Its main function is to control the project version and source code, it records in detail all the modifications and version information of a source code file from creation to release. It also allows you to view all historical records and compare and analyze the source code at different times, restores the code to a specific time point and version status. VSS has powerful user management permissions and can set R (read), C (check out), A (ADD), and D (destroy) permissions for each user, which is very suitable for team development.

I. Network Environment Construction

Figure 1-1 describes the network environment topology developed by the team:

Figure 1-1 network topology Development
The main function of the server is to proxy the Internet and control the entire network, while the test server is mainly responsible for code debugging. On this server, we need to build the same platform as the Web Publishing Server (including internal DNS, to save resources and install a database on the server, the backup server is mainly used for data backup, including code development, development documentation, and regular website backup, regularly perform physical backup of data on the backup server (mainly to save the data to an active hard disk or compress it into a cd), and install VSS on the backup server, of course, if your development resources are rich, I think it is necessary to add database servers and VSS servers.

Install the VSS server, dw mx, and VSS client on the server and Development client respectively. When configuring VSS, explain the two most basic concepts: Check out, download the latest file content from the VSS database to the local working path, and lock the file, modification by others is not allowed, but the latest file content can be obtained. Check in: update the modified files in the local working path to the server, set the file attribute in the local path to read-only, and release the lock status of the file on the VSS server, this is the basic concept of VSS. The following describes how to create a VSS project.

1. Open the VSS administrator interface, execute the tools/create Databse command to create a VSS database, and then execute the users/Open sourcesafe database command to open the VSS database.

2. Run the users/Add USER command to open the figure 1-2 operation interface and enter the user name and password. If you only grant the read-only permission to the user, select the read only check box.

3. Set User Permissions. On the Management page, select the user name cat with the mouse, and run the tools/rights assignments for user... command to open the dialog box for setting user permissions. There are four permissions, which indicate read (read-only), check out/check in (File Import and Export ), add/rename/delete (Add/modify/delete files on VSS) and destroy (delete permanently and cannot be recovered. Be careful when setting ). Repeat steps 2 to 3 to add other members in the Development Group.

Figure 1-3 Set User Permissions
4. Set the directory structure in the VSS project, click the Microsoft Visual sourcesafe 6.0 command in the program bar, the logon dialog box is displayed, enter the user name or password, and Click Browse... click to find the VSS directory path shared by the server (network path supported ).

5. Create an object and execute file/create project... command, you can also directly click the button in the shortcut menu bar to open the create object dialog box 1-4, where you can enter the Object Name and related descriptions. The created object is displayed as a folder in the all projects column of VSS.

Figure 1-4 Create object dialog box
6. add files. The VSS user interface supports folder drag and drop operations. First, go to the project (folder) and select the files to be put on the server locally, drag it to the user interface of VSS and a dialog box 1-5 will pop up. You can enter comments in the dialog box. Is there anything else that might have been brought together? /P>

Store only Latest Version: Save the last version of the file.

Check out immediately: Check out the file after it is added.

Remove local copy: After the file is added, the local file will be deleted. It is best not to select this item when adding the file.

File Type: select the type of the file to be added. Generally, select Auto-detect (Automatic Identification). You can select binary and text files for the project.

This section describes the settings of VSS. before preparing for development, you must create a folder and a group user account in VSS. Figure 1-7 shows the created VSS object structure.

Figure 1-7 user interface of the VSS Client
Since VSS has been defined, it is not difficult to connect DW to VSS. The following describes how to configure DW.

1. Go to the DW editing interface and execute site/new site... command to open the define site dialog box, the default is the local Info (Local Information) tab, fill in the development project name and the address of the project source code in the interface, fill in the Figure 1-8 after filling out.

Figure 1-8 local Info tab
2. In the site definition option dialog box, select the remote Info (Remote Information) Tab 1-9, and select sourcesafe database in access (Remote Access type. Automatically upload files to server. After saving the modified files in DW, the modified information is automatically updated to the VSS server. Check out file when opening, open the file in DW and automatically check the corresponding file on the server.

3. Click the settings... button on the remote Info tab to open the dialog box 1-10. In this dialog box, enter the database path and VSS database path respectively ,. Project path. Note that the object path must start with $. The path supports Chinese characters. Enter the user name and password of the VSS user.

Figure 1-10 VSS client Logon Settings
4. In the site definition option dialog box, select the testing Server Tab 1-11 and server model: select the technical type used by the web project, DW supports most dynamic Web languages. Access: access type, including FTP and local/Network (Local/LAN), and testing server: Test server address. Refresh remote file list automatic: automatically refresh the remote file list. URL prefix: the URL address accessed by the test server.

Figure 1-11 testing server
Now, the configurations of DW and VSS have been basically configured, and all the configurations mentioned above must be set. Otherwise, the two types of software cannot work together, other parameters can be set as needed.
In this step, you can develop it. Since DW and VSS have been connected, you do not need to log on to VSS to perform routine operations on the VSS file, it can be easily implemented directly in DW. In the following two aspects, we will introduce the development in DW and then compare the version control and code recovery in VSS.

(1) Related Applications in DW

1. Connect to the VSS server in DW

The first thing to do after opening the DW editing window is to connect to the remote server, that is, the VSS server. Execute site/site files in DW... run the command or press the F8 shortcut to open the site panel in Figure 1-12. On the site panel, you can view the local file list, test Server File List, and remote VSS file list. We write and operate files in the local view. Of course, you can also choose not to connect to the remote server. When you open a file that has not been checked out by other team members locally, DW automatically connects to the VSS server and checks the file out automatically, files in the site panel are in three states: the current file is not edited by any other member check out. In this case, the file DW adds a small lock before the file name. The file is checked out by itself: that is, the file is being edited or checked out, and DW adds a green check mark before the file name. The file is checked out by others: the file is checked out by other team members, and DW adds a red check mark before the file name.

Figure 1-12 site panel
2. Basic operations on source code files

In Figure 1-12, you can perform put/get, check out/in operations on the file on the site editing interface. Check out and check in are not described previously. Put uploads a local file to the VSS server, and get downloads the file from the VSS server. The difference between put/get and check out/In is whether VSS backs up and records operations on the file content, and check out/in operations have corresponding records on VSS, but put/get does not.

On the site interface, you can drag and drop the file to implement put/get, drag a file from the VSS server in the default DW settings, and a prompt box (check out/In will also display this prompt box) appears ), the text box indicates whether to put/get (check out/In) All files connected to the file ). We strongly recommend that you select no here, and check the check box for not prompting messages. If you select Yes, your operation will be very slow and cause some unnecessary errors (DW will overwrite the locally modified but not checked in files with the old files on VSS ), DW operates all the files associated with the current file, such as include files, image files, and CSS files. In fact, some files do not need to be modified frequently. If one day you need to select it to simultaneously operate the files associated with it, execute edit/preferences... command to open the parameter Settings dialog box, select the site tab, and select the two check boxes in dependent files.

Figure 1-13 prompt box
3. Design Notes)

Careful people may find several small yellow marks behind the file names in Figure 1-12. This is a feature design notes (Design Notes) added by Macromedia when developing Dreamweaver 3.0 ), developers can add design notes and experiences to this file. These notes and experiences are accumulated and can record the notes of various developers, this information can be viewed by any developer who opens the file, so that the developer can easily hook up the file. These notes can also be stored on the VSS server when DW and VSS are used for joint development. VSS has a comment (comment) function for each file, which is a bit different from DW's Design Notes function. However, DW's design notes are much more powerful and Desgin notes is recommended, in dw3 and dw4 versions, design notes do not support Chinese, but DW mx supports Chinese. This is a good news for those who are not very good at English.

To add Design Notes to a file, select the file with the mouse on the files panel, and click "create right" to display the shortcut menu and run the Design Notes Command, as shown in figure 1-13. There are two tabs on the interface. One is basic info and the other is all info. Select the current version of the file first, then, add information in the notes text box. You can click the date button to insert the date of the current system. You can view all notes on the all info tab.

Figure 1-14 design note dialog box
4. Synchronize)

Synchronization is to unify the local source code and the source code on the remote server. If the source code is not uniform, the latest local or old server files will be overwritten. Select a local source code from the site panel, and click "create right" to display the shortcut menu and execute synchronize... command to open the dialog box 1-15, in which you can set the synchronization mode with the remote server (VSS server.

Figure 1-15 design note dialog box
The synchornize drop-down menu has two options:

A. Synchronize the entire local site with the remote server. The defined site name is displayed.

B. Synchronize only selected local files with files on the remote server. You can press and hold the ctrl key to select multiple files and synchronize the corresponding files on the remote server.

The direction (mode) drop-down menu has three options:
Put newer files to remote: place the latest files on the remote server.
Get newer files from remote: Get the latest file from the remote server.
Get and put newer files: Keep the latest files on both the local and remote servers.

The check box means to delete all files not on the local server.

After setting the parameters, click the preview button. Then, DW automatically searches for the files to be updated according to the rules. If there is no file to be synchronized, a message box is displayed. Otherwise, the synchronization is completed.

Since you can perform regular operations on VSS files in DW, developers do not need to perform operations on the VSS client frequently, for example, you need to set the version for the code and restore the file in VSS. VSS records the entire process from creation, modification to release of a source code file, and records the check in operation on the file each time. Therefore, it is very useful in source code troubleshooting and debugging. The following describes some typical VSS operations.

1. Source Code operations

Log on to the VSS client interface, select the source code file, and click the shortcut menu displayed on the right to execute the show history... command. The History option 1-16 is displayed. This is the record viewing option, where you can define the history you want to view.

Figure 1-16 historical options
Include labels: contains the tag history specified by the user.
Labels only: displays only historical records with user-defined tags.
From: restrict the start date of the query history. You can enter the date, date: time, version, or label ), in the format of input date and time, you need to add a prefix "D", such as "d02/29/95;". You need to add a prefix "L", such as lbeta1 when entering the version number. If only the date format does not require any prefix, the following formats are valid: 08.15.95, 08-15-95, or 08/15/95 format, but not as August 15,199 5, note that these time formats are a habit of foreigners. You need to pay attention when entering them.
To: restrict the end date of the query history. You can enter the date, date: time, version, or label. The input rules are the same as those of from.
User: Specifies the user name.
After entering a specific condition, click "OK" to bring up the history list, 1-17 history list.

Figure 1-17 history list
View: view the source code details. If it is a binary file, it cannot be displayed normally.
Details: view the file details. Click this button to display a dialog box that displays the file version information, operation time, operator, and file comments.
Get: Get the source code file of the current history, not the latest version of the code.
Check out: Check out the file.
DIFF: source code comparison. Click this button to bring up the source code comparison option dialog box. Click "OK" to open the page 1-18. You can clearly see the similarities and differences of the code from the interface. In VSS, three colors are used to identify code changes. The blue code indicates the row to be deleted, the red code indicates the modified Code, and the green code indicates the newly added code.

Figure 1-18 source code comparison
Pin/unpin: Lock/unlock the selected source code file and do not allow others to perform the check out/in operation. After the file is locked, VSS adds an identifier before the file name.

Rollback: Restore the current version. This operation is irreversible. After the source code is restored, all history records later than this record are cleared. We recommend that you do not use this function too much. You can click "get" to obtain the source code of the current version, and then modify the source code. This keeps the history unclear, the rollback function is also available.

Report: comparison report. VSS outputs the analysis results to the printer, file, and clipboard.

2. Restore deletion records

In VSS, you can restore deleted files and objects. If you select destroy permanently (permanently delete) When deleting files, this operation cannot be recovered. Only users with the destroy permission can be permanently deleted. Of course, only users with the destroy permission can restore the deleted files. Select an object (that is, a folder) in the all projects window on the VSS client interface, and click "create on the right" shortcut menu to execute properties... command to open the property Panel of the object and select deleted items (delete project) Tab 1-19.

You can press Ctrl to select multiple files, and then click the recover or purge button.


3. Version Control

After the web project is developed, it is necessary to seal the source code to facilitate project release and upgrade, select an object (that is, a folder) in the all projects window on the VSS client interface, and click "create right" to display the shortcut menu and execute label... command to open the version setting window 1-20

Figure 1-20
You only need to enter the version number in the label and click OK. You can enter the description in the comment. After a version is blocked, all the source code of the Project is blocked with a version. From 1 to 17, you can see that the action with a history record is "label 1 ".

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.