Web Dynpro API Documentation

com.sap.tc.webdynpro.progmodel.api
Interface IWDMessageManager


public interface IWDMessageManager

IWDMessageManager is used for reporting runtime exceptions that will not lead to a termination of the current Web Dynpro Component, but the error(s) is/are presented to the end user in a configurable manner. Additionally IWDMessageManager is also used for reporting warnings and success messages IWDMessageMananger offers 2 different types of methods. First, all methods starting with report... only store an exception or exception message and return without raising any exception. These methods are used in conjunction with multiple error presentation. Second, all methods starting with raise... internally raise some exception in order to continue with framework error processing. If running in multpile error mode, using method raisePendingExceptions checks for any error still stored and in case at least a single error is pending it also internally raise some exception in order to continue with framework error processing. Some method have an addtional parameter cancelNavigation. When setting this parameter to true, the framework does not execute navigation to inbound plugs in case at least 1 error is pending.


Method Summary
 void cancelNavigation()
          This methods cancels all subsequent navigational steps for the current request/ response cycle.
 boolean contains(IWDMessage messageItem)
          Ask for a specific message in the message managers queue.
 boolean hasExceptions()
          Returns true if no exception was reported yet.
 boolean isEmpty()
          Returns true if no exception, warning, info or success message is stored.
 void raiseException(java.lang.String message, boolean cancelNavigation)
          Reports the given message to the client.
 void raiseException(WDNonFatalException ex, boolean cancelNavigation)
          Reports a WDNonFatalException as error to the client.
 void raiseException(WDNonFatalRuntimeException ex, boolean cancelNavigation)
          Report a WDNonFatalRuntimeException as error to the client.
 void raiseInvalidContextAttributeException(IWDNodeElement element, IWDAttributeInfo attribute, java.lang.String message, boolean cancelNavigation)
          Report an exception caused by an invalid context attribute value.
 void raiseInvalidContextAttributeException(IWDNodeElement element, IWDAttributeInfo attribute, WDNonFatalException ex, boolean cancelNavigation)
          Raises an exception caused by an invalid context attribute value.
 void raiseInvalidContextAttributeMessage(IWDNodeElement element, IWDAttributeInfo attribute, IWDMessage messageItem, java.lang.Object[] args, boolean cancelNavigation)
          Raises a message caused by an invalid context attribute value.This method internally raises a Runtime exception and execution is continued in the Web Dynpro framework.
 void raiseMessage(IWDMessage messageItem, java.lang.Object[] args, boolean cancelNavigation)
          Raises a message for the given context attribute value.
 void raisePendingException()
          This method checks if any exceptions were reported to the exception manager and are still stored in the exceptions manager.
 void reportContextAttributeMessage(IWDNodeElement element, IWDAttributeInfo attribute, IWDMessage messageItem, java.lang.Object[] args, boolean cancelNavigation)
          Report a message item caused for the given context attribute value.
 void reportException(java.lang.String message, boolean cancelNavigation)
          Report error message message.
 void reportException(WDNonFatalException ex, boolean cancelNavigation)
          Report the exception ex to the client.
 void reportException(WDNonFatalRuntimeException ex, boolean cancelNavigation)
          Report the exception ex to the client.
 void reportInvalidContextAttributeException(IWDNodeElement element, IWDAttributeInfo attribute, java.lang.String message, boolean cancelNavigation)
          Report an exception caused by an invalid context attribute value.
 void reportInvalidContextAttributeException(IWDNodeElement element, IWDAttributeInfo attribute, WDNonFatalException ex, boolean cancelNavigation)
          Report an exception caused by an invalid context attribute value.
 void reportMessage(IWDMessage messageItem, java.lang.Object[] args, boolean cancelNavigation)
          Report a message item caused by an invalid context attribute value.
 void reportSuccess(java.lang.String message)
          Report an message message.
 void reportWarning(java.lang.String message)
          Report warning message message.
 

Method Detail

raiseException

public void raiseException(WDNonFatalRuntimeException ex,
                           boolean cancelNavigation)
Report a WDNonFatalRuntimeException as error to the client. This method does not return, but raises some framework internal exception instead in order to return to the framework error handler.
Parameters:
ex - is the exception raised by some validation routine
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

raiseException

public void raiseException(WDNonFatalException ex,
                           boolean cancelNavigation)
Reports a WDNonFatalException as error to the client. This method does not return, but raises some framework internal exception instead in order to return to the framework error handler.
Parameters:
ex - is the exception raised by some validation routine
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

raiseException

public void raiseException(java.lang.String message,
                           boolean cancelNavigation)
Reports the given message to the client. This method does not return but raises some framework internal exception instead in order to return to the framework error handler.
Parameters:
message - the message raised by some validation routine
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

reportException

public void reportException(WDNonFatalException ex,
                            boolean cancelNavigation)
Report the exception ex to the client. This method returns and may be called as often as necessary.
Parameters:
ex - the exception raised by some validation routine
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

reportException

public void reportException(WDNonFatalRuntimeException ex,
                            boolean cancelNavigation)
Report the exception ex to the client. This method returns and may be called as often as necessary.
Parameters:
ex - is the exception to be reported.
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

reportException

public void reportException(java.lang.String message,
                            boolean cancelNavigation)
Report error message message. This method returns and may be called as often as necessary.
Parameters:
message - is the human readable message that will be displayed on the client
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

reportWarning

public void reportWarning(java.lang.String message)
Report warning message message.
Parameters:
message - is the human readable message that will be displayed on the client

reportSuccess

public void reportSuccess(java.lang.String message)
Report an message message.
Parameters:
message - is the human readable message that will be displayed on the client

raiseInvalidContextAttributeException

public void raiseInvalidContextAttributeException(IWDNodeElement element,
                                                  IWDAttributeInfo attribute,
                                                  WDNonFatalException ex,
                                                  boolean cancelNavigation)
Raises an exception caused by an invalid context attribute value.
Parameters:
element - is a reference to the context node element containing the invalid attribute
attribute - is the attribute info of the attribute which is invalid
ex - is the exception raised by some validation routine
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

reportInvalidContextAttributeException

public void reportInvalidContextAttributeException(IWDNodeElement element,
                                                   IWDAttributeInfo attribute,
                                                   WDNonFatalException ex,
                                                   boolean cancelNavigation)
Report an exception caused by an invalid context attribute value. This method returns and may be called as often as necessary.
Parameters:
element - is a reference to the context node element containing the invalid attribute
attribute - is the attribute info of the attribute which is invalid
ex - is the exception raised by some validation routine
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

raiseInvalidContextAttributeException

public void raiseInvalidContextAttributeException(IWDNodeElement element,
                                                  IWDAttributeInfo attribute,
                                                  java.lang.String message,
                                                  boolean cancelNavigation)
Report an exception caused by an invalid context attribute value. This method does not return, but raises some framework internal exception instead in order to return to the framework error handler.
Parameters:
element - is a reference to the context node element containing the invalid attribute
attribute - is the attribute info of the attribute which is invalid
message - is the error message to be displayed
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

reportInvalidContextAttributeException

public void reportInvalidContextAttributeException(IWDNodeElement element,
                                                   IWDAttributeInfo attribute,
                                                   java.lang.String message,
                                                   boolean cancelNavigation)
Report an exception caused by an invalid context attribute value. This method returns and may be called as often as necessary.
Parameters:
element - is a reference to the context node element containing the invalid attribute
attribute - is the attribute info of the attribute which is invalid
message - is the error message to be displayed
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this error. (see also cancelNavigation()).

raiseInvalidContextAttributeMessage

public void raiseInvalidContextAttributeMessage(IWDNodeElement element,
                                                IWDAttributeInfo attribute,
                                                IWDMessage messageItem,
                                                java.lang.Object[] args,
                                                boolean cancelNavigation)
Raises a message caused by an invalid context attribute value.This method internally raises a Runtime exception and execution is continued in the Web Dynpro framework. It is not recommended to call this method using warnings or success messages.
Parameters:
element - is a reference to the context node element containing the invalid attribute
attribute - is the attribute info of the attribute which is invalid
messageItem - is the message associated with the context attribute
args - are the arguments for the message parameters in the same way as used in @see java.text.MessageFormat
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this message. This applies only for messages of type error. For all other message types this parameter is ignored. (see also cancelNavigation()).

reportContextAttributeMessage

public void reportContextAttributeMessage(IWDNodeElement element,
                                          IWDAttributeInfo attribute,
                                          IWDMessage messageItem,
                                          java.lang.Object[] args,
                                          boolean cancelNavigation)
Report a message item caused for the given context attribute value. In case the message item is an error, this method returns and may be called as often as necessary.
Parameters:
element - is a reference to the context node element containing the invalid attribute
attribute - is the attribute info of the attribute which is invalid
messageItem - is the message associated with the context attribute
args - are the arguments for the message parameters in the same way as used in @see java.text.MessageFormat
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this message. Tihs applies only for messages of type error. For all other message types this parameter is ignored. (see also cancelNavigation()).

raiseMessage

public void raiseMessage(IWDMessage messageItem,
                         java.lang.Object[] args,
                         boolean cancelNavigation)
Raises a message for the given context attribute value. This method internally raises a Runtime exception and execution is continued in the Web Dynpro framework. It is not recommended to call this method with warnings and success messages.
Parameters:
messageItem - is the message associated with the context attribute
args - are the arguments for the message parameters in the same way as used in @see java.text.MessageFormat
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this message. This applies only for messages of type error. For all other message types this parameter is ignored. (see also cancelNavigation()).

reportMessage

public void reportMessage(IWDMessage messageItem,
                          java.lang.Object[] args,
                          boolean cancelNavigation)
Report a message item caused by an invalid context attribute value. In case the message item is an error, this method returns and may be called as often as necessary.
Parameters:
messageItem - is the message associated with the context attribute
args - are the arguments for the message parameters in the same way as used in @see java.text.MessageFormat
cancelNavigation: - set this parameter to true, if all navigation steps should be canceled due to this message. This applies only for messages of type error. For all other message types this parameter is ignored. (see also cancelNavigation()).

raisePendingException

public void raisePendingException()
This method checks if any exceptions were reported to the exception manager and are still stored in the exceptions manager. In case there is at least one exception still stored, this method does not return, but . raises some framework internal exception instead in order to return to the framework error handler.

cancelNavigation

public void cancelNavigation()
This methods cancels all subsequent navigational steps for the current request/ response cycle. Since Web Dynpro processes the navigational links in a queued manner the first inbound plug is called after all outbound plugs are called (as long as an outbound plug is not called from within an inbound plug). Calling this methods subpresses the processing of the outbound plugs. The queue of called plugs is resetted after the request / response cycle. Navigation has to be reinitiated for the next request (Eventhandler). Note: Navigation is not only canceled for the component calling this method, but for the entire application!

hasExceptions

public boolean hasExceptions()
Returns true if no exception was reported yet.
Returns:
true if no exception was reported yet

isEmpty

public boolean isEmpty()
Returns true if no exception, warning, info or success message is stored.
Returns:
true if no exception was reported yet

contains

public boolean contains(IWDMessage messageItem)
Ask for a specific message in the message managers queue.
Returns:
true if message messageItem is currently pending in the message queue.

Web Dynpro API Documentation

Copyright © 2004 SAP AG. Automatically generated Thu Mar 3 2005, 22:15