public final class ExportUtils extends Object
Utilities used when exporting data.
Modifier and Type | Field and Description |
---|---|
static String |
DDL_DT_REQUESTATTR_EXPORT_CONF
Request attributes
|
static String |
DDL_DT_REQUESTATTR_EXPORT_CONTENT |
static String |
DDL_DT_REQUESTPARAM_EXPORT_AUTOSIZE |
static String |
DDL_DT_REQUESTPARAM_EXPORT_EXTENSION |
static String |
DDL_DT_REQUESTPARAM_EXPORT_FORMAT |
static String |
DDL_DT_REQUESTPARAM_EXPORT_HEADER |
static String |
DDL_DT_REQUESTPARAM_EXPORT_ID |
static String |
DDL_DT_REQUESTPARAM_EXPORT_IN_PROGRESS
Request parameters
|
static String |
DDL_DT_REQUESTPARAM_EXPORT_MIME_TYPE |
static String |
DDL_DT_REQUESTPARAM_EXPORT_NAME |
static String |
DDL_DT_REQUESTPARAM_EXPORT_ORIENTATION |
static String |
DDL_DT_REQUESTPARAM_EXPORT_TYPE |
Modifier and Type | Method and Description |
---|---|
static String |
getCurrentExportType(javax.servlet.http.HttpServletRequest request) |
static Boolean |
isTableBeingExported(javax.servlet.ServletRequest servletRequest,
HtmlTable table)
Check whether the table if being exported using the request
DDL_DT_REQUESTPARAM_EXPORT_ID attribute. |
static void |
renderExport(HtmlTable table,
ExportConf exportConf,
javax.servlet.http.HttpServletResponse response)
Renders the passed table by writing the data to the response.
|
static void |
writeToResponse(javax.servlet.http.HttpServletResponse response,
ByteArrayOutputStream baos,
String title,
String contentType)
Write the given temporary OutputStream to the HTTP response as an
Attachment with the given title.
|
public static final String DDL_DT_REQUESTATTR_EXPORT_CONF
public static final String DDL_DT_REQUESTATTR_EXPORT_CONTENT
public static final String DDL_DT_REQUESTPARAM_EXPORT_IN_PROGRESS
public static final String DDL_DT_REQUESTPARAM_EXPORT_TYPE
public static final String DDL_DT_REQUESTPARAM_EXPORT_ID
public static final String DDL_DT_REQUESTPARAM_EXPORT_FORMAT
public static final String DDL_DT_REQUESTPARAM_EXPORT_ORIENTATION
public static final String DDL_DT_REQUESTPARAM_EXPORT_HEADER
public static final String DDL_DT_REQUESTPARAM_EXPORT_MIME_TYPE
public static final String DDL_DT_REQUESTPARAM_EXPORT_EXTENSION
public static final String DDL_DT_REQUESTPARAM_EXPORT_NAME
public static final String DDL_DT_REQUESTPARAM_EXPORT_AUTOSIZE
public static void renderExport(HtmlTable table, ExportConf exportConf, javax.servlet.http.HttpServletResponse response)
table
- The table to export.exportConf
- The export configuration (e.g. the export class to use).response
- The response to update.public static void writeToResponse(javax.servlet.http.HttpServletResponse response, ByteArrayOutputStream baos, String title, String contentType) throws IOException
response
- current HTTP responsebaos
- the temporary OutputStream to writetitle
- the title of the attachmentcontentType
- the MIME typeIOException
- if writing/flushing failedpublic static String getCurrentExportType(javax.servlet.http.HttpServletRequest request)
public static Boolean isTableBeingExported(javax.servlet.ServletRequest servletRequest, HtmlTable table)
Check whether the table if being exported using the request
DDL_DT_REQUESTPARAM_EXPORT_ID
attribute.
The table's id must be tested in case of multiple tables are displayed on the same page and exportable.
Copyright © 2013–2015 Dandelion Project. All rights reserved.