In the past, the team development version of the team was developed by the team. The ASP.NET team developed is also VSS today. I saw this DW MX and VSS collaborative development example, which feels good. Front section for firefighters to change an ASP site, two people coordinating it very difficult ... hehe, it seems my DWMX use is not home ah ... Author: icefire / Cool Page Updated: Legume Source: Pacific network update time: 2004.08.27 contributor mail: jc@ddvip.net Because Web project program code is not concentrated dispersion, big Web project source code for the program files up to hundreds or even more, but also dozens of small, how Rationally manage these source code 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 of web project code development. These two software is more familiar, but in order to keep this paper, I still briefly introduce these two software. Dreamweaver MX (hereinafter referred to as DW MX) is one of the Macromedia.com production three swordsmen, and its powerful features are not repeated, DW MX integrates all features of Dreamweaver 4 and Dreamweaver Ultradev 4, and he is suitable for web interface developers and Web Background developers use, DW MX almost supports all common dynamic web programming languages, such as PHP, ASP / ASP.NET, JSP, etc., his biggest feature is to integrate the function of team development, such as Design Notes to easily develop members. Communicate with each other, he can also link with the Vislual SourceSafe database to achieve the purpose of code control. Visual SourceSafe (hereinafter referred to as VSS) is a member of Microsoft Visual Studio 6.0, the VSS main function is to version control and source control of the project. It can record a source file from all modifications and version information created to the release. Also allow you to view all history and compare the source of different times, restore code to a certain moment and version. VSS has powerful user management privileges that set R (READ), C (Check out), A (Add), D (DESTROY) permissions, which is ideal for team development. First, the construction of the network environment Figure 1-1 will introduce the network environment topology structure of the team development:
Figure 1-1 Development Network Topology
Server's main feature is the agent Internet and the entire network control, and Test Server is primarily responsible for code debugging work, on the server to build a platform with the Web Publish server (including internal DNS, IIS, etc.), in order to save resources on the server Database, the Backup Server server is mainly a backup of data, including development code, development document, and regular backup of the website, regularly performing physical backups on the BACKUP Server server (main point to save data to active hard drives or engraved discs ), Install VSS on the Backup Server server, of course, if your development resources are relatively abundant, I think it is necessary to add database servers and VSS servers. The VSS server, DW MX, and VSS clients are installed on the server and the development client, respectively. In the beginning configuration VSS, explain 2 of the most basic concepts, check out, download the latest content on the VSS database to the local working path, and lock the file without allowing other people to modify, but you can get the latest content . Check IN, update the files that have been modified in the local working path to the server, and set the file properties of the local path to read-only, release the lock state of the file on the VSS server, which is the most basic 2 concepts of VSS. To understand. The detailed steps to create a VSS project will be described below. 1. Open the VSS administrator operation interface, execute the Tools / Create DataBse command to create a VSS database, execute the users / open sourcesafe database command after being created, open the VSS database. 2, execute the users / add user command, open the picture 1-2 operation interface, enter the username and password. If you only give the user read-only permissions, select the READ ONLY check box. Figure 1-2 Add User Interface
3. Set the user permissions, select the username CAT with the mouse in the management interface, then execute the Tools / Rights Assignments for User ... command to open the Set User Permissions dialog box as shown in Figure 1-3. There are 4 permissions in this, and their meaning is Read (read-only), Check Out / Check IN, Add / Rename / Delete (Add / Modify / Delete VSS), Destroy (Remove, you can't restore, be careful when setting it). Then repeat 2 to 3 steps to add other members in the development team.
Figure 1-3 Setting user permissions
4, set the directory structure in the VSS project, click Microsoft Visual SourceSafe 6.0 command in the program bar, pop up the login dialog, enter your username or password, click the Browse button, find the VSS directory path shared by the server (support network path). 5. Create an object, execute the file / create project ... command, or click the button in the shortcut menu bar to open the Create Object dialog box as shown in Figure 1-4, where you can enter the object name and related description. The object created is a folder in the VSS All Projects column.
Figure 1-4 Creating an Object Dialog
6. Add files, support folders in the VSS user interface, first enter the project (folder), select the file to be placed on the server, then drag the VSS user interface, One upload dialog box will pop up as shown in Figure 1-5, and you can enter a comment in the dialog. There are other related options, in this brief description: Store Only Latest version: Save the final version of the file. Check Out Immediately: When the file is added, it will check out. Remove Local Copy: After the file is added, the local file is deleted, and it is best not to select this when the file is added. FILE TYPE: Select the type of add file, generally select Auto-Detect (Automatic Identification), selecting the item is binary and text files. Figure 1-6 Add File Dialog
The settings of the VSS will be described so that the corresponding folders and group user accounts must be built in the VSS before preparing the development. Figure 1-7 is a structural diagram of a good VSS object already created.
Figure 1-7 VSS client use interface
Third, DW Configuration Because VSS has been defined, it is not very difficult to connect DW and VSS, the following is the detailed step 1 of configuring DW, enter the editing interface of DW, execute the site / new site ... command, open the definition site Dialog, the default is the Local Info tab, fill in the name of the development project in the interface, and the address where the project source code is located, after filling out the following Figure 1-8.
Figure 1-8 Local Info Tab
2. Select the Remote INFO (Remote Information) tab in the Site Definition Options dialog, such as Figure 1-9, select SourceSafe Database in the Access (Remote Access Type) of the interface. Automatical Upload Files To Server, automatically update the modified information to the VSS server after modifying the file in DW. Check Out File When Opening, open the file automatically check the file on the Auto Check Out server in DW.
Figure 1-9 Remote Info tab
3. Click the Settings ... button in the Remote INFO tab, open the Diagram 1-10 dialog box, and fill in the Database Path, VSS database path, respectively. Project path, pay attention to the object path must start with $ start, path support Chinese. Then fill in the username and password of the VSS user.
Figure 1-10 VSS client login setting
4. Select Testing Server (Test Server Information) tab in the Site Definition Options dialog, such as Figure 1-11, Server Model: Select the technical type used by the web project, DW supports the vast majority of web dynamic languages. Access: Access Type, FTP and Local / Network, Testing Server: Test server address. Refresh Remote File List Automatic: Automatically refreshes a list of remote files, URL Prefix: Tests the URL address accessed by the server.
Figure 1-11 TESTING SERVER
At this point, the configuration of DW and VSS has been basically configured. The configuration told above must be set, otherwise the two software cannot be friendly, and some other parameters can be set according to the specific situation. IV. In combat development, you can develop this step. Since DW and VSS have been connected, the regular operation of the VSS file does not need to be logged in to VSS to implement, and it can be easily implemented directly in DW. The following will be developed from two aspects, first introduces the development of DW and then introduce the version control and code recovery comparison in VSS. (1), in DW Applications 1, the first thing to connect to the VSS server in DW to open the DW editing window is to connect the remote server, that is, the VSS server. Execute the Site / Site Files ... command in DW or press F8 Shortcut to open Figure 1-12 Site panel, you can view the list of local files, test server file lists, and file lists on remote VSS in the Site panel. Our writing and operation of the document is mainly conducted in the Local View. Of course, you can also connect the remote server and open a file that is not used by other group members Check Out, and automatically check out the file, there are three states in the Site panel, and the file is locked. : The current file is not edited by any other member Check Out, such file DW adds a small lock in front of the file name. The file is checked by himself: that is, the file yourself is editing or already check out, DW adds a green hook in front of the file name. The file was checked by the CHECK OUT of others: the file was checked by other group members, DW plus a red hook in front of the file name. Figure 1-12 Site panel
2. Basic operations of the source code file can be done in PUT / GET, check out / in operation in Figure 1-12 Site Editing interface, Check Out and Check IN have been introduced in the previous example. PUT is uploaded to the VSS server on the local file, and the GET is downloaded down the files on the VSS server. The difference between PUT / GET and CHECK OUT / IN is whether VSS has made backups and records for the operation of the file content. Check out / in operation has corresponding records on VSS, and PUT / GET is not. In the site interface, you can drag the PUT / GET that implements the file directly with the mouse, dragging the file from the VSS server in the DW default settings, popping up as shown in Figure 1-13 (CHECK OUT / IN operation will also have this The prompt box), the meaning of this text box is whether it will put / get (check out / in) associated with the file. It is highly recommended to select NO here, and do not prompt the message check box. If you choose Yes, your operation will be very slow and there will be some unnecessary errors (DW will overwrite the files that have been modified by the old file on the old file on the VSS), DW puts the current file All files are operated, such as include files, image files, CSS files, etc., there are actually some files that often need to be modified. If one day needs to select it while operating with the file associated with him, execute the edit / preferences ... command Open the Parameter Settings dialog, select the Site tab, check 2 checkboxes in Dependent Files I.e.
Figure 1-13 Information prompt box
3, Design Notes (design notes) carefully discovered that there are several file names in Figure 1-12 have a yellow small mark, which is a function of Macromedia adds a function of Dreamweaver 3.0 when Design Notes (Design Notes) Developers can add design notes and experience on this document. These notes and experience are accumulated, and they can record the notes of each developer. These information can be found in any developer who opens the file, so that developers can be very Easy to hitch. These notes can be saved to the VSS server when DW and VSS are developed. VSS has a Comment feature for each file. This is a bit repeated for DW's Design Notes, but DW's Design Notes is powerful, or it is recommended to use DESGIN Notes, which is design Notes in DW3 and DW4. Support Chinese, but DW MX can support Chinese, this is a gospel for those who are not very good in English. To add Design Notes to a file, first select the file with the mouse in the Files panel, click on the right to pop up the shortcut menu to execute the Design Notes command, open Figure 1-13. There are 2 tabs in the interface, one is Basic INFO (basic information), the other is all INFO (all information), first select the current version of the file, then add information in the Notes text box, you can Insert the date of the current system by clicking the date button. You can view the NOTES in the All Info tab. Figure 1-14 Design Notes dialog
4. Keep synchronization with the remote server (Synchronize) synchronization is unified to the local source code and the remote server, if not uniform, use the latest overwritten local or server old files. Use the mouse to select a local source code in the Site panel, then click the mouse right to pop up the shortcut menu to execute the synchronize ... command, open Figure 1-15 dialog box, you can set with the remote server (VSS server) in this dialog Synchronously.
Figure 1-15 Design Notes Dialog
There are 2 options in the Synchornize drop-down menu: a, the entire local site and the remote server synchronize, it displays the currently defined site name B, only the files that have selected files and files on the remote device, you can hold down the keyboard CTRL keys Select multiple files and remote servers The corresponding file synchronization Direction drop-down menu: PUT NEWER FILES TO Remote: Place the latest file on the remote server. Get Newer Files from Remote: Get the latest files from the remote server. Get and Put Newer Files: Keeping the local and remote servers are the latest files. The meaning of the check box is that all files that are not local on the remote server are deleted. After setting the parameters, click the Preview button, DW automatically searches the relevant files that need to be updated according to the rule, if no synchronous file DW pops up a message box, otherwise complete the synchronization operation. (2) Related Applications in VSS Due to the regular operation of VSS files in DW, developers do not need to operate often in the VSS client, but such as the code setting version, recovery files, etc. need to be performed in VSS . VSS records a source code file from creation, modifying to the published process, records the Check IN operation of the file each time, so it is very useful in the source code check-in debugging. There will be several typical operations of VSS below. 1. Source operation login Enter the VSS client interface, use the mouse to select the source code file Click the right to buy the shortcut menu to execute the show history ... command, pop up the map 1-16 history option. This is to view the record option, where you can define the history you want to view. Figure 1-16 Historical options
Include Labels: The history of the tag specified by the user. Labels Only: Only history of the user-defined label is displayed. From: Restrict the start date of the query history, you can enter the date, date: time, version (version), or Label (label), you need to add a prefix "D" in the input date time, such as "D02 / 29/95; 12:15 ", you need to add a prefix" L "when entering the version number, such as lbeta1. If only date format does not need to add any prefix, the following format is legal, 08.15.95, 08-15-95, or 08/15/95 Format, But Not AUGUST 15, 1995, pay attention to these time formats are foreigners Habits, you need to pay attention to it when you enter. TO: Limit the end date of the query history, you can enter the date, date: time, version (version), or Label, the input rules are the same as from the FROM. User: Specifies the username. After entering a specific condition, click the "OK" button to pop up the history list, as shown in Figure 1-17 History list.
Figure 1-17 List of history
View: View source details, if it is binary, it will not be displayed normally. Details: View the details of the file, click this button to pop up a dialog box, you can view the version information of the file, the operation time, operator, and the documentation. GET: Get the source code file from the current history, is not the latest version of the code. Check Out: CHECK OUT will be the file. DIFF: Source comparison. Click this button to pop up the source comparison option dialog box, click the "OK" button to open Figure 1-18 interface. From the interface, you can clearly see the spread of the code. In the VSS, three colors are used to distinguish between code, the blue code represents the deleted row, the red code represents the modified code, and the green code represents the newly added code. Figure 1-18 Comparison of Source Codes
PIN / UNPIN: Lock / unlock the selected source code file, not allowing others to do Check Out / IN operations. After the file is locked, VSS will add an identifier before the file name. ROLLBACK: Restores the current version. The operation is irreversible, and the source code is recovered, all cleared than the record late. It is recommended not to use this feature too much, you can use the source code to get the current version by clicking the Get button, then make changes to the source code, so that the history is not clear, but also reaches the function of Rollback. Report: Contrast report. VSS outputs the result of the result to the printer, file and clipboard. 2. Recovery Delete Record VSS can recover the deleted file and object, if the user selects Destroy Permanently (permanently deleted) when the file is deleted, then the operation is unrecoverable. Only the user's permissions contain DESTROY to be completely deleted, and of course only users with DESTROY privileges can restore the deleted files. Select an object in the All Projects window of the VSS client interface (that is, the folder), then click the right to pop up the shortcut menu to execute the Properties ... command, open the object's property panel Select the deleted items option The card is shown in Figure 1-19. Use the mouse to select the file that you want to manipulate, you can press the keyboard Ctrl key to select multiple files, then click Recover or Purge button.
Figure 1-19 Restore the deleted file
3. Version Control When the WEB project is completed, it is necessary to seal a version of the source code, which is conducive to the project release and upgrade, select an object with the mouse in the All Projects window of the VSS client interface (that is, the folder) , Then click on the right to buy the shortcut menu to execute the label ... command, open the settings window as shown in Figure 1-20
Figure 1-20 Version Settings
You can enter the version number in the Label and then click the OK button. You can enter the description in the Comment. When a version is sealed, all the source code below seals a version, as shown in Figure 1-17, can see the Action of historical records is "label 1". Finally, I can take a paragraph ^ _ ^, now go back to see those text written, most of them are not more in-depth discussions. DW and VSS joint development is a model I like very much, this model is suitable for small and medium-sized project development. I want to write so much today, but I still can't introduce DW and VSS, I am interested in practice, if you encounter difficulties in the process of implementation, I am very willing to discuss with you, please come to Cool Page
Contact me.