Module org.apache.wicket.extensions
Class AbstractDataExporter
java.lang.Object
org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractDataExporter
- All Implemented Interfaces:
Serializable
,IDataExporter
,IClusterable
- Direct Known Subclasses:
CSVDataExporter
An abstract helper implementation of
IDataExporter
.- Author:
- Jesse Long
- See Also:
-
Constructor Summary
ConstructorDescriptionAbstractDataExporter
(IModel<String> dataFormatNameModel, String contentType, String fileNameExtension) Creates a new instance with the data format name model, content type and file name extensions provided. -
Method Summary
Modifier and TypeMethodDescriptionReturns the MIME content type of the export data type.Returns a model of the exported data format name.Returns the file name extensions for the exported data, without the ".".setContentType
(String contentType) Sets the MIME contentType for the data export format.setDataFormatNameModel
(IModel<String> dataFormatNameModel) Sets the data format name model.setFileNameExtension
(String fileNameExtension) Sets the file name extension to be used in the exported file name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.wicket.extensions.markup.html.repeater.data.table.export.IDataExporter
exportData
-
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 theExportToolbar
.- Specified by:
getDataFormatNameModel
in interfaceIDataExporter
- 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 interfaceIDataExporter
- 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 interfaceIDataExporter
- 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
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.
-