Class MessageFormatter

  • All Implemented Interfaces:
    org.pentaho.platform.api.engine.IMessageFormatter

    public class MessageFormatter
    extends Object
    implements org.pentaho.platform.api.engine.IMessageFormatter
    • Constructor Detail

      • MessageFormatter

        public MessageFormatter()
    • Method Detail

      • formatErrorMessage

        public void formatErrorMessage​(String mimeType,
                                       String title,
                                       String message,
                                       StringBuffer messageBuffer)
        Specified by:
        formatErrorMessage in interface org.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 interface org.pentaho.platform.api.engine.IMessageFormatter
        Parameters:
        messages -
        Returns:
      • formatErrorMessage

        public void formatErrorMessage​(String mimeType,
                                       String title,
                                       List messages,
                                       StringBuffer messageBuffer)
        Specified by:
        formatErrorMessage in interface org.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 interface org.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 interface org.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 interface org.pentaho.platform.api.engine.IMessageFormatter
      • formatResultSetAsHTMLRows

        public void formatResultSetAsHTMLRows​(org.pentaho.commons.connection.IPentahoResultSet resultSet,
                                              StringBuffer messageBuffer)
        Specified by:
        formatResultSetAsHTMLRows in interface org.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 interface org.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 interface org.pentaho.platform.api.engine.IMessageFormatter