Package org.opencms.report
Class A_CmsReport
java.lang.Object
org.opencms.report.A_CmsReport
- All Implemented Interfaces:
I_CmsReport
- Direct Known Subclasses:
CmsHtmlReport
,CmsLogReport
,CmsMultiplexReport
,CmsStringBufferReport
,CmsWorkplaceReport
Base report class.
- Since:
- 6.0.0
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an error object to the list of errors that occurred during the report.void
addWarning
(Object obj) 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.protected CmsMessages
Returns the default report message bundle.getReportUpdate
(I_CmsReportUpdateFormatter formatter) 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, ornull
if the original site root has not been set.Returns a list of all warnings that occurred during the report.boolean
hasError()
Returns if the report generated an error output.boolean
Returns if the report generated a warning output.protected void
Initializes some member variables for this report.protected void
Prints a String to the report.protected abstract void
Prints a String to the report, using the indicated formatting.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.protected void
Prints a String with line break to the report.protected void
Prints a String with line break to the report, using the indicated formatting.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, Object param) Convenience method to print a localized message, followed by a parameter and dots to the report.void
printMessageWithParam
(CmsMessageContainer container, Object param) 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.protected void
setLastEntryTime
(long time) Sets the time of the last report entry.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.report.I_CmsReport
getReportUpdate, println, println
-
Constructor Details
-
A_CmsReport
public A_CmsReport()
-
-
Method Details
-
addError
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
- Parameters:
obj
- the error object- See Also:
-
addWarning
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
- Parameters:
obj
- the error object- See Also:
-
formatRuntime
Description copied from interface:I_CmsReport
Formats the runtime formatted as "hh:mm:ss".- Specified by:
formatRuntime
in interfaceI_CmsReport
- Returns:
- the runtime formatted as "hh:mm:ss"
- See Also:
-
getErrors
Description copied from interface:I_CmsReport
Returns a list of all errors that occurred during the report.- Specified by:
getErrors
in interfaceI_CmsReport
- Returns:
- an error list that occurred during the report
- See Also:
-
getLastEntryTime
Description copied from interface:I_CmsReport
Returns the time of last report entry.Will return zero if no entry has been written.
- Specified by:
getLastEntryTime
in interfaceI_CmsReport
- Returns:
- time of last report entry
- See Also:
-
getLocale
Description copied from interface:I_CmsReport
Returns the locale this report was initialized with.- Specified by:
getLocale
in interfaceI_CmsReport
- Returns:
- the locale this report was initialized with
- See Also:
-
getReportUpdate
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
- 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:
-
getRuntime
Description copied from interface:I_CmsReport
Returns the time this report has been running.- Specified by:
getRuntime
in interfaceI_CmsReport
- Returns:
- the time this report has been running
- See Also:
-
getSiteRoot
Returns the original site root of the user who started this report, ornull
if the original site root has not been set.- Specified by:
getSiteRoot
in interfaceI_CmsReport
- Returns:
- the original site root of the user who started this report
-
getWarnings
Description copied from interface:I_CmsReport
Returns a list of all warnings that occurred during the report.- Specified by:
getWarnings
in interfaceI_CmsReport
- Returns:
- a warning list that occurred during the report
- See Also:
-
hasError
Description copied from interface:I_CmsReport
Returns if the report generated an error output.- Specified by:
hasError
in interfaceI_CmsReport
- Returns:
- true if the report generated an error, otherwise false
- See Also:
-
hasWarning
Description copied from interface:I_CmsReport
Returns if the report generated a warning output.- Specified by:
hasWarning
in interfaceI_CmsReport
- Returns:
- true if the report generated a warning, otherwise false
- See Also:
-
print
Description copied from interface:I_CmsReport
Prints a localized message to the report.- Specified by:
print
in interfaceI_CmsReport
- Parameters:
container
- the String to add- See Also:
-
print
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
- Parameters:
container
- the String to addformat
- the formatting to use for the output- See Also:
-
println
Description copied from interface:I_CmsReport
Prints a localized message to the report.- Specified by:
println
in interfaceI_CmsReport
- Parameters:
container
- the message container to add- See Also:
-
println
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
- Parameters:
container
- the message container to addformat
- the formatting to use for the output- See Also:
-
printMessageWithParam
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
- Parameters:
container
- the Message to addparam
- the Parameter to add- See Also:
-
printMessageWithParam
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
- Parameters:
m
- the number of the report outputn
- the total number of report outputscontainer
- the Message to addparam
- the Parameter to add- See Also:
-
removeSiteRoot
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.
- Specified by:
removeSiteRoot
in interfaceI_CmsReport
- Parameters:
resourcename
- the resource name (full path)- Returns:
- the resource name adjusted for the report site root
- See Also:
-
resetRuntime
Description copied from interface:I_CmsReport
Resets the runtime to 0 milliseconds.- Specified by:
resetRuntime
in interfaceI_CmsReport
- See Also:
-
getMessages
Returns the default report message bundle.- Returns:
- the default report message bundle
-
init
Initializes some member variables for this report.- Parameters:
locale
- the locale for this reportsiteRoot
- the site root of the user who started this report (may benull
)
-
print
Prints a String to the report.- Parameters:
value
- the String to add
-
print
Prints a String to the report, using the indicated formatting.Use the constants starting with
FORMAT
from this interface to indicate which formatting to use.- Parameters:
value
- the message container to addformat
- the formatting to use for the output
-
println
Prints a String with line break to the report.- Parameters:
value
- the message container to add
-
println
Prints a String with line break to the report, using the indicated formatting.Use the constants starting with
C_FORMAT
from this interface to indicate which formatting to use.- Parameters:
value
- the String to addformat
- the formatting to use for the output
-
setLastEntryTime
Sets the time of the last report entry.- Parameters:
time
- the time of the actual entry
-