org.pentaho.platform.engine.services
Class MessageFormatter
java.lang.Object
  
org.pentaho.platform.engine.services.MessageFormatter
- All Implemented Interfaces: 
 - IMessageFormatter
 
public class MessageFormatter
- extends Object
- implements IMessageFormatter
  
 
 
| 
Method Summary | 
 void | 
formatErrorMessage(String mimeType,
                   String title,
                   List messages,
                   StringBuffer messageBuffer)
 
            | 
 void | 
formatErrorMessage(String mimeType,
                   String title,
                   String message,
                   StringBuffer messageBuffer)
 
            | 
 void | 
formatExceptionMessage(String mimeType,
                       ActionSequenceException exception,
                       StringBuffer messageBuffer)
 
            | 
 void | 
formatFailureMessage(String mimeType,
                     IRuntimeContext context,
                     StringBuffer messageBuffer)
 
            | 
 void | 
formatFailureMessage(String mimeType,
                     IRuntimeContext context,
                     StringBuffer messageBuffer,
                     List defaultMessages)
 
            | 
 void | 
formatResultSetAsHTMLRows(org.pentaho.commons.connection.IPentahoResultSet resultSet,
                          StringBuffer messageBuffer)
 
            | 
 void | 
formatSuccessMessage(String mimeType,
                     IRuntimeContext context,
                     StringBuffer messageBuffer,
                     boolean doMessages)
 
            | 
 void | 
formatSuccessMessage(String mimeType,
                     IRuntimeContext context,
                     StringBuffer messageBuffer,
                     boolean doMessages,
                     boolean doWrapper)
 
            | 
 String | 
getFirstError(List messages)
 
          If PentahoMessenger.getUserString("ERROR") returns the string:
 "Error: {0} ({1})" (which is the case for English)
 Find the substring before the first "{". | 
 
 
HTML_MIME_TYPE
public static final String HTML_MIME_TYPE
- See Also:
 - Constant Field Values
 
TEXT_MIME_TYPE
public static final String TEXT_MIME_TYPE
- See Also:
 - Constant Field Values
 
MAX_RESULT_THRESHOLD
public static final int MAX_RESULT_THRESHOLD
- See Also:
 - Constant Field Values
 
MessageFormatter
public MessageFormatter()
formatErrorMessage
public void formatErrorMessage(String mimeType,
                               String title,
                               String message,
                               StringBuffer messageBuffer)
- Specified by:
 formatErrorMessage in interface IMessageFormatter
 
 
getFirstError
public String getFirstError(List messages)
- If PentahoMessenger.getUserString("ERROR") returns the string:
 "Error: {0} ({1})" (which is the case for English)
 Find the substring before the first "{". In this case, that 
 would be: "Error: ".
 Return the first string in the messages list that contains
 the string "Error: ". If no string in the list contains
 "Error: ", return null;
- Specified by:
 getFirstError in interface IMessageFormatter
 
- Parameters:
 messages - 
- Returns:
 
 
 
formatErrorMessage
public void formatErrorMessage(String mimeType,
                               String title,
                               List messages,
                               StringBuffer messageBuffer)
- Specified by:
 formatErrorMessage in interface IMessageFormatter
 
 
formatFailureMessage
public void formatFailureMessage(String mimeType,
                                 IRuntimeContext context,
                                 StringBuffer messageBuffer,
                                 List defaultMessages)
- Specified by:
 formatFailureMessage in interface IMessageFormatter
 
 
formatExceptionMessage
public void formatExceptionMessage(String mimeType,
                                   ActionSequenceException exception,
                                   StringBuffer messageBuffer)
 
 
formatFailureMessage
public void formatFailureMessage(String mimeType,
                                 IRuntimeContext context,
                                 StringBuffer messageBuffer)
- Specified by:
 formatFailureMessage in interface IMessageFormatter
 
 
formatResultSetAsHTMLRows
public void formatResultSetAsHTMLRows(org.pentaho.commons.connection.IPentahoResultSet resultSet,
                                      StringBuffer messageBuffer)
- Specified by:
 formatResultSetAsHTMLRows in interface IMessageFormatter
 
 
formatSuccessMessage
public void formatSuccessMessage(String mimeType,
                                 IRuntimeContext context,
                                 StringBuffer messageBuffer,
                                 boolean doMessages)
- Specified by:
 formatSuccessMessage in interface IMessageFormatter
 
 
formatSuccessMessage
public void formatSuccessMessage(String mimeType,
                                 IRuntimeContext context,
                                 StringBuffer messageBuffer,
                                 boolean doMessages,
                                 boolean doWrapper)
- Specified by:
 formatSuccessMessage in interface IMessageFormatter