%@ LANGUAGE="JSCRIPT" %>
No permission to upload
"); } else { if(Request.ServerVariables("request_method").toLowerCase() != "post") { %> <% } else { // // POST: Import the RTML. The If nesting is because the stuff at the // endhas to run to make the iframe work inside the TiddlyWiki. // if(Request.Form("FileName")) { // No file uploaded... var DB = Session("SDB"); if(DB == undefined) { var DBR = new ActiveXObject("ACP.DBRelay"); DB = DBR.GetDB(Session); DBR = null; } var RT = new ActiveXObject("DC3.RTML23.Importer"); RT.DB = DB; try { // 1. Get the RTML into a buffer for modification var FSO = new ActiveXObject("Scripting.FileSystemObject"); var rtmlFile = FSO.OpenTextFile(Request.Form("FilePath")); var rtmlBuf = rtmlFile.ReadAll(); rtmlFile.Close(); // 2. Delete the tempfile provided by the webserver FSO.DeleteFile(Request.Form("FilePath")); // 3. Using XPath, modify all Request.UserName elements to have // the ACP logged in user's friendly name. var xmlDoc = new ActiveXObject("Msxml2.DOMDocument"); xmlDoc.preserveWhiteSpace = true; xmlDoc.loadXML(rtmlBuf); var nodes = xmlDoc.selectNodes("/RTML/Request/UserName"); var eN = new Enumerator(nodes); for (; !eN.atEnd(); eN.moveNext()) { var N = eN.item(); N.text = User.Name; } // 4. Put back the encoding part of the xml introducer. Why is this needed??? rtmlBuf = xmlDoc.xml; rtmlBuf = rtmlBuf.replace("", ""); // 5. Import the fixed-up RTML to the Schedule Database RT.ImportString(rtmlBuf); Response.Write("RTML uploaded successfully for " + User.Name + " (" + User.Username + ").
\r\n"); // 6. Loop through RT.Projects and patch the Contact.Name with [ACP xxxx] and // output some useful info. RT.Projects and RT.Plans come from the importer // and are the Database objects for the affected Projects and Plans. // var submit = ((Request.Form("autoSubmit") == undefined) ? false : true); var eR = new Enumerator(RT.Projects); // Projects affected by this RTML upload for (; !eR.atEnd(); eR.moveNext()) { var R = eR.item(); Response.Write("Project: " + R.Name + ":The newly added Plans are already eligible to run.
\r\n"); else Response.Write("\r\nEnable the Plans with the " + "Schedule Browser when you want it to become eligible to run.
\r\n"); Response.Write("Upload another."); } catch(ex) { Response.Write("RTML failed: " + (ex.message ? ex.message : ex) + "
"); } finally { RT = null; } } else { Response.Write("