HtmlSC allows for different output formats.

Iteration
Filled

Description

HtmlSC allows for different output formats:

  • formats (HTML and text) and

  • destinations (file and console)

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)
        }
    }
  1. initialize the report, e.g. create and open the file, copy css-, javascript and image files.
  2. create the overall summary, with the overall success percentage and a list of all checked pages with their success rate.
  3. iterate over all pages
  4. write report footer - in HTML report also create back-to-top-link
  5. for a single page, report the nr of checks and problems plus the success rate
  6. for every singleCheck on that page, report a summary and
  7. all detailed findings for a singleCheck.
  8. for every checked page, create a footer, pagebreak or similar to graphically distringuish pages between each other.