com.acsinet_solutions.cetia4.controller.nav
Class SimpleNavigationFlow

java.lang.Object
  extended by com.acsinet_solutions.cetia4.controller.nav.SimpleNavigationFlow
All Implemented Interfaces:
NavigationFlow, java.io.Serializable

public final class SimpleNavigationFlow
extends java.lang.Object
implements NavigationFlow

Implementation of a simple navigation flow.

Derechos Reservados

Author:
Santiago Arriaga
See Also:
Serialized Form

Constructor Summary
SimpleNavigationFlow(NavigationStage stage)
          Public constructor.
 
Method Summary
 void clear(RequestContext context)
          Clear the navigation structure.
 boolean clearUpTo(RequestContext context, NavigationStage clearStage)
          Clear up to the path given by the provided stage, that is - all the following stages to the stage in the flow corresponding to the argument stage will be deleted.
 NavigationStage getCancelStage()
          Get the cancel stage.
 NavigationStage getCurrentStage()
          Get the current stage.
 NavigationStage getPreviousStage()
          Get the previous stage.
 NavigationStage getRootStage()
          Get the root stage.
 java.util.Collection<NavigationStage> getStages()
          Get an ordered collection with all the stages in the current flow.
 void loadStage(RequestContext context, NavigationStage newStage)
          Load a stage or stage group.
 java.lang.String toString()
           
 void unloadStage(RequestContext context, NavigationStage stage)
          Unload ( delete from the flow ) a stage or stage group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleNavigationFlow

public SimpleNavigationFlow(NavigationStage stage)
Public constructor.

Parameters:
struct - A not-null valid NavigationStageImpl representing the default navigation stage.
Method Detail

loadStage

public final void loadStage(RequestContext context,
                            NavigationStage newStage)
Description copied from interface: NavigationFlow
Load a stage or stage group. If the stage to be loaded corresponds to a stage previously loaded in the flow, the corresponding stage will be substituted with the one that is being loaded ( maybe the parameters on the link differ ) and the final stages will be deleted.

The request context reference is needed in this and other methods. to perform attribute management when unloading stages.

If the RequestContext reference is null, no attribute management will be performed.

Specified by:
loadStage in interface NavigationFlow
newStage - A not-null NavigationStage instance
See Also:
NavigationStage.performMatch(NavigationStage)

clearUpTo

public final boolean clearUpTo(RequestContext context,
                               NavigationStage clearStage)
Description copied from interface: NavigationFlow
Clear up to the path given by the provided stage, that is - all the following stages to the stage in the flow corresponding to the argument stage will be deleted. In other words, if a stage corresponding to the given stage is found in the flow, it will be left as the last stage in the flow. The found stage will not be substituted by the argument stage. If no corresponding stage is found, the flow will remain unchanged. If the found stage is currently the last stage in the flow, the flow will also remain unchanged.

The request context reference is needed in this and other methods. to perform attribute management when unloading stages.

If the RequestContext reference is null, no attribute management will be performed.

Specified by:
clearUpTo in interface NavigationFlow
Returns:
true if a corresponding stage is found in the flow; false otherwise ( the flow is unchanged in this case ).
See Also:
NavigationStage.performMatch(NavigationStage)

unloadStage

public final void unloadStage(RequestContext context,
                              NavigationStage stage)
Description copied from interface: NavigationFlow
Unload ( delete from the flow ) a stage or stage group. All the stages following the unloaded one will also be deleted. The default ( first ) stage cannot be unloaded.

The request context reference is needed in this and other methods. to perform attribute management when unloading stages.

If the RequestContext reference is null, no attribute management will be performed.

Specified by:
unloadStage in interface NavigationFlow
stage - A not-null NavigationStageImpl instance
See Also:
NavigationStage.performMatch(NavigationStage)

getCurrentStage

public final NavigationStage getCurrentStage()
Description copied from interface: NavigationFlow
Get the current stage. Useful for tags that do redirection to the current page. The returned NavigationStageImpl may be altered ( to modify navigation within a page, for example ), and the change will not reflect the user's navigation flow.

Specified by:
getCurrentStage in interface NavigationFlow
Returns:
A not-null NavigationStageImpl instance

getPreviousStage

public final NavigationStage getPreviousStage()
Description copied from interface: NavigationFlow
Get the previous stage. This is the last stage visited by the user. Useful for tags that do redirection to the last controller when the last controller may be one of many. The returned NavigationStageImpl may be altered ( to modify navigation within a page, for example ), and the change will not reflect the user's navigation flow.

Specified by:
getPreviousStage in interface NavigationFlow
Returns:
The A not-null NavigationStageImpl instance

getRootStage

public final NavigationStage getRootStage()
Description copied from interface: NavigationFlow
Get the root stage. This is the first stage in the flow. The returned NavigationStageImpl may be altered ( to modify navigation within a page, for example ), and the change will not reflect the user's navigation flow.

Specified by:
getRootStage in interface NavigationFlow
Returns:
The A not-null NavigationStageImpl instance

getCancelStage

public final NavigationStage getCancelStage()
Description copied from interface: NavigationFlow
Get the cancel stage. This is the last stage before entering a given group. This is useful for tags that do redirection to the last controller before entering a group of related pages. If the user is not currently in a group, the previous stage will be returned instead. The returned NavigationStageImpl may be altered ( to modify navigation within a page, for example ), and the change will not reflect the user's navigation flow.

Specified by:
getCancelStage in interface NavigationFlow
Returns:
The A not-null NavigationStageImpl instance

clear

public final void clear(RequestContext context)
Description copied from interface: NavigationFlow
Clear the navigation structure. Just the default stage is kept, as it cannot be deleted from the flow.

The request context reference is needed in this and other methods. to perform attribute management when unloading stages.

If the RequestContext reference is null, no attribute management will be performed.

Specified by:
clear in interface NavigationFlow

getStages

public final java.util.Collection<NavigationStage> getStages()
Description copied from interface: NavigationFlow
Get an ordered collection with all the stages in the current flow. This method is provided so breadcrumbs and navigation aids can be created.

Specified by:
getStages in interface NavigationFlow
Returns:
A not-null not-empty read-only Collection instance of NavigationStageImpl and NavigationStageGroupImpl instances
See Also:
BreadcrumbTag

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object