Class CopyFileReport

All Implemented Interfaces:
Selectable<Report>, Comparable<Report>

public class CopyFileReport extends Report
This report will copy a file from your file system into the namespace of the internal Patchworks web server. When you save the scenario the file will also be saved out in to the scenario folder.

You can use this report to include data, css, image or other files that you would like to refer to from the HTML sections of other reports.

If you do not want this file to show up in the index listings then add it to the report writer using the ReportWriter.addHiddenReport(ca.spatial.reportwriter.Report) method.

The Report Writer already creates a folder named 'html' to store images, javascript sources and css. This is a good location to use to store other miscellaneous files. For example:

r = new CopyFileReport("html/logo.png", "My logo", "C:/logos/mylogo.png");
This will make the logo file that is stored in your local file system available within the report writer.
  • Field Details

    • TYPES

      public static final String[] TYPES
  • Constructor Details

    • CopyFileReport

      public CopyFileReport(String filename, String title, String file)
      Create a CopyFileReport object
      filename - The name to be given to the report within the ReportWriter
      title - The title of the report
      file - The filename of the existing file to be copied
  • Method Details

    • getCopyFile

      public String getCopyFile()
      Return the name of the file that is being copied.
    • getLength

      public long getLength(String filename, HashMap param)
    • doReport

      public ca.spatial.reportwriter.Report.DataCache doReport(String filename, PrintStream out, Map<String,​Object> param, ca.spatial.reportwriter.Report.DataCache cache)
      Description copied from class: Report
      The method used by the report writer to format the requested report. This method is implemented in every custom report. Application programs generally do not need to call this method, but instead use the report writer methods to obtain reports.
      Specified by:
      doReport in class Report
      filename - The full name of the report to be printed, including the extension of the sub-report (if any).
      out - The output stream to print output on to.
      param - A HashMap containing parameters that modify the report (for example the scenario name).
    • getTypes

      public String[] getTypes()
      Description copied from class: Report
      An accessor function to retrieve the list of report types supported by this report. See the documentation for the TYPES variable for the list of sub-types.
      Specified by:
      getTypes in class Report