public class ExportActionHelper extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ExportActionHelper.IExportFileHandler |
Modifier and Type | Field and Description |
---|---|
static String |
PARAM_CHARACTER_ENCODING |
static String |
PARAM_FILE_NAME |
static String |
PARAM_FORCE_DOWNLOAD |
static String |
PARAM_SETTINGS |
static String |
PARAM_TARGET |
static String |
PARAM_TYPE |
static String |
PARAM_VIEW |
static Pattern |
RE_ADD_BOM |
Constructor and Description |
---|
ExportActionHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
exportControl(FacesContext context,
UIComponent target,
UIComponent settings,
String type,
String characterEncoding,
String fileName,
String forceDownload)
Exports the specified target control,
optionally using the settings specified by the settings control.
|
static void |
exportFile(FacesContext context,
IFileExportBean exportBean)
Exports the specified file.
|
static void |
registerExportFileHandler(ExportActionHelper.IExportFileHandler handler,
boolean highPriority) |
public static final String PARAM_VIEW
public static final String PARAM_TARGET
public static final String PARAM_SETTINGS
public static final String PARAM_TYPE
public static final String PARAM_CHARACTER_ENCODING
public static final String PARAM_FILE_NAME
public static final String PARAM_FORCE_DOWNLOAD
public static Pattern RE_ADD_BOM
public static void registerExportFileHandler(ExportActionHelper.IExportFileHandler handler, boolean highPriority)
public static void exportControl(FacesContext context, UIComponent target, UIComponent settings, String type, String characterEncoding, String fileName, String forceDownload)
context
- Current faces context.target
- Control to export.settings
- Control with export settings.type
- Type of export (ie "csv" or "atom").characterEncoding
- Optional export character encoding.fileName
- Optional export file name.forceDownload
- Optional forceDownload setting:
"true" to force, "false" to allow display in browser; null if no default.public static void exportFile(FacesContext context, IFileExportBean exportBean)
context
- Current faces context.exportBean
- File to export.