Interface I_CmsReport

All Known Implementing Classes:
A_CmsReport, CmsHtmlReport, CmsLogReport, CmsMultiplexReport, CmsPrintStreamReport, CmsPublishReport, CmsShellLogReport, CmsShellReport, CmsStringBufferReport, CmsWorkplaceReport

public interface I_CmsReport
This is the interface for the report classes which are used for the output during operations that run on a spearate Thread in OpenCms, like publish, import, export etc.

Since:
6.0.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Indicates default formatting.
    static final int
    Indicates error formatting.
    static final int
    Indicates headline formatting.
    static final int
    Indicates note formatting.
    static final int
    Indicates OK formatting.
    static final int
    Indicates warning formatting.
    static final String
    Request parameter value that this report should create an "extended" output.
    static final String
    Request parameter value that this report should create a "simple" output.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an error object to the list of errors that occurred during the report.
    void
    Adds a warning object to the list of warnings that occurred during the report.
    Formats the runtime formatted as "hh:mm:ss".
    Returns a list of all errors that occurred during the report.
    long
    Returns the time of last report entry.
    Returns the locale this report was initialized with.
    Updates this report, this processes all new output added since the last call to this method.
    Fetches the report update for this report since the last time this method was called.
    long
    Returns the time this report has been running.
    Returns the original site root of the user who started this report, or null if the original site root has not been set.
    Returns a list of all warnings that occurred during the report.
    boolean
    Returns if the report generated an error output.
    boolean
    Returns if the report generated a warning output.
    void
    Prints a localized message to the report.
    void
    print(CmsMessageContainer container, int format)
    Prints a localized message to the report, using the indicated formatting.
    void
    Adds a line break to the report.
    void
    Adds an Exception to the report, ensuring that the Exception content is processed to generate a valid output esp.
    void
    Prints a localized message to the report.
    void
    println(CmsMessageContainer container, int format)
    Prints a localized message to the report, using the indicated formatting.
    void
    printMessageWithParam(int m, int n, CmsMessageContainer container, Object param)
    Convenience method to print a localized message, followed by a parameter and dots to the report.
    void
    Prints a localized message followed by a parametera and dots to the report.
    removeSiteRoot(String resourcename)
    Removes the report site root prefix from the absolute path in the resource name, that is adjusts the resource name for the report site root.
    void
    Resets the runtime to 0 milliseconds.
  • Field Details

  • Method Details

    • addError

      void addError(Object obj)
      Adds an error object to the list of errors that occurred during the report.

      Parameters:
      obj - the error object
    • addWarning

      void addWarning(Object obj)
      Adds a warning object to the list of warnings that occurred during the report.

      Parameters:
      obj - the error object
    • formatRuntime

      Formats the runtime formatted as "hh:mm:ss".

      Returns:
      the runtime formatted as "hh:mm:ss"
    • getErrors

      Returns a list of all errors that occurred during the report.

      Returns:
      an error list that occurred during the report
    • getLastEntryTime

      Returns the time of last report entry.

      Will return zero if no entry has been written.

      Returns:
      time of last report entry
    • getLocale

      Returns the locale this report was initialized with.

      Returns:
      the locale this report was initialized with
    • getReportUpdate

      Updates this report, this processes all new output added since the last call to this method.

      This is only required in case the output is written to a HTML page, if the shell output is used, this will just return an empty String.

      Returns:
      new elements that have been added to the report and not yet processed.
    • getReportUpdate

      Fetches the report update for this report since the last time this method was called.

      Parameters:
      formatter - the formatter to use for formatting the report output
      Returns:
      the output for report elements that have been added to the report and not yet processed
    • getRuntime

      long getRuntime()
      Returns the time this report has been running.

      Returns:
      the time this report has been running
    • getSiteRoot

      Returns the original site root of the user who started this report, or null if the original site root has not been set.

      Returns:
      the original site root of the user who started this report
    • getWarnings

      Returns a list of all warnings that occurred during the report.

      Returns:
      a warning list that occurred during the report
    • hasError

      boolean hasError()
      Returns if the report generated an error output.

      Returns:
      true if the report generated an error, otherwise false
    • hasWarning

      boolean hasWarning()
      Returns if the report generated a warning output.

      Returns:
      true if the report generated a warning, otherwise false
    • print

      void print(CmsMessageContainer container)
      Prints a localized message to the report.

      Parameters:
      container - the String to add
    • print

      void print(CmsMessageContainer container, int format)
      Prints a localized message to the report, using the indicated formatting.

      Use the contants starting with FORMAT from this interface to indicate which formatting to use.

      Parameters:
      container - the String to add
      format - the formatting to use for the output
    • println

      void println()
      Adds a line break to the report.

    • println

      void println(CmsMessageContainer container)
      Prints a localized message to the report.

      Parameters:
      container - the message container to add
    • println

      void println(CmsMessageContainer container, int format)
      Prints a localized message to the report, using the indicated formatting.

      Use the contants starting with FORMAT from this interface to indicate which formatting to use.

      Parameters:
      container - the message container to add
      format - the formatting to use for the output
    • println

      void println(Throwable t)
      Adds an Exception to the report, ensuring that the Exception content is processed to generate a valid output esp. for HTML pages.

      The exception will be stored and the output will later be processed in a special way.

      Parameters:
      t - the exception to add
    • printMessageWithParam

      Prints a localized message followed by a parametera and dots to the report.

      Parameters:
      container - the Message to add
      param - the Parameter to add
    • printMessageWithParam

      void printMessageWithParam(int m, int n, CmsMessageContainer container, Object param)
      Convenience method to print a localized message, followed by a parameter and dots to the report.

      The output follows the pattern: ( 3 / 8 ) Deleting filename.txt ...

      Parameters:
      m - the number of the report output
      n - the total number of report outputs
      container - the Message to add
      param - the Parameter to add
    • removeSiteRoot

      String removeSiteRoot(String resourcename)
      Removes the report site root prefix from the absolute path in the resource name, that is adjusts the resource name for the report site root.

      If the site root for this report has not been set, or the resource name does not start with the report site root, the name it is left untouched.

      Parameters:
      resourcename - the resource name (full path)
      Returns:
      the resource name adjusted for the report site root
      See Also:
    • resetRuntime

      void resetRuntime()
      Resets the runtime to 0 milliseconds.