Merged V2.1 to HEAD

6338: Some WCM-435.
   6344: Fix for AWC-1452 (dialog close navigation issue)
   6345: Fix for AR-1611 and other related CIFS and NFS fixes
   6346: Minor javadoc fix for ReplicatingContentStore
   6347: Handle exceptions arising from UserTransaction.begin().
   6348: Many WCM fixes in one
            Conflicts resolved on faces-config-beans.xml


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6722 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-10 13:21:08 +00:00
parent 48fa124735
commit 0fb2ae13f9
38 changed files with 1290 additions and 895 deletions

View File

@@ -684,29 +684,7 @@ public class AlfrescoNavigationHandler extends NavigationHandler
if (logger.isDebugEnabled())
logger.debug("Popped item from the top of the view stack: " + topOfStack);
String newViewId = null;
if (topOfStack instanceof String)
{
newViewId = (String)topOfStack;
}
else if (topOfStack instanceof DialogState)
{
// restore the dialog state and get the dialog container viewId
Application.getDialogManager().restoreState((DialogState)topOfStack);
newViewId = getDialogContainer(context);
}
else if (topOfStack instanceof WizardState)
{
// restore the wizard state and get the wizard container viewId
Application.getWizardManager().restoreState((WizardState)topOfStack);
newViewId = getWizardContainer(context);
}
else
{
if (logger.isWarnEnabled())
logger.warn("Invalid object found on view stack: " + topOfStack);
}
String newViewId = getViewIdFromStackObject(context, topOfStack);
// go to the appropraite page
goToView(context, newViewId);
@@ -714,7 +692,10 @@ public class AlfrescoNavigationHandler extends NavigationHandler
else
{
// we also need to empty the dialog stack if we have been given
// an overidden outcome as we could be going anywhere in the app
// an overidden outcome as we could be going anywhere in the app.
// grab the current top item first though in case we need to open
// another dialog or wizard
String previousViewId = getViewIdFromStackObject(context, getViewStack(context).peek());
getViewStack(context).clear();
if (logger.isDebugEnabled())
@@ -723,7 +704,18 @@ public class AlfrescoNavigationHandler extends NavigationHandler
// if the override is calling another dialog or wizard come back through
// the navigation handler from the beginning
if (isDialog(overriddenOutcome) || isWizard(overriddenOutcome))
{
{
// set the view id to the page at the top of the stack so when
// the new dialog or wizard closes it goes back to the correct page
context.getViewRoot().setViewId(previousViewId);
if (logger.isDebugEnabled())
{
logger.debug("view stack: " + getViewStack(context));
logger.debug("Opening '" + overriddenOutcome + "' after " + closingItem +
" close using view id: " + previousViewId);
}
this.handleNavigation(context, fromAction, overriddenOutcome);
}
else
@@ -745,6 +737,42 @@ public class AlfrescoNavigationHandler extends NavigationHandler
}
}
/**
* Returns the view id of the given item retrieved from the view stack.
*
* @param context FacesContext
* @param topOfStack The object retrieved from the view stack
* @return The view id
*/
protected String getViewIdFromStackObject(FacesContext context, Object topOfStack)
{
String viewId = null;
if (topOfStack instanceof String)
{
viewId = (String)topOfStack;
}
else if (topOfStack instanceof DialogState)
{
// restore the dialog state and get the dialog container viewId
Application.getDialogManager().restoreState((DialogState)topOfStack);
viewId = getDialogContainer(context);
}
else if (topOfStack instanceof WizardState)
{
// restore the wizard state and get the wizard container viewId
Application.getWizardManager().restoreState((WizardState)topOfStack);
viewId = getWizardContainer(context);
}
else
{
if (logger.isWarnEnabled())
logger.warn("Invalid object found on view stack: " + topOfStack);
}
return viewId;
}
/**
* Adds the current view to the stack (if required).
* If the current view is already the top of the stack it is not added again