Platform SDK: Team Productivity Update |
After the Team Productivity Update calls the Configure URL and the Deploy URL, it calls the DropConfigure URL. These three .asp files are called from the Publish URL in order. The DropConfigure URL removes the temporary configuration file created by the Configure URL.
The script starts by getting the URL source path. To get this path the Request object is used. The Request object retrieves the values that the client browser passed to the server during an HTTP request. The ServerVariables collection is then retrieved and the Split function is used to determine the URL. Also, this script assumes that it is running in the source directory.
' Get the source path (Assumes this script is running in the source directory) URL = Request.ServerVariables("URL") ' "/expense/urlDropConfigure.asp" URLParts = Split(URL,"/") SourcePath = Server.MapPath("/" & URLParts(1)) ' Current physical directory
Next, the instance number of the Expense Report application is determined. To get the instance number, the values contained in the ConfigSessionID element within the Form collection must be retrieved. To do this, the text file containing the instance number must be located and read.
' Get the instance number (using the GUIDSessionID name) GUIDSessionID = Request.Form("ConfigSessionID") GUIDSessionID = Replace(Replace(GUIDSessionID,"{",""),"}","") Set oFileSystem = Server.CreateObject("Scripting.FileSystemObject") GUIDSessionIDPathFilename = oFileSystem.BuildPath(SourcePath, GUIDSessionID & ".txt") Set oFile = oFileSystem.OpenTextFile(GUIDSessionIDPathFilename, 1, False) ' For Read InstanceNumber = oFile.ReadAll
Once the instance number has been read, the file can be closed.
oFile.Close
At this point, the temporary configuration file that was previously saved can be deleted.
' Delete the temporary User configuration file (saved from 'urlConfigure.asp') ExpenseReportConfigFilename = URLParts(1) & "#_Config.txt" ExpenseReportConfigPathFilename = SourcePath & "\" & Replace(ExpenseReportConfigFilename,"#", InstanceNumber) Call oFileSystem.DeleteFile(ExpenseReportConfigPathFilename, True)' Not found
Here the File System object is cleared from memory. Then, the resultCode and resultDescription are set to recognize the successful removal of the application configuration.
Set oFileSystem = Nothing ResultCode = 0 ResultDescription = "Configuration file was deleted successfully."
Last, the XML stream is returned.
<?xml version='1.0'?> <TeamAppFactory> <Result> <Code><%= ResultCode%></Code> <Description><%= ResultDescription%></Description> </Result> </TeamAppFactory>