com.webmethods.caf.faces.bean
Interface IFileExportBean

All Known Subinterfaces:
IFileExportBeanEx
All Known Implementing Classes:
AtomExportBean, CSVExportBean, FileContentExportBean, JcrFileExportBean, JcrFileVersionExportBean, SimpleFileExportBean, URLContentExportBean

public interface IFileExportBean

Action Handlers that wish to export a file to the user can pass an instance of this interface to the BaseViewBean.streamFileDataToResponse(IFileExportBean) API.


Field Summary
static int UNKNOWN_CONTENT_LENGTH
          Use this constant for the export content length when the length is not known
 
Method Summary
 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 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.
 

Field Detail

UNKNOWN_CONTENT_LENGTH

static final int UNKNOWN_CONTENT_LENGTH
Use this constant for the export content length when the length is not known

See Also:
Constant Field Values
Method Detail

isDownloadForced

boolean isDownloadForced()
Return true to send the response headers that will force the user to choose what to do with the file (Open vs. Save).

Returns:
true to force a download

getExportFileName

String getExportFileName()
Return the file name for the exported data

Returns:
file name for the exported file

getExportContentType

String getExportContentType()
Gets the content type of the response being sent to the client. The content type may include the type of character encoding used, for example, text/html; charset=ISO-8859-4.

Returns:
content type of the exported content

getExportContentLength

int getExportContentLength()
Return the length of the content that is to be exported.

Returns:
the length of the content or return IFileExportBean.UNKNOWN_CONTENT_LENGTH if it is not known

isExportBinary

boolean isExportBinary()
Return true if the export will be sending binary data to the response, false if the export will be sending text.

Returns:
true for binary export, false for text

writeExportText

void writeExportText(PrintWriter writer)
Invoked to allow the bean to write the export text to the output writer.

Parameters:
writer - the output writer

writeExportBytes

void writeExportBytes(OutputStream outStream)
                      throws IOException
Invoked to allow the bean to write binary data to the output stream.

Parameters:
outStream - the output stream
Throws:
IOException - thrown if there is an I/O exception during the export