Class AbstractDataExporter

    • Constructor Detail

      • AbstractDataExporter

        public AbstractDataExporter​(org.apache.wicket.model.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 Detail

      • getDataFormatNameModel

        public org.apache.wicket.model.IModel<StringgetDataFormatNameModel()
        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

        public String 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

        public String 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

        public AbstractDataExporter setContentType​(String contentType)
        Sets the MIME contentType for the data export format.
        Parameters:
        contentType - The MIME contentType for the data export format.
        Returns:
        this, for chaining.
      • setDataFormatNameModel

        public AbstractDataExporter setDataFormatNameModel​(org.apache.wicket.model.IModel<String> dataFormatNameModel)
        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.