org.alfresco.web.app
Class AlfrescoNavigationHandler

java.lang.Object
  extended by javax.faces.application.NavigationHandler
      extended by org.alfresco.web.app.AlfrescoNavigationHandler

public class AlfrescoNavigationHandler
extends javax.faces.application.NavigationHandler


Field Summary
static java.lang.String CLOSE_DIALOG_OUTCOME
           
static java.lang.String CLOSE_MULTIPLE_END
           
static java.lang.String CLOSE_MULTIPLE_START
           
static java.lang.String CLOSE_WIZARD_OUTCOME
           
static java.lang.String DIALOG_PREFIX
           
protected  java.lang.String dialogContainer
           
static java.lang.String EXTERNAL_CONTAINER_SESSION
           
static java.lang.String OUTCOME_BROWSE
           
static java.lang.String OUTCOME_SEPARATOR
           
protected  java.lang.String plainDialogContainer
           
protected  java.lang.String plainWizardContainer
           
static java.lang.String WIZARD_PREFIX
           
protected  java.lang.String wizardContainer
           
 
Constructor Summary
AlfrescoNavigationHandler(javax.faces.application.NavigationHandler origHandler)
          Default constructor
 
Method Summary
protected  void addCurrentViewToStack(javax.faces.context.FacesContext context)
          Adds the current view to the stack (if required).
protected  DialogsConfigElement.DialogConfig getDialogConfig(javax.faces.context.FacesContext context, java.lang.String name, Node dispatchContext)
          Returns the dialog configuration object for the given dialog name.
protected  java.lang.String getDialogContainer(javax.faces.context.FacesContext context)
          Retrieves the configured dialog container page
protected  Node getDispatchContextNode(javax.faces.context.FacesContext context)
          Returns the node currently in the dispatch context
protected  int getNumberToClose(java.lang.String outcome)
           
protected  java.lang.String getOutcomeOverride(java.lang.String outcome)
          Returns the overridden outcome.
protected  java.lang.String getViewIdFromStackObject(javax.faces.context.FacesContext context, java.lang.Object topOfStack)
          Returns the view id of the given item retrieved from the view stack.
protected  WizardsConfigElement.WizardConfig getWizardConfig(javax.faces.context.FacesContext context, java.lang.String name, Node dispatchContext)
          Returns the wizard configuration object for the given wizard name.
protected  java.lang.String getWizardContainer(javax.faces.context.FacesContext context)
          Retrieves the configured wizard container page
protected  void handleBrowseDispatch(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome)
           
protected  void handleDialogOpen(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String name)
          Opens a dialog
protected  void handleDialogOrWizardClose(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome, boolean dialog)
          Closes the current dialog or wizard
protected  void handleDispatch(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome)
          Processes any dispatching that may need to occur
 void handleNavigation(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String outcome)
           
protected  void handleWizardOpen(javax.faces.context.FacesContext context, java.lang.String fromAction, java.lang.String name)
          Opens a wizard
protected  boolean isDialog(java.lang.String outcome)
          Determines whether the given outcome is dialog related
protected  boolean isDialogOrWizardClosing(java.lang.String outcome)
          Determines whether the given outcome represents a dialog or wizard closing
protected  boolean isWizard(java.lang.String outcome)
          Determines whether the given outcome is wizard related
protected  boolean isWizardStep(java.lang.String fromAction)
          Determines whether the given fromAction represents a step in the wizard i.e.
protected  java.lang.String stripPrefix(java.lang.String outcome)
          Removes the dialog or wizard prefix from the given outcome
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUTCOME_SEPARATOR

public static final java.lang.String OUTCOME_SEPARATOR
See Also:
Constant Field Values

OUTCOME_BROWSE

public static final java.lang.String OUTCOME_BROWSE
See Also:
Constant Field Values

DIALOG_PREFIX

public static final java.lang.String DIALOG_PREFIX
See Also:
Constant Field Values

WIZARD_PREFIX

public static final java.lang.String WIZARD_PREFIX
See Also:
Constant Field Values

CLOSE_DIALOG_OUTCOME

public static final java.lang.String CLOSE_DIALOG_OUTCOME
See Also:
Constant Field Values

CLOSE_WIZARD_OUTCOME

public static final java.lang.String CLOSE_WIZARD_OUTCOME
See Also:
Constant Field Values

CLOSE_MULTIPLE_START

public static final java.lang.String CLOSE_MULTIPLE_START
See Also:
Constant Field Values

CLOSE_MULTIPLE_END

public static final java.lang.String CLOSE_MULTIPLE_END
See Also:
Constant Field Values

EXTERNAL_CONTAINER_SESSION

public static final java.lang.String EXTERNAL_CONTAINER_SESSION
See Also:
Constant Field Values

dialogContainer

protected java.lang.String dialogContainer

wizardContainer

protected java.lang.String wizardContainer

plainDialogContainer

protected java.lang.String plainDialogContainer

plainWizardContainer

protected java.lang.String plainWizardContainer
Constructor Detail

AlfrescoNavigationHandler

public AlfrescoNavigationHandler(javax.faces.application.NavigationHandler origHandler)
Default constructor

Parameters:
origHandler - The original navigation handler
Method Detail

handleNavigation

public void handleNavigation(javax.faces.context.FacesContext context,
                             java.lang.String fromAction,
                             java.lang.String outcome)
Specified by:
handleNavigation in class javax.faces.application.NavigationHandler
See Also:
NavigationHandler.handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)

isDialog

protected boolean isDialog(java.lang.String outcome)
Determines whether the given outcome is dialog related

Parameters:
outcome - The outcome to test
Returns:
true if outcome is dialog related i.e. starts with dialog:

isWizard

protected boolean isWizard(java.lang.String outcome)
Determines whether the given outcome is wizard related

Parameters:
outcome - The outcome to test
Returns:
true if outcome is wizard related i.e. starts with create-wizard: or edit-wizard:

isDialogOrWizardClosing

protected boolean isDialogOrWizardClosing(java.lang.String outcome)
Determines whether the given outcome represents a dialog or wizard closing

Parameters:
outcome - The outcome to test
Returns:
true if the outcome represents a closing dialog or wizard

getNumberToClose

protected int getNumberToClose(java.lang.String outcome)

isWizardStep

protected boolean isWizardStep(java.lang.String fromAction)
Determines whether the given fromAction represents a step in the wizard i.e. next or back

Parameters:
fromAction - The fromAction
Returns:
true if the from action represents a wizard step

stripPrefix

protected java.lang.String stripPrefix(java.lang.String outcome)
Removes the dialog or wizard prefix from the given outcome

Parameters:
outcome - The outcome to remove the prefix from
Returns:
The remaining outcome

getOutcomeOverride

protected java.lang.String getOutcomeOverride(java.lang.String outcome)
Returns the overridden outcome. Used by dialogs and wizards to go to a particular page after it closes rather than back to the page it was launched from.

Parameters:
outcome - The current outcome
Returns:
The overridden outcome or null if there isn't an override

getDialogConfig

protected DialogsConfigElement.DialogConfig getDialogConfig(javax.faces.context.FacesContext context,
                                                            java.lang.String name,
                                                            Node dispatchContext)
Returns the dialog configuration object for the given dialog name. If there is a node in the dispatch context a lookup is performed using the node otherwise the global config section is used.

Parameters:
name - The name of dialog being launched
dispatchContext - The node being acted upon
Returns:
The DialogConfig for the dialog or null if no config could be found

getWizardConfig

protected WizardsConfigElement.WizardConfig getWizardConfig(javax.faces.context.FacesContext context,
                                                            java.lang.String name,
                                                            Node dispatchContext)
Returns the wizard configuration object for the given wizard name. If there is a node in the dispatch context a lookup is performed using the node otherwise the global config section is used.

Parameters:
name - The name of wizard being launched
dispatchContext - The node being acted upon
Returns:
The WizardConfig for the wizard or null if no config could be found

getDialogContainer

protected java.lang.String getDialogContainer(javax.faces.context.FacesContext context)
Retrieves the configured dialog container page

Parameters:
context - FacesContext
Returns:
The container page

getWizardContainer

protected java.lang.String getWizardContainer(javax.faces.context.FacesContext context)
Retrieves the configured wizard container page

Parameters:
context - FacesContext
Returns:
The container page

getDispatchContextNode

protected Node getDispatchContextNode(javax.faces.context.FacesContext context)
Returns the node currently in the dispatch context

Returns:
The node currently in the dispatch context or null if the dispatch context is empty

handleBrowseDispatch

protected void handleBrowseDispatch(javax.faces.context.FacesContext context,
                                    java.lang.String fromAction,
                                    java.lang.String outcome)

handleDispatch

protected void handleDispatch(javax.faces.context.FacesContext context,
                              java.lang.String fromAction,
                              java.lang.String outcome)
Processes any dispatching that may need to occur

Parameters:
context - Faces context
fromAction - The from action
outcome - The outcome

handleDialogOpen

protected void handleDialogOpen(javax.faces.context.FacesContext context,
                                java.lang.String fromAction,
                                java.lang.String name)
Opens a dialog

Parameters:
context - FacesContext
fromAction - The fromAction
name - The name of the dialog to open

handleWizardOpen

protected void handleWizardOpen(javax.faces.context.FacesContext context,
                                java.lang.String fromAction,
                                java.lang.String name)
Opens a wizard

Parameters:
context - FacesContext
fromAction - The fromAction
name - The name of the wizard to open

handleDialogOrWizardClose

protected void handleDialogOrWizardClose(javax.faces.context.FacesContext context,
                                         java.lang.String fromAction,
                                         java.lang.String outcome,
                                         boolean dialog)
Closes the current dialog or wizard

Parameters:
context - FacesContext
fromAction - The fromAction
outcome - The outcome
dialog - true if a dialog is being closed, false if a wizard is being closed

getViewIdFromStackObject

protected java.lang.String getViewIdFromStackObject(javax.faces.context.FacesContext context,
                                                    java.lang.Object topOfStack)
Returns the view id of the given item retrieved from the view stack.

Parameters:
context - FacesContext
topOfStack - The object retrieved from the view stack
Returns:
The view id

addCurrentViewToStack

protected void addCurrentViewToStack(javax.faces.context.FacesContext context)
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 to stop the stack from growing and growing.

Parameters:
context - FacesContext


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.