Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.opencms.report
Class CmsHtmlReport  view CmsHtmlReport download CmsHtmlReport.java

java.lang.Object
  extended bycom.opencms.report.CmsHtmlReport
All Implemented Interfaces:
I_CmsReport

public class CmsHtmlReport
extends java.lang.Object
implements I_CmsReport

HTML report output to be used for import / export / publish operations in the entire OpenCms system.

Since:
5.0 rc 1
Version:
$Revision: 1.8 $

Field Summary
private static java.lang.String C_LINEBREAK
          Constant for a HTML linebreak with added "real" line break)
private  java.util.List m_content
          The list of report objects e.g.
private  boolean m_hasBrokenLinks
          Flag to indicate if broken links have been reported
private  int m_indexNext
          Counter to remember what is already shown, indicates the next index of the m_content list that has to be reported
private  com.opencms.flex.util.CmsMessages m_messages
          Localized message access object
private  boolean m_showExceptionStackTracke
          Flag to indicate if exception should be displayed long or short
 
Fields inherited from interface com.opencms.report.I_CmsReport
C_BUNDLE_NAME, C_FORMAT_DEFAULT, C_FORMAT_HEADLINE, C_FORMAT_NOTE, C_FORMAT_OK, C_FORMAT_WARNING
 
Constructor Summary
CmsHtmlReport(java.lang.String locale)
          Constructs a new report using the provided locale for the output language.
 
Method Summary
private  java.lang.String convertChars(java.lang.String value)
          Converts chars and removes linebreaks from a String.
private  java.lang.StringBuffer getExceptionElement(java.lang.Throwable throwable)
          Output helper method to format a reported Throwable element.
private  java.lang.StringBuffer getLinkElement(java.lang.String link)
          Output helper method to format a reported CmsPageLinks element.
private  java.lang.StringBuffer getLinkTargetElement(java.lang.String target)
          Output helper method to format a reported CmsPageLinks element.
 java.lang.String getReportUpdate()
          Updates this report, this processes all new output added since the last call to this method.
 boolean hasBrokenLinks()
          Returns true if broken links where reported, false otherwise.
 java.lang.String key(java.lang.String keyName)
          Gets the localized resource string for a given message key.
 void print(java.lang.String value)
          Prints a String to the report.
 void print(java.lang.String value, int format)
          Prints a String to the report, using the indicated formatting.
 void println()
          Adds a line break to the report.
 void println(com.opencms.linkmanagement.CmsPageLinks value)
          Adds a CmsPageLinks object to the report
 void println(java.lang.String value)
          Prints a String with line break to the report.
 void println(java.lang.String value, int format)
          Prints a String with line break to the report, using the indicated formatting.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C_LINEBREAK

private static final java.lang.String C_LINEBREAK
Constant for a HTML linebreak with added "real" line break)

See Also:
Constant Field Values

m_messages

private com.opencms.flex.util.CmsMessages m_messages
Localized message access object


m_content

private java.util.List m_content
The list of report objects e.g. String, CmsPageLink, Exception ...


m_indexNext

private int m_indexNext
Counter to remember what is already shown, indicates the next index of the m_content list that has to be reported


m_hasBrokenLinks

private boolean m_hasBrokenLinks
Flag to indicate if broken links have been reported


m_showExceptionStackTracke

private boolean m_showExceptionStackTracke
Flag to indicate if exception should be displayed long or short

Constructor Detail

CmsHtmlReport

public CmsHtmlReport(java.lang.String locale)
Constructs a new report using the provided locale for the output language.

Method Detail

println

public void println()
Description copied from interface: I_CmsReport
Adds a line break to the report.

Specified by:
println in interface I_CmsReport

print

public void print(java.lang.String value)
Description copied from interface: I_CmsReport
Prints a String to the report.

Specified by:
print in interface I_CmsReport

println

public void println(java.lang.String value)
Description copied from interface: I_CmsReport
Prints a String with line break to the report.

Specified by:
println in interface I_CmsReport

print

public void print(java.lang.String value,
                  int format)
Description copied from interface: I_CmsReport
Prints a String to the report, using the indicated formatting.

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

Specified by:
print in interface I_CmsReport

println

public void println(java.lang.String value,
                    int format)
Description copied from interface: I_CmsReport
Prints a String with line break to the report, using the indicated formatting.

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

Specified by:
println in interface I_CmsReport

println

public void println(com.opencms.linkmanagement.CmsPageLinks value)
Description copied from interface: I_CmsReport
Adds a CmsPageLinks object to the report

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

Specified by:
println in interface I_CmsReport

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 interface I_CmsReport

convertChars

private java.lang.String convertChars(java.lang.String value)
Converts chars and removes linebreaks from a String.


getExceptionElement

private java.lang.StringBuffer getExceptionElement(java.lang.Throwable throwable)
Output helper method to format a reported Throwable element.

This method ensures that exception stack traces are properly escaped when they are added to the report.

There is a member variable m_showExceptionStackTracke 55 in this class that controls if the stack track is shown or not. In a later version this might be configurable on a per-user basis.


getLinkElement

private java.lang.StringBuffer getLinkElement(java.lang.String link)
Output helper method to format a reported CmsPageLinks element.

This method formats the link source.


getLinkTargetElement

private java.lang.StringBuffer getLinkTargetElement(java.lang.String target)
Output helper method to format a reported CmsPageLinks element.

This method formats the link targets.


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 interface I_CmsReport

hasBrokenLinks

public boolean hasBrokenLinks()
Description copied from interface: I_CmsReport
Returns true if broken links where reported, false otherwise.

Open links where reported if at last one link was added to the report using the I_CmsReport.println(CmsPageLinks) 55 method.

Specified by:
hasBrokenLinks in interface I_CmsReport

key

public java.lang.String key(java.lang.String keyName)
Description copied from interface: I_CmsReport
Gets the localized resource string for a given message key.

The internal implementation should be passing the keyName to the class com.opencms.flex.util.CmsMessages.

Specified by:
key in interface I_CmsReport