From: Argiris K. <be...@us...> - 2005-11-18 10:29:13
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/Core Modified Files: AjaxCallHelper.cs MagicAjaxModule.cs Util.cs Web.config Log Message: Added 'unloadStoredPage' configuration option that defines whether the stored page will be dropped at the client's page unload event. Moved GetBase64MD5Sum method to Util.cs Index: Web.config =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Web.config,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Web.config 14 Nov 2005 18:50:43 -0000 1.2 --- Web.config 18 Nov 2005 10:29:03 -0000 1.3 *************** *** 11,21 **** If omitted, the embedded "AjaxCallObject.js" file is used (default). example: <magicAjax ajaxCallScriptPath="~/script" /> ! pageStore/mode - "NoStore" : Doesn't keep the page object, it is recreated for each AjaxCall "Session" : Saves the page object in session, works only for "InProc" SessionState "Cache" : Saves the page object in cache Default is "NoStore" pageStore/cacheTimeout - The time in minutes that the page will be kept in cache, if "Cache" is selected for pageStore. Default is 5 ! pageStore/maxConcurrentPages - if the page is stored (mode is not "NoStore") it defines the maximum number of page objects that can refer to the same page. Default is 5. pageStore/maxPagesLimitAlert - if it's true, an alert box is displayed when the maxConcurrentPages --- 11,26 ---- If omitted, the embedded "AjaxCallObject.js" file is used (default). example: <magicAjax ajaxCallScriptPath="~/script" /> ! pageStore/mode - "NoStore" : Doesn't store the page object, it is recreated for each AjaxCall "Session" : Saves the page object in session, works only for "InProc" SessionState "Cache" : Saves the page object in cache Default is "NoStore" + pageStore/unloadStoredPage - "false" : if the page is stored (mode is "Session" or "Cache") + the page object is kept until session or cache expires + "true : An AjaxCall is invoked at the unload event of the + client's page for the server to drop the stored page object. + Default is "false" pageStore/cacheTimeout - The time in minutes that the page will be kept in cache, if "Cache" is selected for pageStore. Default is 5 ! pageStore/maxConcurrentPages - if the page is stored (mode is "Session" or "Cache") it defines the maximum number of page objects that can refer to the same page. Default is 5. pageStore/maxPagesLimitAlert - if it's true, an alert box is displayed when the maxConcurrentPages *************** *** 24,27 **** --- 29,33 ---- <pageStore mode="NoStore" + unloadStoredPage="false" cacheTimeout="5" maxConcurrentPages="5" Index: AjaxCallHelper.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AjaxCallHelper.cs 17 Nov 2005 15:03:16 -0000 1.4 --- AjaxCallHelper.cs 18 Nov 2005 10:29:03 -0000 1.5 *************** *** 25,29 **** using System.Web.UI; using System.Collections; - using System.Security.Cryptography; using System.Text; --- 25,28 ---- *************** *** 299,315 **** return url; } - - /// <summary> - /// Create a base64 encoded MD5 sum string of an input string - /// </summary> - /// <param name="str"></param> - /// <returns></returns> - static public string GetBase64MD5Sum(string input) - { - byte[] inputBytes = UnicodeEncoding.Default.GetBytes(input); - byte[] hashedBytes = new MD5CryptoServiceProvider().ComputeHash(inputBytes); - return Convert.ToBase64String(hashedBytes); - } - #endregion --- 298,301 ---- Index: Util.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Util.cs 17 Nov 2005 20:15:38 -0000 1.2 --- Util.cs 18 Nov 2005 10:29:03 -0000 1.3 *************** *** 2,5 **** --- 2,7 ---- using System.Collections; using System.Web.UI; + using System.Security.Cryptography; + using System.Text; namespace MagicAjax *************** *** 11,14 **** --- 13,28 ---- { /// <summary> + /// Create a base64 encoded MD5 sum string of an input string + /// </summary> + /// <param name="str"></param> + /// <returns></returns> + static public string GetBase64MD5Sum(string input) + { + byte[] inputBytes = UnicodeEncoding.Default.GetBytes(input); + byte[] hashedBytes = new MD5CryptoServiceProvider().ComputeHash(inputBytes); + return Convert.ToBase64String(hashedBytes); + } + + /// <summary> /// Call a private method from the given object. /// </summary> Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MagicAjaxModule.cs 17 Nov 2005 18:10:01 -0000 1.11 --- MagicAjaxModule.cs 18 Nov 2005 10:29:03 -0000 1.12 *************** *** 150,154 **** alert(""Unable to find script library '{0}/{1}'. Copy the file to the required location, or change the 'ajaxCallScriptPath' setting at magicAjax section of web.config.""); else ! AJAXCbo.HookAjaxCall({2}); </script>"; --- 150,154 ---- alert(""Unable to find script library '{0}/{1}'. Copy the file to the required location, or change the 'ajaxCallScriptPath' setting at magicAjax section of web.config.""); else ! AJAXCbo.HookAjaxCall({2},{3}); </script>"; *************** *** 181,185 **** bool pageIsStored = (_config.PageStore.Mode != PageStoreMode.NoStore); ! page.RegisterStartupScript( "AJAXCALL_HOOK", String.Format(STARTUP_SCRIPT_FORMAT, location, "AjaxCallObject.js", pageIsStored.ToString().ToLower())); if ( pageIsStored ) --- 181,186 ---- bool pageIsStored = (_config.PageStore.Mode != PageStoreMode.NoStore); ! bool unloadStoredPage = _config.PageStore.UnloadStoredPage; ! page.RegisterStartupScript( "AJAXCALL_HOOK", String.Format(STARTUP_SCRIPT_FORMAT, location, "AjaxCallObject.js", pageIsStored.ToString().ToLower(), unloadStoredPage.ToString().ToLower())); if ( pageIsStored ) *************** *** 535,542 **** if (_currentPageInfo == null) { ! // Stored Page wasn't found, could be that the session expired. ! // Have the browser do a refresh. ! // It will stop the current execution and will throw Application_EndRequest event ! AjaxCallHelper.Redirect (_request.RawUrl); } --- 536,550 ---- if (_currentPageInfo == null) { ! if ( _isAjaxCall ) ! { ! // Stored Page wasn't found, could be that the session expired. ! // Have the browser do a refresh. ! // It will stop the current execution and will throw Application_EndRequest event ! AjaxCallHelper.Redirect (_request.RawUrl); ! } ! else ! { ! return; ! } } |