public class CSVTag
extends javax.servlet.jsp.tagext.BodyTagSupport
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CSV_DOWNLOAD_URI |
Constructor and Description |
---|
CSVTag() |
Modifier and Type | Method and Description |
---|---|
int |
doEndTag()
$
|
int |
doStartTag()
$
|
java.lang.String |
getExportColumns() |
java.lang.String |
getHeader() |
java.lang.String |
getUniqueName()
Build the list's unique name Algorithm for the unique name is: Take the
CRC value of the following string: request url + ";" + name
|
java.lang.String |
makeCSVRequestParams()
Creates the request parameter string needed to pass info to the action
handling the CSV exporting.
|
void |
release()
$
|
void |
setDataset(java.lang.String nameIn)
Sets the name of the dataset to use Tries to locate the list in the
following order: page context, request attribute, session attribute
|
void |
setExportColumns(java.lang.String exportIn) |
void |
setHeader(java.lang.String headerIn)
Header is a string to go on the top of a CSV exported file,
can be used to provide extra info to a user.
|
void |
setName(java.lang.String nameIn)
Stores the "name" of the list.
|
void |
setupPageData() |
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
public static final java.lang.String CSV_DOWNLOAD_URI
public void setName(java.lang.String nameIn)
nameIn
- list namepublic java.lang.String getUniqueName()
public void setHeader(java.lang.String headerIn)
headerIn
- optional text to be printed as first line of exported CSV filepublic java.lang.String getHeader()
public void setDataset(java.lang.String nameIn) throws javax.servlet.jsp.JspException
nameIn
- name of datasetjavax.servlet.jsp.JspException
- indicates something went wrongpublic void setupPageData() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
- exception raised if datasetname is not
definedpublic java.lang.String getExportColumns()
public void setExportColumns(java.lang.String exportIn)
exportIn
- The export to set.public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
public void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.BodyTagSupport
public java.lang.String makeCSVRequestParams()