|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.faces.data.export.CSVExportBean
public class CSVExportBean
Writes the content of an ITableContentProvider
as a csv file.
The ITableContentProvider must specify the list of available columns
via its IContentProvider.getPropertyKeys()
method.
Field Summary | |
---|---|
protected ITableContentProvider |
m_contentProvider
Export content provider. |
protected boolean |
m_downloadForced
True to force file download dialog. |
protected String |
m_exportCharacterEncoding
Export character encoding. |
protected String |
m_exportFileName
Default filename in file download dialog. |
protected Pattern |
RE_REPLACE_QUOTES
|
protected Pattern |
RE_SHOULD_ESCAPE
|
Fields inherited from interface com.webmethods.caf.faces.bean.IFileExportBean |
---|
UNKNOWN_CONTENT_LENGTH |
Constructor Summary | |
---|---|
CSVExportBean()
|
|
CSVExportBean(ITableContentProvider contentProvider)
|
|
CSVExportBean(ITableContentProvider contentProvider,
String exportFileName)
|
Method Summary | |
---|---|
protected String |
escapeValue(Object o)
Converts the specified object to a string and escapes it as a csv field value. |
ITableContentProvider |
getContentProvider()
|
String |
getExportCharacterEncoding()
Returns character encoding for this export file content (valid only when isExportBinary() == false) |
int |
getExportContentLength()
Return the length of the content that is to be exported. |
String |
getExportContentType()
Gets the content type of the response being sent to the client. |
String |
getExportFileName()
Return the file name for the exported data |
boolean |
isDownloadForced()
Return true to send the response headers that will force the user to choose what to do with the file (Open vs. |
boolean |
isExportBinary()
Return true if the export will be sending binary data to the response, false if the export will be sending text. |
void |
setContentProvider(ITableContentProvider value)
|
void |
setDownloadForced(boolean value)
|
void |
setExportCharacterEncoding(String value)
|
void |
setExportFileName(String value)
|
void |
writeExportBytes(OutputStream outStream)
Invoked to allow the bean to write binary data to the output stream. |
void |
writeExportText(PrintWriter writer)
Invoked to allow the bean to write the export text to the output writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Pattern RE_SHOULD_ESCAPE
protected Pattern RE_REPLACE_QUOTES
protected boolean m_downloadForced
protected String m_exportFileName
protected String m_exportCharacterEncoding
protected ITableContentProvider m_contentProvider
Constructor Detail |
---|
public CSVExportBean()
public CSVExportBean(ITableContentProvider contentProvider)
public CSVExportBean(ITableContentProvider contentProvider, String exportFileName)
Method Detail |
---|
public boolean isDownloadForced()
IFileExportBean
isDownloadForced
in interface IFileExportBean
public String getExportFileName()
IFileExportBean
getExportFileName
in interface IFileExportBean
public String getExportContentType()
IFileExportBean
getExportContentType
in interface IFileExportBean
public int getExportContentLength()
IFileExportBean
getExportContentLength
in interface IFileExportBean
IFileExportBean.UNKNOWN_CONTENT_LENGTH
if it is not knownpublic boolean isExportBinary()
IFileExportBean
isExportBinary
in interface IFileExportBean
public void writeExportText(PrintWriter writer)
IFileExportBean
writeExportText
in interface IFileExportBean
writer
- the output writerpublic void writeExportBytes(OutputStream outStream) throws IOException
IFileExportBean
writeExportBytes
in interface IFileExportBean
outStream
- the output stream
IOException
- thrown if there is an I/O exception during the exportprotected String escapeValue(Object o)
public void setDownloadForced(boolean value)
public void setExportFileName(String value)
public String getExportCharacterEncoding()
IFileExportBeanEx
getExportCharacterEncoding
in interface IFileExportBeanEx
public void setExportCharacterEncoding(String value)
public ITableContentProvider getContentProvider()
public void setContentProvider(ITableContentProvider value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |