HtmlSC allows for different output formats.
Description
HtmlSC allows for different output formats:
The reporting subsystem uses the template method pattern to allow different output formats (e.g. Console and HTML). The overall structure of reports is always the same:
Graphical clients can use the API of the reporting subsystem to display reports in arbitrary formats.
The (generic and abstract) reporting is implemented in the abstract Reporter class as follows:
/**
* main entry point for reporting - to be called when a report is requested
* Uses template-method to delegate concrete implementations to subclasses
*/
public void reportFindings() {
initReport() (1)
reportOverallSummary() (2)
reportAllPages() (3)
closeReport() (4)
}
//
private void reportAllPages() {
pageResults.each { pageResult ->
reportPageSummary( pageResult ) (5)
pageResult.singleCheckResults.each { resultForOneCheck ->
reportSingleCheckSummary( resultForOneCheck ) (6)
reportSingleCheckDetails( resultForOneCheck ) (7)
reportPageFooter() (8)
}
}
- initialize the report, e.g. create and open the file, copy css-, javascript and image files.
- create the overall summary, with the overall success percentage and a list of all checked pages with their success rate.
- iterate over all pages
- write report footer - in HTML report also create back-to-top-link
- for a single page, report the nr of checks and problems plus the success rate
- for every singleCheck on that page, report a summary and
- all detailed findings for a singleCheck.
- for every checked page, create a footer, pagebreak or similar to graphically distringuish pages between each other.