|
From: creedon <icr...@us...> - 2006-02-02 07:45:00
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/prefs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8221 Modified Files: updateNowButton Log Message: commented out Manila update tweaked script formatting lowercase method check, towards XHTML compliance Index: updateNowButton =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/prefs/updateNowButton,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** updateNowButton 26 Mar 2005 21:45:16 -0000 1.1.1.1 --- updateNowButton 2 Feb 2006 07:44:53 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:mainResponder.adminSite.prefs.updateNowButton ! on updateNowButton (flInTable=true) { ÇChanges Ç12/16/03; 3:41:23 AM by JES ÇIf the user updates their databases without error, clear the pending updates table so we don't show them stuff they've already seen. Ç6/26/02; 11:07:31 PM by JES ÇCreated. local (pta = html.getPageTableAddress ()); local (htmltext = ""); on add (s) { htmltext = htmltext + s;}; local (confirmText = "", totalNewParts = 0, flError = false); if pta^.method == "POST" { if defined (pta^.postArgs.updateNow) { //catch the submit button on addToConfirmText (ctNewParts, databaseName) { confirmText = confirmText + ctNewParts + " new part"; if ctNewParts != 1 { confirmText = confirmText + "s"}; confirmText = confirmText + " added to " + databaseName + ".root.<br />"}; on addErrorToConfirmText (databaseName) { confirmText = confirmText + "<b>Couldn't update " + databaseName + ".root because the server didn't respond within 2 minutes.</b><br />"}; on updateOneRoot (nameInRoot, adrCtNewParts) { local (scriptText); scriptText = "local (params = {@" + nameInRoot + ", true, @system.temp.Frontier.ctNewParts});\r"; scriptText = scriptText + "thread.callScript (@rootUpdates.update, params)"; local (adr = @system.temp.Frontier.doThreadedUpdate); new (scriptType, adr); local (oldtarget = target.set (adr)); op.setLineText (scriptText); try {target.set (oldtarget)}; script.getcode (adr, adr); //use script.getcode to avoid dialogs asking if you want to compile before closing adr^ (); local (now = clock.now (), flTimeout = false); while not defined (system.temp.Frontier.ctNewParts) { //loop until the update is complete, or we time out thread.sleepTicks (6); //0.1 seconds if clock.now () - now > 120 { //2 minute timeout flTimeout = true; break}}; if not flTimeout { //udpate completed -- set confirmation message, delete temporary objects adrCtNewParts^ = system.temp.Frontier.ctNewParts; delete (@system.temp.Frontier.ctNewParts)}; return (not flTimeout)}; local (ctNewParts); if updateOneRoot ("root", @ctNewParts) { addToConfirmText (ctNewParts, "Frontier"); totalNewParts = totalNewParts + ctNewParts} else { addErrorToConfirmText ("Frontier"); flError = true}; if updateOneRoot ("mainResponder", @ctNewParts) { addToConfirmText (ctNewParts, "mainResponder"); totalNewParts = totalNewParts + ctNewParts} else { addErrorToConfirmText ("mainResponder"); flError = true}; if updateOneRoot ("manilaSuite", @ctNewParts) { addToConfirmText (ctNewParts, "manila"); totalNewParts = totalNewParts + ctNewParts} else { addErrorToConfirmText ("manila"); flError = true}; if updateOneRoot ("prefsSuite", @ctNewParts) { addToConfirmText (ctNewParts, "prefs"); totalNewParts = totalNewParts + ctNewParts} else { addErrorToConfirmText ("prefs"); flError = true}; msg (""); if not flError { //empty out the pending updates table try {new (tableType, @config.mainResponder.stats.pendingUpdates)}}}}; add ("<input type=\"submit\" name=\"updateNow\" value=\"Update Now\" />"); if confirmText != "" { //render the confirm text if totalNewParts > 0 or flError { add ("<p><b>Thanks for updating. " + totalNewParts + " new or changed parts were installed. "); if flError { add ("At least one error occurred.")}; add ("The number of new parts installed in each database is listed below:</b></p>"); add (confirmText)} else { add ("<p><b>There are no new features or fixes at this time. Your copy of Frontier is up to date.</b></p>")}}; if flInTable { return ("<tr><td colspan=\"2\">" + htmltext + "</td></tr>")} else { return (htmltext)}} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:mainResponder.adminSite.prefs.updateNowButton ! on updateNowButton (flInTable=true) { ÇChanges Ç2/1/06; 12:40:03 PM by TAC Çcommented out Manila update Çtweaked script formatting Çlowercase method check, towards XHTML compliance Ç12/16/03; 3:41:23 AM by JES ÇIf the user updates their databases without error, clear the pending updates table so we don't show them stuff they've already seen. Ç6/26/02; 11:07:31 PM by JES ÇCreated. local (pta = html.getPageTableAddress ()); local (htmlText = ""); on add (s) { htmlText = htmlText + s;}; local (confirmText = "", totalNewParts = 0, flError = false); if string.lower (pta^.method) == "post" { if defined (pta^.postArgs.updateNow) { //catch the submit button on addToConfirmText (ctNewParts, databaseName) { confirmText = confirmText + ctNewParts + " new part"; if ctNewParts != 1 { confirmText = confirmText + "s"}; confirmText = confirmText + " added to " + databaseName + ".root.<br />"}; on addErrorToConfirmText (databaseName) { confirmText = confirmText + "<b>Couldn't update " + databaseName + ".root because the server didn't respond within 2 minutes.</b><br />"}; on updateOneRoot (nameInRoot, adrCtNewParts) { local (scriptText); scriptText = "local (params = {@" + nameInRoot + ", true, @system.temp.Frontier.ctNewParts});\r"; scriptText = scriptText + "thread.callScript (@rootUpdates.update, params)"; local (adr = @system.temp.Frontier.doThreadedUpdate); new (scriptType, adr); local (oldtarget = target.set (adr)); op.setLineText (scriptText); try {target.set (oldtarget)}; script.getcode (adr, adr); //use script.getcode to avoid dialogs asking if you want to compile before closing adr^ (); local (now = clock.now (), flTimeout = false); while not defined (system.temp.Frontier.ctNewParts) { //loop until the update is complete, or we time out thread.sleepTicks (6); //0.1 seconds if clock.now () - now > 120 { //2 minute timeout flTimeout = true; break}}; if not flTimeout { //udpate completed -- set confirmation message, delete temporary objects adrCtNewParts^ = system.temp.Frontier.ctNewParts; delete (@system.temp.Frontier.ctNewParts)}; return (not flTimeout)}; local (ctNewParts); if updateOneRoot ("root", @ctNewParts) { addToConfirmText (ctNewParts, "Frontier"); totalNewParts = totalNewParts + ctNewParts} else { addErrorToConfirmText ("Frontier"); flError = true}; if updateOneRoot ("mainResponder", @ctNewParts) { addToConfirmText (ctNewParts, "mainResponder"); totalNewParts = totalNewParts + ctNewParts} else { addErrorToConfirmText ("mainResponder"); flError = true}; Çif updateOneRoot ("manilaSuite", @ctNewParts) ÇaddToConfirmText (ctNewParts, "manila") ÇtotalNewParts = totalNewParts + ctNewParts Çelse ÇaddErrorToConfirmText ("manila") ÇflError = true Ç if updateOneRoot ("prefsSuite", @ctNewParts) { addToConfirmText (ctNewParts, "prefs"); totalNewParts = totalNewParts + ctNewParts} else { addErrorToConfirmText ("prefs"); flError = true}; msg (""); if not flError { //empty out the pending updates table try {new (tableType, @config.mainResponder.stats.pendingUpdates)}}}}; add ("<input type=\"submit\" name=\"updateNow\" value=\"Update Now\" />"); if confirmText != "" { //render the confirm text if totalNewParts > 0 or flError { add ("<p><b>Thanks for updating. " + totalNewParts + " new or changed parts were installed. "); if flError { add ("At least one error occurred.")}; add ("The number of new parts installed in each database is listed below:</b></p>"); add (confirmText)} else { add ("<p><b>There are no new features or fixes at this time. Your copy of Frontier is up to date.</b></p>")}}; if flInTable { return ("<tr><td colspan=\"2\">" + htmlText + "</td></tr>")} else { return (htmlText)}} \ No newline at end of file |