Solstice::State::Tracker - Tracks each users' progress through the state graph.


Solstice documentation  | view source Contained in the Solstice distribution.

Index


NAME

Top

Solstice::State::Tracker - Tracks each users' progress through the state graph.

SYNOPSIS

Top

  use Solstice::State::Tracker;
  my $tracker = new Solstice::State::Tracker;

  my $current_state = $tracker->getState();

  # These are passthroughs to the state machine
  $validate = $tracker->requiresValidation('transition');
  $revert = $tracker->requiresRevert('transition');
  $fresh = $tracker->requiresFresh('transition');
  $commit = $tracker->requiresCommit('transition');
  $update = $tracker->requiresUpdate('transition');

  if (! $tracker->transition('transition')) {
    die "Couldn't make a transition";
  }

  my $controller_name = $tracker->getController();

DESCRIPTION

Top

This tracks the way a user moves through a Solstice tool. It seperates the state data from the movement through it, to help save some memory/cpu in the generation/storing of the state table. This is also the model for the navigation view.

Methods

new()

Constructor for a new State::Tracker object. You are not in a state yet until you call startApplication.

startApplication($pageFlowName, $state)

Pushes a new flow and state onto the stack. Use this when you need to set the user's position to a particular flow/state (like when they type in a URL).

getController($app)

Returns the controller for the current state.

getState()

Returns the name of the current state.

setState()

Sets the current state.

canUseBackButton($action)

Returns whether the user should be able to use the back button after this transition.

getBackErrorMessage()

Returns the error message a user should receive if the back button is used but not allowed.

requires*($action)

Returns whether we have to run lifecycle stages

fail*()

Transitions to the failover state for the corresponding lifecycle stage.

returns - the controller for the new state.

getUpdateFailoverController()

Nontransitioning version of failUpdate()

getValidPreConditionsFailoverController()

Nontransitioning version of failValidPreConditions()

getFlow()

Returns the current page flow.

AUTHOR

Top

Catalyst Group, <catalyst@u.washington.edu>

VERSION

Top

$Revision: 3364 $

COPYRIGHT

Top


Solstice documentation  | view source Contained in the Solstice distribution.