|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ideo.sweetdev.core.service.AbstractService
com.ideo.sweetdev.presentation.service.error.ErrorService2
the class ErrorService2 allows to store a list of messages and errors. These messages and errors can be displayed later by means of the CustomErrorTag tag.
This class displays every error by default.
To disable this option, use
setTrace(false);
![]() |
![]() |
| Field Summary | |
protected static java.lang.String |
CLASS_NAME
class name. |
protected static java.lang.String |
DEFAULT_EMPTY_ERRORMSG
message to display if no other one is supplied. |
protected static java.lang.String |
USER_NULL_ERRORMSG
USER_NULL_ERRORMSG. |
| Constructor Summary | |
ErrorService2(java.lang.String _name)
Constructs an error service 2. |
|
| Method Summary | |
void |
configure(java.util.Map _parameters)
Configure the service. |
java.util.Collection |
consumeMessages(java.lang.String _sessionID)
This methode gets the messages for a given user and specified session, and delete them. |
protected static java.lang.String |
getErrorMessage(java.util.Locale _locale,
java.lang.String _key)
This method returns an error message following the locale. |
protected static java.lang.String |
getErrorMessage(java.util.Locale _locale,
java.lang.String _key,
java.lang.Object[] _parametersTab)
This method returns an error message following the locale. |
static java.util.Map |
getMessages()
This method returns the messages map. |
java.util.Collection |
getMessages(java.lang.String _session)
This methode gets the messages for a given user and specified session, without deleting them. |
static boolean |
getTrace()
This method retrieves the trace attribute. |
void |
init()
Initialize the service. |
static boolean |
isEmpty(java.lang.String _sessionID)
This method checks if current user have errors in session. |
void |
refresh()
Refresh the service data cache |
static void |
saveError(java.lang.String _sessionID,
java.lang.Throwable _throwable,
java.lang.String _className,
java.util.Locale _locale)
This method saves an error of user in session. |
static void |
saveErrors(java.lang.String _sessionID,
java.util.Collection _errors,
java.lang.String _className)
This method saves an error of user in session. |
static void |
saveMessage(java.lang.String _key,
java.lang.Object[] _parameters,
java.lang.String _type,
java.lang.Integer _indent,
java.lang.String _sessionID,
java.util.Locale _locale)
This method saves a message of user in session. |
static void |
saveMessage(java.lang.Throwable _throwable,
java.lang.String _className,
java.lang.String _sessionID,
java.lang.Integer _indent,
java.util.Locale _locale)
This method saves a message of user in session. |
static void |
setMessages(java.util.Map _messages)
This method sets the messages map. |
static void |
setTrace(boolean _trace)
This method sets the trace attribute. |
| Methods inherited from class com.ideo.sweetdev.core.service.AbstractService |
getServiceName, setServiceName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.ideo.sweetdev.core.service.IService |
getServiceName |
| Field Detail |
protected static final java.lang.String DEFAULT_EMPTY_ERRORMSG
protected static final java.lang.String USER_NULL_ERRORMSG
protected static final java.lang.String CLASS_NAME
| Constructor Detail |
public ErrorService2(java.lang.String _name)
_name - the service name.| Method Detail |
public void init()
throws TechnicalException
IService
init in interface IServiceinit in class AbstractServiceTechnicalExceptionIService.init()
public void configure(java.util.Map _parameters)
throws TechnicalException
IService
configure in interface IServiceconfigure in class AbstractServiceTechnicalExceptionIService.configure(java.util.Map)public void refresh()
IService
refresh in interface IServicerefresh in class AbstractServiceIService.refresh()public static boolean isEmpty(java.lang.String _sessionID)
_sessionID - the current session id.
protected static java.lang.String getErrorMessage(java.util.Locale _locale,
java.lang.String _key)
_locale - the current locales._key - the message key.
protected static java.lang.String getErrorMessage(java.util.Locale _locale,
java.lang.String _key,
java.lang.Object[] _parametersTab)
_locale - the current locales._key - the message key._parametersTab - the array of parameters.
public static void saveError(java.lang.String _sessionID,
java.lang.Throwable _throwable,
java.lang.String _className,
java.util.Locale _locale)
_sessionID - the current session._throwable - the exception where the error comes from._className - name of the class that raised the error._locale - the current locales.
public static void saveErrors(java.lang.String _sessionID,
java.util.Collection _errors,
java.lang.String _className)
_sessionID - the current session id._errors - the collection of ActionMessage to save._className - name of the class that raised the list of errors.
public static void saveMessage(java.lang.Throwable _throwable,
java.lang.String _className,
java.lang.String _sessionID,
java.lang.Integer _indent,
java.util.Locale _locale)
_throwable - the exception where the error comes from._className - name of the class that raised the error._sessionID - the current session id._indent - indentation level.
public static void saveMessage(java.lang.String _key,
java.lang.Object[] _parameters,
java.lang.String _type,
java.lang.Integer _indent,
java.lang.String _sessionID,
java.util.Locale _locale)
_key - key of the message to display._parameters - message parameters (peut etre null)._type - message type : ActionMessage.ERROR, ActionMessage.MESSAGE, ActionMessage.WARNING._indent - indentation level : ActionMessage.LEVEL_0, ActionMessage.LEVEL_1, ActionMessage.LEVEL_2._sessionID - the current session.public java.util.Collection consumeMessages(java.lang.String _sessionID)
IErrorService2
consumeMessages in interface IErrorService2_sessionID - the current session ID.
com.ideo.sweetdev.presentation.service.error.IErrorService2#consumeMessages(javax.servlet.http.HttpSession)public java.util.Collection getMessages(java.lang.String _session)
IErrorService2
getMessages in interface IErrorService2_session - the current session ID.
com.ideo.sweetdev.presentation.service.error.IErrorService2#getMessages(javax.servlet.http.HttpSession)public static java.util.Map getMessages()
public static void setMessages(java.util.Map _messages)
public static void setTrace(boolean _trace)
_trace - the trace attribute.public static boolean getTrace()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||