com.acsinet_solutions.cetia4.controller.nav
Interface NavigationFlow

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
SimpleNavigationFlow

public interface NavigationFlow
extends java.io.Serializable

Navigation Flow interface. Defines the methods for a structure that manages the navigation flow of a user within a web application. A navigation flow is compound internally of instances of NavigationStage and it's subinterface NavigationStageGroup.

Instances of this type will be stored at session level, so they MUST be serializable.

See Also:
NavigationStage, NavigationStageGroup

Method Summary
 void clear(RequestContext context)
          Clear the navigation structure.
 boolean clearUpTo(RequestContext context, NavigationStage stage)
          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 stage)
          Load a stage or stage group.
 void unloadStage(RequestContext context, NavigationStage stage)
          Unload ( delete from the flow ) a stage or stage group.
 

Method Detail

loadStage

void loadStage(RequestContext context,
               NavigationStage stage)
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.

Parameters:
stage - A not-null NavigationStage instance
See Also:
NavigationStage.performMatch(NavigationStage)

unloadStage

void unloadStage(RequestContext context,
                 NavigationStage stage)
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.

Parameters:
stage - A not-null NavigationStageImpl instance
See Also:
NavigationStage.performMatch(NavigationStage)

clearUpTo

boolean clearUpTo(RequestContext context,
                  NavigationStage stage)
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.

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)

clear

void clear(RequestContext context)
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.


getCurrentStage

NavigationStage getCurrentStage()
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.

Returns:
A not-null NavigationStageImpl instance

getPreviousStage

NavigationStage getPreviousStage()
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.

Returns:
The A not-null NavigationStageImpl instance

getRootStage

NavigationStage getRootStage()
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.

Returns:
The A not-null NavigationStageImpl instance

getCancelStage

NavigationStage getCancelStage()
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.

Returns:
The A not-null NavigationStageImpl instance

getStages

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

Returns:
A not-null not-empty read-only Collection instance of NavigationStageImpl and NavigationStageGroupImpl instances
See Also:
BreadcrumbTag