com.webmethods.caf.faces.data.export
Class AtomExportBean

java.lang.Object
  extended by com.webmethods.caf.faces.data.export.AtomExportBean
All Implemented Interfaces:
IFileExportBean, IFileExportBeanEx

public class AtomExportBean
extends Object
implements IFileExportBeanEx

Writes the content of an ITableContentProvider as an atom feed. The ITableContentProvider must specify the list of available columns via its IContentProvider.getPropertyKeys() method.


Field Summary
protected  boolean m_downloadForced
          True to force file download dialog.
protected  ITableContentProvider m_entriesProvider
          Export entries content provider.
protected  String m_exportCharacterEncoding
          Export character encoding.
protected  String m_exportFileName
          Default filename in file download dialog.
protected  IContentProvider m_feedProvider
          Export feed content provider.
 
Fields inherited from interface com.webmethods.caf.faces.bean.IFileExportBean
UNKNOWN_CONTENT_LENGTH
 
Constructor Summary
AtomExportBean()
           
AtomExportBean(IContentProvider feedProvider, ITableContentProvider entriesProvider)
           
AtomExportBean(IContentProvider feedProvider, ITableContentProvider entriesProvider, String exportFileName)
           
 
Method Summary
 ITableContentProvider getEntriesProvider()
           
 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
 IContentProvider getFeedProvider()
           
 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 setDownloadForced(boolean value)
           
 void setEntriesProvider(ITableContentProvider value)
           
 void setExportCharacterEncoding(String value)
           
 void setExportFileName(String value)
           
 void setFeedProvider(IContentProvider 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

m_downloadForced

protected boolean m_downloadForced
True to force file download dialog.


m_exportFileName

protected String m_exportFileName
Default filename in file download dialog.


m_exportCharacterEncoding

protected String m_exportCharacterEncoding
Export character encoding.


m_feedProvider

protected IContentProvider m_feedProvider
Export feed content provider.


m_entriesProvider

protected ITableContentProvider m_entriesProvider
Export entries content provider.

Constructor Detail

AtomExportBean

public AtomExportBean()

AtomExportBean

public AtomExportBean(IContentProvider feedProvider,
                      ITableContentProvider entriesProvider)

AtomExportBean

public AtomExportBean(IContentProvider feedProvider,
                      ITableContentProvider entriesProvider,
                      String exportFileName)
Method Detail

isDownloadForced

public boolean isDownloadForced()
Description copied from interface: IFileExportBean
Return true to send the response headers that will force the user to choose what to do with the file (Open vs. Save).

Specified by:
isDownloadForced in interface IFileExportBean
Returns:
true to force a download

getExportFileName

public String getExportFileName()
Description copied from interface: IFileExportBean
Return the file name for the exported data

Specified by:
getExportFileName in interface IFileExportBean
Returns:
file name for the exported file

getExportContentType

public String getExportContentType()
Description copied from interface: IFileExportBean
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.

Specified by:
getExportContentType in interface IFileExportBean
Returns:
content type of the exported content

getExportContentLength

public int getExportContentLength()
Description copied from interface: IFileExportBean
Return the length of the content that is to be exported.

Specified by:
getExportContentLength in interface IFileExportBean
Returns:
the length of the content or return IFileExportBean.UNKNOWN_CONTENT_LENGTH if it is not known

isExportBinary

public boolean isExportBinary()
Description copied from interface: IFileExportBean
Return true if the export will be sending binary data to the response, false if the export will be sending text.

Specified by:
isExportBinary in interface IFileExportBean
Returns:
true for binary export, false for text

writeExportText

public void writeExportText(PrintWriter writer)
Description copied from interface: IFileExportBean
Invoked to allow the bean to write the export text to the output writer.

Specified by:
writeExportText in interface IFileExportBean
Parameters:
writer - the output writer

writeExportBytes

public void writeExportBytes(OutputStream outStream)
                      throws IOException
Description copied from interface: IFileExportBean
Invoked to allow the bean to write binary data to the output stream.

Specified by:
writeExportBytes in interface IFileExportBean
Parameters:
outStream - the output stream
Throws:
IOException - thrown if there is an I/O exception during the export

setDownloadForced

public void setDownloadForced(boolean value)

setExportFileName

public void setExportFileName(String value)

getExportCharacterEncoding

public String getExportCharacterEncoding()
Description copied from interface: IFileExportBeanEx
Returns character encoding for this export file content (valid only when isExportBinary() == false)

Specified by:
getExportCharacterEncoding in interface IFileExportBeanEx
Returns:
java character encoding name

setExportCharacterEncoding

public void setExportCharacterEncoding(String value)

getFeedProvider

public IContentProvider getFeedProvider()

setFeedProvider

public void setFeedProvider(IContentProvider value)

getEntriesProvider

public ITableContentProvider getEntriesProvider()

setEntriesProvider

public void setEntriesProvider(ITableContentProvider value)