Solstice::Controller::Application - The super class for all application controllers.


Solstice documentation Contained in the Solstice distribution.

Index


Code Index:

NAME

Top

Solstice::Controller::Application - The super class for all application controllers.

SYNOPSIS

Top

  use Solstice::Controller::Application;
  our @ISA = qw(Solstice::Controller::Application);

DESCRIPTION

Top

Has the stub functions that all application controllers need.

Superclass

Solstice::Controller,

Export

No symbols exported.

Methods

new($application)

Constructor.

getController()

Returns the controller currently set for a subclass.

setController($controller)

This function is for subclasses, so they can tell us which controller to use.

validate()

Validates user input from the previous screen.

update()
revert()
commit()

Does any action of the controller after validation, such as saving objects or deleting them.

validPreConditions()

Makes sure the controller knows everything it needs to in order to create the next view.

finalize()

Allows conrollers to clean up any resource they need to right before the click lifecycle is over

getView()

Returns the view of the summary.

setInputName()
setOutputName()
setRequiresAuth($boolean)
getRequiresAuth()
getBookmarkState()
getBookmarkID()
getBookmarkLabel()
setBookmarkID($id)

Modules Used

Solstice::Controller, HTTP::BrowserDetect.

AUTHOR

Top

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

VERSION

Top

$Revision: 3364 $

COPYRIGHT

Top


Solstice documentation Contained in the Solstice distribution.
package Solstice::Controller::Application;

# $Id: Application.pm 3364 2006-05-05 07:18:21Z mcrawfor $

use 5.006_000;
use strict;
use warnings;

use base qw(Solstice::Controller);

use Carp qw(confess);

use constant TRUE  => 1;
use constant FALSE => 0;

our ($VERSION) = ('$Revision: 3364 $' =~ /^\$Revision:\s*([\d.]*)/);

sub new {
    my $class = shift;
    return $class->SUPER::new(@_);
}

sub getController {
    my $self = shift;
    return $self->{'_controller'};
}

sub setController {
    my $self = shift;
    $self->{'_controller'} = shift;
}

sub validate {
    my $self = shift;
    
    unless (defined $self->getController()) {
        confess "validate(): Controller not defined";
    }
    
    return $self->getController()->validate();
}

sub update {
    my $self = shift;
    
    unless (defined $self->getController()) {
        confess "update(): Controller not defined";
    }
    
    return $self->getController()->update();
}

sub revert {
    my $self = shift;
    
    unless (defined $self->getController()) {
        confess "revert(): Controller not defined";
    }
    
    return $self->getController()->revert();
}

sub commit {
    my $self = shift;
    
    unless (defined $self->getController()) {
        confess "commit(): Controller not defined";
    }
    
    return $self->getController()->commit();
}

sub validPreConditions {
    my $self = shift;
    
    unless (defined $self->getController()) {
        confess "validPreConditions(): Controller not defined";
    }
    
    return $self->getController()->validPreConditions();
}

sub initialize {
    my $self = shift;

    unless (defined $self->getController()) {
        confess "initialize(): Controller not defined";
    }

    return $self->getController()->initialize();
}

sub finalize {
    my $self = shift;
    
    unless (defined $self->getController()) {
        confess "finalize(): Controller not defined"; 
    }
    
    return $self->getController()->finalize();
}

sub getView {
    my $self = shift;
    
    unless (defined $self->getController()) {
        confess "getView(): Controller not defined"; 
    }
    
    return $self->getController()->getView();
}

sub setInputName {
    my $self = shift;

    unless (defined $self->getController()) {
        confess "setInputName(): Controller not defined";
    }

    return $self->getController()->setInputName(@_);
}

sub setOutputName {
    my $self = shift;

    unless (defined $self->getController()) {
        confess "setOutputName(): Controller not defined";
    }
    
    return $self->getController()->setOutputName(@_);
}

sub setRequiresAuth {
    my $self = shift;
    $self->{'_requires_auth'} = shift;
}

sub getRequiresAuth {
    my $self = shift;
    return $self->{'_requires_auth'} || FALSE;
}

sub getBookmarkState {

}

sub getBookmarkID {

}

sub getBookmarkLabel {

}

sub setBookmarkID {
    warn "setBookmarkID should really be handled by the application controller.";
}

1;

__END__