Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Additional Considerations

October 9, 2000

You may be wondering, "Great, so how do I get the files into the database in the first place?" Well, you can add them in one by one, manually, but we know you don't want to do that. One easy way would be to build a simple recursive FileSystemObject script that starts at a specified directory, and inputs all files under it. For example:

<%
Dim fso

Set fso = CreateObject("Scripting.FileSystemObject")
call AddFiles(fso.GetFolder("c:\inetpub\wwwroot\blah"))

Function AddFiles(Folder)
  For Each File In Folder.Files
    'insert files into database here
  Next

  For Each Subfolder In Folder.SubFolders
    call AddFiles(Subfolder)
  Next

End Function
%>

This would be a nice and easy way to get all your documents in the right places in one batch update. You could then build a simple interface to add individual files later on.

Another topic we haven't covered here is version control. Version control is a feature of many commercial source control systems today - essentially, it allows you to revert to, and compare between, previous versions of a file. To accomplish this, immediately before a user checks a file in, you would have to save a copy of the original file in a different location. Each time the user checks a file in, you save a new copy. This archive can get quite large quickly, so backups or archiving may be in order. You will also need to store the version information in a database, so users can easily keep track of them, as well as develop a naming scheme so that the copies' filenames will always be unique.

It may also be helpful to ensure that each user has a unique username in the database. If two different users are using the same account, then they may run the chance that one person could check the other person's files in and out. With the system we designed, it isn't much of a problem, because the users will always have a local copy of the file as well, so no changed will get lost, theoretically. Still, it is a good safety mechanism.

The system described so far does not allow users to view files that are currently checked out. An easy remedy to this would be to add links to the PrintTree function we outlined a few pages ago. You could hyperlink the file names, which would take you to a download form like the one on the previous page. The only difference would be that this download form doesn't do anything with the file attributes - the copy the user downloads would be read-only, and they would not check the file out. Thus, anyone can view the files at any time - this is helpful if you needed a second pair of eyes to help you figure out a nasty problem, or just to check up on someone. For example:

if strComp(rst(2), strUser) = 0 then
  Response.write("|-<input type=""checkbox"" name=""file"" " & _
      "value=" & rs(1) & " CHECKED><b><a href=""downloadform.asp?id=" & _
      rs(1) & """>" & rst(0) & "</a></b><br>")
elseif rst(2) <> "" then
  Response.write("|-<input type=""checkbox"" name=""file"" " & _
      "value=" & rs(1) & " CHECKED DISABLED><a href=""downloadform.asp?id=" & _
      rs(1) & """>" & rst(0) & "</a><br>")
else
  Response.write("|-<input type=""checkbox"" name=""file"" " & _
      "value=" & rs(1) & " ><a href=""downloadform.asp?id=" & _
      rs(1) & """>" & rst(0) & "</a><br>")
end if

Finally, it is important to realize the benefit of this application as a web based system. For one thing, users can check out and edit documents wherever they are. This paradigm also overcomes a lot of the problems traditional source control applications endure, such as developers who are in different geographic locations and cannot work on the same network. We won't even mention the difficulties in setting up and configuring traditional applications (okay, so maybe we'll just mention it).

Getting Files
Effective Source Control
Conclusion


Up to => Home / Authoring / ASP / SourceControl




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers