diff --git a/source/java/org/alfresco/web/app/AlfrescoNavigationHandler.java b/source/java/org/alfresco/web/app/AlfrescoNavigationHandler.java index f803809b10..0d2b3c6db5 100644 --- a/source/java/org/alfresco/web/app/AlfrescoNavigationHandler.java +++ b/source/java/org/alfresco/web/app/AlfrescoNavigationHandler.java @@ -60,7 +60,7 @@ public class AlfrescoNavigationHandler extends NavigationHandler public final static String WIZARD_PREFIX = "wizard" + OUTCOME_SEPARATOR; public final static String CLOSE_DIALOG_OUTCOME = DIALOG_PREFIX + "close"; public final static String CLOSE_WIZARD_OUTCOME = WIZARD_PREFIX + "close"; - public final static String EXTERNAL_CONTAINER_REQUEST = "externalContainerRequest"; + public final static String EXTERNAL_CONTAINER_SESSION = "externalDialogContainer"; protected String dialogContainer = null; protected String wizardContainer = null; @@ -371,8 +371,8 @@ public class AlfrescoNavigationHandler extends NavigationHandler String container; // determine which kind of container we need to return, if the - // external request flag is set then use the plain container - Object obj = context.getExternalContext().getRequestMap().get(EXTERNAL_CONTAINER_REQUEST); + // external session flag is set then use the plain container + Object obj = context.getExternalContext().getSessionMap().get(EXTERNAL_CONTAINER_SESSION); if (obj != null && obj instanceof Boolean && ((Boolean)obj).booleanValue()) { @@ -422,8 +422,8 @@ public class AlfrescoNavigationHandler extends NavigationHandler String container; // determine which kind of container we need to return, if the - // external request flag is set then use the plain container - Object obj = context.getExternalContext().getRequestMap().get(EXTERNAL_CONTAINER_REQUEST); + // external session flag is set then use the plain container + Object obj = context.getExternalContext().getSessionMap().get(EXTERNAL_CONTAINER_SESSION); if (obj != null && obj instanceof Boolean && ((Boolean)obj).booleanValue()) { diff --git a/source/java/org/alfresco/web/app/servlet/ExternalAccessServlet.java b/source/java/org/alfresco/web/app/servlet/ExternalAccessServlet.java index 7f60d45f54..d0ba822180 100644 --- a/source/java/org/alfresco/web/app/servlet/ExternalAccessServlet.java +++ b/source/java/org/alfresco/web/app/servlet/ExternalAccessServlet.java @@ -265,9 +265,9 @@ public class ExternalAccessServlet extends BaseServlet navigator.setCurrentNodeId(args[1]); } - // set the external container request flag so that a plain container gets used - fc.getExternalContext().getRequestMap().put( - AlfrescoNavigationHandler.EXTERNAL_CONTAINER_REQUEST, Boolean.TRUE); + // set the external container session flag so that a plain container gets used + fc.getExternalContext().getSessionMap().put( + AlfrescoNavigationHandler.EXTERNAL_CONTAINER_SESSION, Boolean.TRUE); NavigationHandler navigationHandler = fc.getApplication().getNavigationHandler(); navigationHandler.handleNavigation(fc, null, outcome + ':' + args[0]); diff --git a/source/java/org/alfresco/web/app/servlet/command/UIActionCommandProcessor.java b/source/java/org/alfresco/web/app/servlet/command/UIActionCommandProcessor.java index d0947c9b54..5221175645 100644 --- a/source/java/org/alfresco/web/app/servlet/command/UIActionCommandProcessor.java +++ b/source/java/org/alfresco/web/app/servlet/command/UIActionCommandProcessor.java @@ -99,12 +99,12 @@ public class UIActionCommandProcessor implements ExtCommandProcessor properties.put(BaseUIActionCommand.PROP_RESPONSE, response); // if the container parameter is present and equal to "plain" add the - // external container object to the request + // external container object to the session String container = request.getParameter(PARAM_CONTAINER); if (container != null && container.equalsIgnoreCase("plain")) { - request.setAttribute( - AlfrescoNavigationHandler.EXTERNAL_CONTAINER_REQUEST, Boolean.TRUE); + request.getSession().setAttribute( + AlfrescoNavigationHandler.EXTERNAL_CONTAINER_SESSION, Boolean.TRUE); } Command cmd = CommandFactory.getInstance().createCommand(command); diff --git a/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java b/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java index 66c2007577..cb7204d2ef 100644 --- a/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java +++ b/source/java/org/alfresco/web/bean/dialog/BaseDialogBean.java @@ -90,6 +90,10 @@ public abstract class BaseDialogBean implements IDialogBean public String cancel() { + // remove container variable + FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove( + AlfrescoNavigationHandler.EXTERNAL_CONTAINER_SESSION); + return getDefaultCancelOutcome(); } @@ -122,6 +126,10 @@ public abstract class BaseDialogBean implements IDialogBean // allow any subclasses to perform post commit processing // i.e. resetting state or setting status messages outcome = doPostCommitProcessing(context, outcome); + + // remove container variable + context.getExternalContext().getSessionMap().remove( + AlfrescoNavigationHandler.EXTERNAL_CONTAINER_SESSION); } catch (Throwable e) { diff --git a/source/java/org/alfresco/web/bean/wcm/EditXmlInlineDialog.java b/source/java/org/alfresco/web/bean/wcm/EditXmlInlineDialog.java index 155e2c954d..7be02d7f95 100644 --- a/source/java/org/alfresco/web/bean/wcm/EditXmlInlineDialog.java +++ b/source/java/org/alfresco/web/bean/wcm/EditXmlInlineDialog.java @@ -168,6 +168,8 @@ public class EditXmlInlineDialog extends BaseDialogBean @Override public String cancel() { + super.cancel(); + // reset the state this.avmEditBean.resetState(); diff --git a/source/web/scripts/ajax/myspaces.js b/source/web/scripts/ajax/myspaces.js index 897c858086..da627bbe39 100644 --- a/source/web/scripts/ajax/myspaces.js +++ b/source/web/scripts/ajax/myspaces.js @@ -18,10 +18,12 @@ var MySpaces = { { if ($('spacePanel')) { - $('spacePanelOverlay').setStyle('opacity', 0); + MySpaces.removeModal(); + // show AJAX loading overlay $('spacePanelOverlayAjax').setStyle('visibility', 'visible'); $('spacePanel').setStyle('visibility', 'hidden'); + // fire off the ajax request to populate the spaces list - the 'myspacespanel' webscript // is responsible for rendering just the contents of the main panel div YAHOO.util.Connect.asyncRequest( @@ -631,7 +633,7 @@ var MySpaces = { { if (confirm("Are you sure you want to delete: " + name)) { - $("spacePanelOverlay").setStyle('opacity', MySpaces.OVERLAY_OPACITY); + MySpaces.applyModal(); // ajax call to delete item YAHOO.util.Connect.asyncRequest( @@ -647,13 +649,13 @@ var MySpaces = { else { alert("Error during delete of item: " + response.responseText); - $("spacePanelOverlay").setStyle('opacity', 0); + MySpaces.removeModal(); } }, failure: function(response) { alert("Error during delete of item: " + response.responseText); - $("spacePanelOverlay").setStyle('opacity', 0); + MySpaces.removeModal(); } }, "noderef=" + noderef @@ -666,7 +668,7 @@ var MySpaces = { */ checkoutItem: function(name, noderef) { - $("spacePanelOverlay").setStyle('opacity', MySpaces.OVERLAY_OPACITY); + MySpaces.applyModal(); // ajax call to check out item YAHOO.util.Connect.asyncRequest( @@ -682,13 +684,13 @@ var MySpaces = { else { alert("Error during check out of item: " + response.responseText); - $("spacePanelOverlay").setStyle('opacity', 0); + MySpaces.removeModal(); } }, failure: function(response) { alert("Error during check out of item: " + response.responseText); - $("spacePanelOverlay").setStyle('opacity', 0); + MySpaces.removeModal(); } }, "noderef=" + noderef @@ -700,7 +702,7 @@ var MySpaces = { */ checkinItem: function(name, noderef) { - $("spacePanelOverlay").setStyle('opacity', MySpaces.OVERLAY_OPACITY); + MySpaces.applyModal(); // ajax call to check in item YAHOO.util.Connect.asyncRequest( @@ -716,13 +718,13 @@ var MySpaces = { else { alert("Error during check in of item: " + response.responseText); - $("spacePanelOverlay").setStyle('opacity', 0); + MySpaces.removeModal(); } }, failure: function(response) { alert("Error during check in of item: " + response.responseText); - $("spacePanelOverlay").setStyle('opacity', 0); + MySpaces.removeModal(); } }, "noderef=" + noderef @@ -844,6 +846,16 @@ var MySpaces = { spacePanel.empty(); spacePanel.removeEvents('mouseleave'); MySpaces.start(); + }, + + applyModal: function() + { + $("spacePanelOverlay").setStyle('opacity', MySpaces.OVERLAY_OPACITY); + }, + + removeModal: function() + { + $("spacePanelOverlay").setStyle('opacity', 0); } };