Class MessageFormatter
- java.lang.Object
-
- org.pentaho.platform.engine.services.MessageFormatter
-
- All Implemented Interfaces:
org.pentaho.platform.api.engine.IMessageFormatter
public class MessageFormatter extends Object implements org.pentaho.platform.api.engine.IMessageFormatter
-
-
Field Summary
Fields Modifier and Type Field Description static String
HTML_MIME_TYPE
static int
MAX_RESULT_THRESHOLD
static String
TEXT_MIME_TYPE
-
Constructor Summary
Constructors Constructor Description MessageFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
formatErrorMessage(String mimeType, String title, String message, StringBuffer messageBuffer)
void
formatErrorMessage(String mimeType, String title, List messages, StringBuffer messageBuffer)
void
formatExceptionMessage(String mimeType, org.pentaho.platform.api.engine.ActionSequenceException exception, StringBuffer messageBuffer)
void
formatExceptionMessage(String mimeType, org.pentaho.platform.api.engine.ActionSequenceException exception, StringBuffer messageBuffer, boolean showStacktrace)
void
formatFailureMessage(String mimeType, org.pentaho.platform.api.engine.IRuntimeContext context, StringBuffer messageBuffer)
void
formatFailureMessage(String mimeType, org.pentaho.platform.api.engine.IRuntimeContext context, StringBuffer messageBuffer, List defaultMessages)
void
formatFailureMessage(String mimeType, org.pentaho.platform.api.engine.IRuntimeContext context, StringBuffer messageBuffer, List defaultMessages, boolean showStacktrace)
void
formatResultSetAsHTMLRows(org.pentaho.commons.connection.IPentahoResultSet resultSet, StringBuffer messageBuffer)
void
formatSuccessMessage(String mimeType, org.pentaho.platform.api.engine.IRuntimeContext context, StringBuffer messageBuffer, boolean doMessages)
void
formatSuccessMessage(String mimeType, org.pentaho.platform.api.engine.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 "{".
-
-
-
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
-
-
Method Detail
-
formatErrorMessage
public void formatErrorMessage(String mimeType, String title, String message, StringBuffer messageBuffer)
- Specified by:
formatErrorMessage
in interfaceorg.pentaho.platform.api.engine.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 interfaceorg.pentaho.platform.api.engine.IMessageFormatter
- Parameters:
messages
-- Returns:
-
formatErrorMessage
public void formatErrorMessage(String mimeType, String title, List messages, StringBuffer messageBuffer)
- Specified by:
formatErrorMessage
in interfaceorg.pentaho.platform.api.engine.IMessageFormatter
-
formatFailureMessage
public void formatFailureMessage(String mimeType, org.pentaho.platform.api.engine.IRuntimeContext context, StringBuffer messageBuffer, List defaultMessages)
- Specified by:
formatFailureMessage
in interfaceorg.pentaho.platform.api.engine.IMessageFormatter
-
formatFailureMessage
public void formatFailureMessage(String mimeType, org.pentaho.platform.api.engine.IRuntimeContext context, StringBuffer messageBuffer, List defaultMessages, boolean showStacktrace)
- Specified by:
formatFailureMessage
in interfaceorg.pentaho.platform.api.engine.IMessageFormatter
-
formatExceptionMessage
public void formatExceptionMessage(String mimeType, org.pentaho.platform.api.engine.ActionSequenceException exception, StringBuffer messageBuffer)
-
formatExceptionMessage
public void formatExceptionMessage(String mimeType, org.pentaho.platform.api.engine.ActionSequenceException exception, StringBuffer messageBuffer, boolean showStacktrace)
-
formatFailureMessage
public void formatFailureMessage(String mimeType, org.pentaho.platform.api.engine.IRuntimeContext context, StringBuffer messageBuffer)
- Specified by:
formatFailureMessage
in interfaceorg.pentaho.platform.api.engine.IMessageFormatter
-
formatResultSetAsHTMLRows
public void formatResultSetAsHTMLRows(org.pentaho.commons.connection.IPentahoResultSet resultSet, StringBuffer messageBuffer)
- Specified by:
formatResultSetAsHTMLRows
in interfaceorg.pentaho.platform.api.engine.IMessageFormatter
-
formatSuccessMessage
public void formatSuccessMessage(String mimeType, org.pentaho.platform.api.engine.IRuntimeContext context, StringBuffer messageBuffer, boolean doMessages)
- Specified by:
formatSuccessMessage
in interfaceorg.pentaho.platform.api.engine.IMessageFormatter
-
formatSuccessMessage
public void formatSuccessMessage(String mimeType, org.pentaho.platform.api.engine.IRuntimeContext context, StringBuffer messageBuffer, boolean doMessages, boolean doWrapper)
- Specified by:
formatSuccessMessage
in interfaceorg.pentaho.platform.api.engine.IMessageFormatter
-
-