Web Dynpro API Documentation

com.sap.tc.webdynpro.progmodel.api
Class WDMessage

java.lang.Object
  |
  +--com.sap.tc.webdynpro.progmodel.api.WDMessage
All Implemented Interfaces:
IWDMessage

public class WDMessage
extends java.lang.Object
implements IWDMessage

Base class for all kinds of messages used in conjunction with the Web Dynpro message manager.

The message manager exposes APIs for reporting exceptions, warnings and success messages. There are 2 categories of methods. First there exists simple String based methods, where one can simply report messages by passing a parameter of type string. This string is used as the message text without any Web Dynpro services involved. Second there are methods that accept a WDMessage instance. This instance contains necessary information for additional Web Dynpro services like CATT, Help, etc.

The typical usage of WDMessage is as enumeration type.
public class MyMessages extends WDMessage { public static final IWDMessage WARNING_TABLE_CELL = new WDMessage( "com.sap.test.IMessageTest" , "WarningTableCell", WDMessageType.WARNING); public static final IWDMessage DATE_IS_IN_FUTURE = new WDMessage( "com.sap.test.IMessageTest" , "DateIsInFuture", WDMessageType.ERROR); public static final IWDMessage DESIRED_E_MAIL = new WDMessage( "com.sap.test.IMessageTest" , "DesiredEMail", WDMessageType.WARNING); public static final IWDMessage MISSING_INPUT = new WDMessage( "com.sap.test.IMessageTest" , "MissingInput", WDMessageType.ERROR); public static final IWDMessage SOME_SUCCESS_MESSAGE = new WDMessage( "com.sap.test.IMessageTest" , "SomeSuccessMessage", WDMessageType.STANDARD); In a later call to IWDMessageManager one may just use this enumeration value combined with optional parameters. Parameters are combined with the message text in the same way as for MessageFormat:

IWDMessageManager ex = wdThis.wdGetAPI().getComponent().getMessageManager(); ex.reportMessage(MyComponentMessages.Message1, new Object[] {"Some Parameter"} ); ex.reportMessage(MyComponentMessages.Message2, null );

Version:
$Id: //tc/WebDynproRuntime/630_VAL_REL/src/_webdynpro_progmodel/java/com/sap/tc/webdynpro/progmodel/api/WDMessage.java#2 $

Constructor Summary
WDMessage(IWDComponent comp, java.lang.String msgKey, WDMessageType type, java.lang.String message)
          Create an instance of a message item.
WDMessage(java.lang.String compName, java.lang.String msgKey, WDMessageType type)
           
 
Method Summary
 java.lang.String getCompName()
           
 java.lang.String getMessageKey()
          Method getMessageKey.
 java.lang.String getMessageText()
          Get the human readable display text for this message.
 WDMessageType getType()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WDMessage

public WDMessage(java.lang.String compName,
                 java.lang.String msgKey,
                 WDMessageType type)

WDMessage

public WDMessage(IWDComponent comp,
                 java.lang.String msgKey,
                 WDMessageType type,
                 java.lang.String message)
Create an instance of a message item. This method is using parameter message as human readable text for display in the message area. The parameter key must be an language independent message key used for eCATT recording or xml clients.

NOTE: this methode does not use parameter key as a key in any resource bundle, but assume that the user of this method guarantees that key is unique language neutral description for message

Parameters:
comp - is the componenten this message belongs to.
msgKey - is the key of this message.
type - is the type of this message.
Message - is the human readable message text,
Method Detail

getMessageKey

public final java.lang.String getMessageKey()
Method getMessageKey.
Returns:
the key of this item's message

getMessageText

public final java.lang.String getMessageText()
Get the human readable display text for this message. This may be null. In that case use
Returns:
the message text or null
See Also:
as key in the components resource bundle.

getCompName

public final java.lang.String getCompName()
Returns:
the component name this message belongs to.

getType

public WDMessageType getType()
Returns:
the type of this message.

Web Dynpro API Documentation

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