Package org.opencms.publish
Class CmsPublishReport
- java.lang.Object
-
- org.opencms.report.A_CmsReport
-
- org.opencms.report.CmsHtmlReport
-
- org.opencms.report.CmsPrintStreamReport
-
- org.opencms.publish.CmsPublishReport
-
- All Implemented Interfaces:
I_CmsReport
public class CmsPublishReport extends CmsPrintStreamReport
Report class used for the publish operations.It stores nothing. It just prints everything to a temporary file.
- Since:
- 6.5.5
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.ByteArrayOutputStream
m_outputStream
The output stream.-
Fields inherited from class org.opencms.report.CmsHtmlReport
LINEBREAK, LINEBREAK_TRADITIONAL
-
Fields inherited from interface org.opencms.report.I_CmsReport
FORMAT_DEFAULT, FORMAT_ERROR, FORMAT_HEADLINE, FORMAT_NOTE, FORMAT_OK, FORMAT_WARNING, REPORT_TYPE_EXTENDED, REPORT_TYPE_SIMPLE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmsPublishReport(java.util.Locale locale)
Constructs a new publish report using the provided locale for the output language.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(java.lang.Object obj)
Adds an error object to the list of errors that occurred during the report.void
addWarning(java.lang.Object obj)
Adds a warning object to the list of warnings that occurred during the report.protected static CmsPrintStreamReport
decorate(I_CmsReport report)
Returns a publish report instance that writes to the given report as well as to the given temporary file.byte[]
getContents()
Returns the contents of the publish report as byte array.java.util.List<java.lang.Object>
getErrors()
Returns a list of all errors that occurred during the report.java.lang.String
getReportUpdate()
Updates this report, this processes all new output added since the last call to this method.java.lang.String
getReportUpdate(I_CmsReportUpdateFormatter formatter)
Fetches the report update for this report since the last time this method was called.java.util.List<java.lang.Object>
getWarnings()
Returns a list of all warnings that occurred during the report.void
print(CmsMessageContainer container)
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
println()
Adds a line break to the report.void
println(java.lang.Throwable t)
Adds an Exception to the report, ensuring that the Exception content is processed to generate a valid output esp.void
println(CmsMessageContainer container)
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, java.lang.Object param)
Convenience method to print a localized message, followed by a parameter and dots to the report.void
printMessageWithParam(CmsMessageContainer container, java.lang.Object param)
Prints a localized message followed by a parametera and dots to the report.void
resetRuntime()
Resets the runtime to 0 milliseconds.-
Methods inherited from class org.opencms.report.CmsPrintStreamReport
close, finish, getLineBreak, print, start
-
Methods inherited from class org.opencms.report.CmsHtmlReport
isWriteHtml
-
Methods inherited from class org.opencms.report.A_CmsReport
formatRuntime, getLastEntryTime, getLocale, getMessages, getRuntime, getSiteRoot, hasError, hasWarning, init, print, println, println, removeSiteRoot, setLastEntryTime
-
-
-
-
Field Detail
-
m_outputStream
protected java.io.ByteArrayOutputStream m_outputStream
The output stream.
-
-
Constructor Detail
-
CmsPublishReport
protected CmsPublishReport(java.util.Locale locale)
Constructs a new publish report using the provided locale for the output language.- Parameters:
locale
- the locale to use for the output language
-
-
Method Detail
-
decorate
protected static CmsPrintStreamReport decorate(I_CmsReport report)
Returns a publish report instance that writes to the given report as well as to the given temporary file.- Parameters:
report
- the report to decorate- Returns:
- the publish report
-
addError
public void addError(java.lang.Object obj)
Description copied from interface:I_CmsReport
Adds an error object to the list of errors that occurred during the report.- Specified by:
addError
in interfaceI_CmsReport
- Overrides:
addError
in classA_CmsReport
- Parameters:
obj
- the error object- See Also:
A_CmsReport.addError(java.lang.Object)
-
addWarning
public void addWarning(java.lang.Object obj)
Description copied from interface:I_CmsReport
Adds a warning object to the list of warnings that occurred during the report.- Specified by:
addWarning
in interfaceI_CmsReport
- Overrides:
addWarning
in classA_CmsReport
- Parameters:
obj
- the error object- See Also:
A_CmsReport.addWarning(java.lang.Object)
-
getContents
public byte[] getContents()
Returns the contents of the publish report as byte array.- Returns:
- the contents of the publish report
-
getErrors
public java.util.List<java.lang.Object> getErrors()
Description copied from interface:I_CmsReport
Returns a list of all errors that occurred during the report.- Specified by:
getErrors
in interfaceI_CmsReport
- Overrides:
getErrors
in classA_CmsReport
- Returns:
- an error list that occurred during the report
- See Also:
A_CmsReport.getErrors()
-
getReportUpdate
public java.lang.String getReportUpdate()
Description copied from interface:I_CmsReport
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.
- Specified by:
getReportUpdate
in interfaceI_CmsReport
- Overrides:
getReportUpdate
in classCmsPrintStreamReport
- Returns:
- new elements that have been added to the report and not yet processed.
- See Also:
CmsPrintStreamReport.getReportUpdate()
-
getReportUpdate
public java.lang.String getReportUpdate(I_CmsReportUpdateFormatter formatter)
Description copied from interface:I_CmsReport
Fetches the report update for this report since the last time this method was called.- Specified by:
getReportUpdate
in interfaceI_CmsReport
- Overrides:
getReportUpdate
in classA_CmsReport
- 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
- See Also:
A_CmsReport.getReportUpdate(org.opencms.report.I_CmsReportUpdateFormatter)
-
getWarnings
public java.util.List<java.lang.Object> getWarnings()
Description copied from interface:I_CmsReport
Returns a list of all warnings that occurred during the report.- Specified by:
getWarnings
in interfaceI_CmsReport
- Overrides:
getWarnings
in classA_CmsReport
- Returns:
- a warning list that occurred during the report
- See Also:
A_CmsReport.getWarnings()
-
print
public void print(CmsMessageContainer container)
Description copied from interface:I_CmsReport
Prints a localized message to the report.- Specified by:
print
in interfaceI_CmsReport
- Overrides:
print
in classA_CmsReport
- Parameters:
container
- the String to add- See Also:
A_CmsReport.print(org.opencms.i18n.CmsMessageContainer)
-
print
public void print(CmsMessageContainer container, int format)
Description copied from interface:I_CmsReport
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.- Specified by:
print
in interfaceI_CmsReport
- Overrides:
print
in classA_CmsReport
- Parameters:
container
- the String to addformat
- the formatting to use for the output- See Also:
A_CmsReport.print(org.opencms.i18n.CmsMessageContainer, int)
-
println
public void println()
Description copied from interface:I_CmsReport
Adds a line break to the report.- Specified by:
println
in interfaceI_CmsReport
- Overrides:
println
in classCmsPrintStreamReport
- See Also:
CmsPrintStreamReport.println()
-
println
public void println(CmsMessageContainer container)
Description copied from interface:I_CmsReport
Prints a localized message to the report.- Specified by:
println
in interfaceI_CmsReport
- Overrides:
println
in classA_CmsReport
- Parameters:
container
- the message container to add- See Also:
A_CmsReport.println(org.opencms.i18n.CmsMessageContainer)
-
println
public void println(CmsMessageContainer container, int format)
Description copied from interface:I_CmsReport
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.- Specified by:
println
in interfaceI_CmsReport
- Overrides:
println
in classA_CmsReport
- Parameters:
container
- the message container to addformat
- the formatting to use for the output- See Also:
A_CmsReport.println(org.opencms.i18n.CmsMessageContainer, int)
-
println
public void println(java.lang.Throwable t)
Description copied from interface:I_CmsReport
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.
- Specified by:
println
in interfaceI_CmsReport
- Overrides:
println
in classCmsPrintStreamReport
- Parameters:
t
- the exception to add- See Also:
CmsPrintStreamReport.println(java.lang.Throwable)
-
printMessageWithParam
public void printMessageWithParam(CmsMessageContainer container, java.lang.Object param)
Description copied from interface:I_CmsReport
Prints a localized message followed by a parametera and dots to the report.- Specified by:
printMessageWithParam
in interfaceI_CmsReport
- Overrides:
printMessageWithParam
in classA_CmsReport
- Parameters:
container
- the Message to addparam
- the Parameter to add- See Also:
A_CmsReport.printMessageWithParam(org.opencms.i18n.CmsMessageContainer, java.lang.Object)
-
printMessageWithParam
public void printMessageWithParam(int m, int n, CmsMessageContainer container, java.lang.Object param)
Description copied from interface:I_CmsReport
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 ...
- Specified by:
printMessageWithParam
in interfaceI_CmsReport
- Overrides:
printMessageWithParam
in classA_CmsReport
- Parameters:
m
- the number of the report outputn
- the total number of report outputscontainer
- the Message to addparam
- the Parameter to add- See Also:
A_CmsReport.printMessageWithParam(int, int, org.opencms.i18n.CmsMessageContainer, java.lang.Object)
-
resetRuntime
public void resetRuntime()
Description copied from interface:I_CmsReport
Resets the runtime to 0 milliseconds.- Specified by:
resetRuntime
in interfaceI_CmsReport
- Overrides:
resetRuntime
in classA_CmsReport
- See Also:
A_CmsReport.resetRuntime()
-
-