java.lang.Object
org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractDataExporter
All Implemented Interfaces:
Serializable, IDataExporter, IClusterable
Direct Known Subclasses:
CSVDataExporter

public abstract class AbstractDataExporter extends Object implements IDataExporter
An abstract helper implementation of IDataExporter.
Author:
Jesse Long
See Also:
  • Constructor Details

    • AbstractDataExporter

      public AbstractDataExporter(IModel<String> dataFormatNameModel, String contentType, String fileNameExtension)
      Creates a new instance with the data format name model, content type and file name extensions provided.
      Parameters:
      dataFormatNameModel - The model of the exported data format name.
      contentType - The MIME content type of the exported data type.
      fileNameExtension - The file name extensions to use in the file name for the exported data.
  • Method Details

    • getDataFormatNameModel

      Returns a model of the exported data format name. This should be something like "CSV" or "Excel" etc. The value of the model returned is displayed as the export type in the ExportToolbar.
      Specified by:
      getDataFormatNameModel in interface IDataExporter
      Returns:
      a model of the exported data format name.
    • getContentType

      Returns the MIME content type of the export data type. This could be something like "text/csv". This is used to provide the correct content type when downloading the exported data.
      Specified by:
      getContentType in interface IDataExporter
      Returns:
      the MIME content type of the export data type.
    • getFileNameExtension

      Returns the file name extensions for the exported data, without the ".". For CSV, this should be "csv". For Excel exports, this should be "xls".
      Specified by:
      getFileNameExtension in interface IDataExporter
      Returns:
      the file name extensions for the exported data, without the ".".
    • setContentType

      Sets the MIME contentType for the data export format.
      Parameters:
      contentType - The MIME contentType for the data export format.
      Returns:
      this, for chaining.
    • setDataFormatNameModel

      Sets the data format name model.
      Parameters:
      dataFormatNameModel - the data format name model.
      Returns:
      this, for chaining.
    • setFileNameExtension

      public AbstractDataExporter setFileNameExtension(String fileNameExtension)
      Sets the file name extension to be used in the exported file name.
      Parameters:
      fileNameExtension - the file name extension to be used in the exported file name.
      Returns:
      this, for chaining.