Platform SDK: Team Productivity Update

Copying Files into the Physical Directory

The Instantiation URL for the document review application names paths for the physical directory, virtual directory, and database as the last step in Creating the Document Review Application Physical Directory. Next, it creates the directory for the instance of the application requested by the Team Workspace and copies the application's files into it.

The code begins by passing the WebPath variable that holds the application's Web physical directory name to the FileSystemObject object. This creates the directory for the document review application instance for the Team Workspace that requested it.

' Create instance directory (and its sub-directories) and copy files over
Set oFolder = oFileSystem.CreateFolder(WebPath) ' Root 

After the script has created the root folder, it calls the CopyFile method of the FileSystemObject object (part of the ASP File Access component). The script passes in the paths and file names for the files that will be copied into the root directory of the application's Web directory.

Call oFileSystem.CopyFile(SourcePath & "\default.htm", WebPath & "\") 
Call oFileSystem.CopyFile(SourcePath & "\global.asa", WebPath & "\")  
Call oFileSystem.CopyFile(SourcePath & "\global.asp", WebPath & "\") 
Call oFileSystem.CopyFile(SourcePath & "\logon.asp", WebPath & "\") 

Next, the script names and creates subfolders for the various files needed for the application and its database.

The following code creates the Admin subfolder and copies its contents from the source directory to the Team Workspace:

SubFolderPath = oFileSystem.BuildPath(WebPath, "\Admin")  ' Admin
Set oFolder = oFileSystem.CreateFolder(SubFolderPath)
Call oFileSystem.CopyFile(SourcePath & "\Admin\*.asp", SubFolderPath & "\") 

The following code creates the Common subfolder and copies its contents from the source directory to the Team Workspace:

SubFolderPath = oFileSystem.BuildPath(WebPath, "\Common")  ' Common
Set oFolder = oFileSystem.CreateFolder(SubFolderPath)
Call oFileSystem.CopyFile(SourcePath & "\Common\*.asp", SubFolderPath & "\") 
Call oFileSystem.CopyFile(SourcePath & "\Common\*.htm", SubFolderPath & "\") 

The following code creates the Help subfolder in the Common subfolder and copies its contents from the source directory to the Team Workspace:

SubFolderPath = oFileSystem.BuildPath(WebPath, "\Common\Help")  ' Common\Help
Set oFolder = oFileSystem.CreateFolder(SubFolderPath)
Call oFileSystem.CopyFile(SourcePath & "\Common\Help\*.htm", SubFolderPath & "\") 
Call oFileSystem.CopyFile(SourcePath & "\Common\Help\*.gif", SubFolderPath & "\") 

The following code creates the Reports subfolder and copies its contents from the source directory to the Team Workspace:

SubFolderPath = oFileSystem.BuildPath(WebPath, "\Reports")   ' Reports
Set oFolder = oFileSystem.CreateFolder(SubFolderPath)
Call oFileSystem.CopyFile(SourcePath & "\Reports\*.asp", SubFolderPath & "\") 
Call oFileSystem.CopyFile(SourcePath & "\Reports\*.gif", SubFolderPath & "\") 
Call oFileSystem.CopyFile(SourcePath & "\Reports\*.inc", SubFolderPath & "\") 

The following code creates the Scripts subfolder and copies its contents from the source directory to the Team Workspace:

SubFolderPath = oFileSystem.BuildPath(WebPath, "\Scripts")   ' Scripts
Set oFolder = oFileSystem.CreateFolder(SubFolderPath)
Call oFileSystem.CopyFile(SourcePath & "\Scripts\*.htm", SubFolderPath & "\") 
Call oFileSystem.CopyFile(SourcePath & "\Scripts\*.vbs", SubFolderPath & "\") 

The following code creates the Support subfolder and copies its contents from the source directory to the Team Workspace. It also creates the folder that will hold the SQL Server database the application uses. Finally, after creating all the physical directories and files at the designated location, the oFolder object is set to Nothing, and the memory is freed.

SubFolderPath = oFileSystem.BuildPath(WebPath, "\Support")   ' Support
Set oFolder = oFileSystem.CreateFolder(SubFolderPath)
Call oFileSystem.CopyFile(SourcePath & "\Support\*.cab", SubFolderPath & "\") 
Set oFolder = oFileSystem.CreateFolder(DataPath)  ' Database
Set oFolder = Nothing

To follow the next steps in the script's execution, see Updating the Global.asa File.