[mapguide-commits] r7940 - in sandbox/jng/fusion_robust_error_handling_templates: aqua limegold maroon slate turquoiseyellow
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Nov 28 05:44:20 PST 2013
Author: jng
Date: 2013-11-28 05:44:20 -0800 (Thu, 28 Nov 2013)
New Revision: 7940
Modified:
sandbox/jng/fusion_robust_error_handling_templates/aqua/index.html
sandbox/jng/fusion_robust_error_handling_templates/limegold/index.html
sandbox/jng/fusion_robust_error_handling_templates/maroon/index.html
sandbox/jng/fusion_robust_error_handling_templates/slate/index.html
sandbox/jng/fusion_robust_error_handling_templates/turquoiseyellow/index.html
Log:
Fusion ticket 576: Update the 5 templates to gracefully handle session expiry. When session expiry happens, display a message bar notification instead of the standard error dialog. If there is no Session query parameter, also include a link to reload the application (thus creating a new valid session in the process)
Modified: sandbox/jng/fusion_robust_error_handling_templates/aqua/index.html
===================================================================
--- sandbox/jng/fusion_robust_error_handling_templates/aqua/index.html 2013-11-28 12:58:22 UTC (rev 7939)
+++ sandbox/jng/fusion_robust_error_handling_templates/aqua/index.html 2013-11-28 13:44:20 UTC (rev 7940)
@@ -119,6 +119,22 @@
var fusionError = function(eventId, error) {
if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
var fmtStack = "";
for (var i = 0; i < error.stack.length; i++) {
var stackFrame = error.stack[i];
Modified: sandbox/jng/fusion_robust_error_handling_templates/limegold/index.html
===================================================================
--- sandbox/jng/fusion_robust_error_handling_templates/limegold/index.html 2013-11-28 12:58:22 UTC (rev 7939)
+++ sandbox/jng/fusion_robust_error_handling_templates/limegold/index.html 2013-11-28 13:44:20 UTC (rev 7940)
@@ -110,6 +110,22 @@
var fusionError = function(eventId, error) {
if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
var fmtStack = "";
for (var i = 0; i < error.stack.length; i++) {
var stackFrame = error.stack[i];
Modified: sandbox/jng/fusion_robust_error_handling_templates/maroon/index.html
===================================================================
--- sandbox/jng/fusion_robust_error_handling_templates/maroon/index.html 2013-11-28 12:58:22 UTC (rev 7939)
+++ sandbox/jng/fusion_robust_error_handling_templates/maroon/index.html 2013-11-28 13:44:20 UTC (rev 7940)
@@ -131,6 +131,22 @@
var fusionError = function(eventId, error) {
if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
var fmtStack = "";
for (var i = 0; i < error.stack.length; i++) {
var stackFrame = error.stack[i];
Modified: sandbox/jng/fusion_robust_error_handling_templates/slate/index.html
===================================================================
--- sandbox/jng/fusion_robust_error_handling_templates/slate/index.html 2013-11-28 12:58:22 UTC (rev 7939)
+++ sandbox/jng/fusion_robust_error_handling_templates/slate/index.html 2013-11-28 13:44:20 UTC (rev 7940)
@@ -114,6 +114,22 @@
var fusionError = function(eventId, error) {
if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
var fmtStack = "";
for (var i = 0; i < error.stack.length; i++) {
var stackFrame = error.stack[i];
Modified: sandbox/jng/fusion_robust_error_handling_templates/turquoiseyellow/index.html
===================================================================
--- sandbox/jng/fusion_robust_error_handling_templates/turquoiseyellow/index.html 2013-11-28 12:58:22 UTC (rev 7939)
+++ sandbox/jng/fusion_robust_error_handling_templates/turquoiseyellow/index.html 2013-11-28 13:44:20 UTC (rev 7940)
@@ -95,6 +95,22 @@
var fusionError = function(eventId, error) {
if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
var fmtStack = "";
for (var i = 0; i < error.stack.length; i++) {
var stackFrame = error.stack[i];
More information about the mapguide-commits
mailing list