org.pentaho.platform.engine.services
Class MessageFormatter

java.lang.Object
  extended by org.pentaho.platform.engine.services.MessageFormatter
All Implemented Interfaces:
IMessageFormatter

public class MessageFormatter
extends Object
implements IMessageFormatter


Field Summary
static String HTML_MIME_TYPE
           
static int MAX_RESULT_THRESHOLD
           
static String TEXT_MIME_TYPE
           
 
Constructor Summary
MessageFormatter()
           
 
Method Summary
 void formatErrorMessage(String mimeType, String title, List messages, StringBuffer messageBuffer)
           
 void formatErrorMessage(String mimeType, String title, String message, StringBuffer messageBuffer)
           
 void formatFailureMessage(String mimeType, IRuntimeContext context, StringBuffer messageBuffer)
           
 void formatFailureMessage(String mimeType, IRuntimeContext context, StringBuffer messageBuffer, List defaultMessages)
           
 void formatResultSetAsHTMLRows(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 "{".
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

MessageFormatter

public MessageFormatter()
Method Detail

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

formatFailureMessage

public void formatFailureMessage(String mimeType,
                                 IRuntimeContext context,
                                 StringBuffer messageBuffer)
Specified by:
formatFailureMessage in interface IMessageFormatter

formatResultSetAsHTMLRows

public void formatResultSetAsHTMLRows(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