NAME
Solstice::MessageService - A service for sending all types of messages up a controller chain.
SYNOPSIS
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
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
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
AUTHOR
Catalyst Group, <catalyst@u.washington.edu>
VERSION
$Revision: 2528 $
COPYRIGHT
Copyright 1998-2007 Office of Learning Technologies, University of Washington
Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.