Solstice::MessageService - A service for sending all types of messages up a controller chain.


Solstice documentation  | view source Contained in the Solstice distribution.

Index


NAME

Top

Solstice::MessageService - A service for sending all types of messages up a controller chain.

SYNOPSIS

Top

  use Solstice::MessageService;

  my $message_service = Solstice::MessageService->new();
  $message_service->addErrorMessage('Message text');
  # You can also add messages directly from the language file
  $message_service->addErrorKey('lang_service_key');

DESCRIPTION

Top

This is a service for putting a user notification at the top of a screen. This enables screens with multiple active controllers to display pertinent messages from each controller without a trickle up chain, and it makes it so parent controllers don't need to check for error objects in child controllers. This service has a priority chain, so only one type of message will be displayed at a time.

Superclass

Solstice::Service

Export

No symbols exported.

Methods

new()

Creates a new Solstice::MessageService, tied to an Apache thread wide base of messages.

addInfoMessage()
addInfoKey()
clearInfoMessages()
addErrorMessage()
addErroKey()
clearErrorMessages()
addSuccessMessage()
addSuccessKey()
clearSuccessMessages()
addWarningMessage()
addWarningKey()
clearWarningMessages()
addSystemMessage()
addSystemKey()
clearSystemMessages()
getMessageType()

Gets the current message type.

getMessages()

Returns an array of all messages. Returns () if no messages have been set.

clearAll

Clears out all message queues, leaving message service empty.

Private Methods

addMessage($message_text)

Adds message text to the queue of messages in memory. Checks for duplicates and ignores them.

_setMessageType($message_type)

Sets the message type, if there is a higher priority message, then message type won't be set.

_clear($message_type)

clears out the given queue.

_getExistingName()

Returns the name to use to get the hash of existing messages.

_getClassName()

Return the class name. Overridden to avoid a ref() in the superclass.

Modules Used

Solstice::Service.

AUTHOR

Top

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

VERSION

Top

$Revision: 2528 $

COPYRIGHT

Top


Solstice documentation  | view source Contained in the Solstice distribution.