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

java.lang.Object
  extended by com.webmethods.caf.faces.data.export.AtomFeedTableExportProvider
All Implemented Interfaces:
IContentProvider, IUpdateableContentProvider

public class AtomFeedTableExportProvider
extends Object
implements IContentProvider, IUpdateableContentProvider

Adapts a UIData component to an IContentProvider, specialized for exporting as atom (syndication feed) entries. The specialization includes generating an id, title, subtitle, author, links, base uri, and language info.


Field Summary
protected  ResponseWriter m_responseBuffer
          Temporary buffer into which the content of each column is rendered.
protected  StringWriter m_responseBufferBackingWriter
          Backing buffer for the m_responseBuffer.
protected  UIData m_table
          Table providing export content.
protected  Map m_values
          Property values cache.
 
Constructor Summary
AtomFeedTableExportProvider()
           
AtomFeedTableExportProvider(UIData table)
           
 
Method Summary
protected  String clearResponseBuffer()
          Clears the temporary response buffer, returning its content (or "").
 Object[] getPropertyKeys()
          Returns list of properties supported by this content provider.
protected  ResponseWriter getResponseBuffer()
          Temporary response buffer.
 UIData getTable()
           
 Class getType(Object propertyKey)
          Returns java type of the given property
 Object getValue(Object propertyKey)
          Returns value of the given property
protected  Map getValues()
           
 boolean hasProperty(Object propertyKey)
          Checks if the given property is supported by this content provider
 boolean isReadOnly(Object propertyKey)
          Returns true if the given property is readonly.
 void refresh()
           
protected  String render(UIComponent component)
          Renders specified component, returning its content (or "").
 void setTable(UIData table)
           
 void setValue(Object propertyKey, Object value)
          Sets new value of the given property
 String toString()
          Returns string representation of content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_table

protected UIData m_table
Table providing export content.


m_values

protected Map m_values
Property values cache.


m_responseBuffer

protected ResponseWriter m_responseBuffer
Temporary buffer into which the content of each column is rendered.


m_responseBufferBackingWriter

protected StringWriter m_responseBufferBackingWriter
Backing buffer for the m_responseBuffer.

Constructor Detail

AtomFeedTableExportProvider

public AtomFeedTableExportProvider()

AtomFeedTableExportProvider

public AtomFeedTableExportProvider(UIData table)
Method Detail

toString

public String toString()
Description copied from interface: IContentProvider
Returns string representation of content.

Specified by:
toString in interface IContentProvider
Overrides:
toString in class Object
Returns:
String representation of the wrapped content

getPropertyKeys

public Object[] getPropertyKeys()
Description copied from interface: IContentProvider
Returns list of properties supported by this content provider. Can return Object[0], never null.

Specified by:
getPropertyKeys in interface IContentProvider
Returns:
array of property keys which is typically of type String or Integer

getType

public Class getType(Object propertyKey)
              throws PropertyNotFoundException
Description copied from interface: IContentProvider
Returns java type of the given property

Specified by:
getType in interface IContentProvider
Parameters:
propertyKey - the property key of type String or Integer
Returns:
property java Class
Throws:
PropertyNotFoundException - if property is not supported

getValue

public Object getValue(Object propertyKey)
                throws EvaluationException,
                       PropertyNotFoundException
Description copied from interface: IContentProvider
Returns value of the given property

Specified by:
getValue in interface IContentProvider
Parameters:
propertyKey - the property key of type String or Integer
Returns:
value of the property, can be null
Throws:
EvaluationException - if error during property evaluation
PropertyNotFoundException - if property is not supported

hasProperty

public boolean hasProperty(Object propertyKey)
Description copied from interface: IContentProvider
Checks if the given property is supported by this content provider

Specified by:
hasProperty in interface IContentProvider
Parameters:
propertyKey - property key of type String or Integer
Returns:
true if property is supported

isReadOnly

public boolean isReadOnly(Object propertyKey)
                   throws EvaluationException,
                          PropertyNotFoundException
Description copied from interface: IUpdateableContentProvider

Returns true if the given property is readonly. If it is readonly, IUpdateableContentProvider.setValue(Object, Object) will definitely fail.

Specified by:
isReadOnly in interface IUpdateableContentProvider
Parameters:
propertyKey - property key of type String or Integer
Returns:
true if the property is readonly
Throws:
EvaluationException
PropertyNotFoundException

setValue

public void setValue(Object propertyKey,
                     Object value)
              throws EvaluationException,
                     PropertyNotFoundException
Description copied from interface: IUpdateableContentProvider

Sets new value of the given property

Specified by:
setValue in interface IUpdateableContentProvider
Parameters:
propertyKey - property key of type String or Integer
value - new property value
Throws:
EvaluationException - if error happens during property assigment
PropertyNotFoundException - if property is not found

refresh

public void refresh()
             throws ContentProviderException
Throws:
ContentProviderException

getTable

public UIData getTable()

setTable

public void setTable(UIData table)

getValues

protected Map getValues()

render

protected String render(UIComponent component)
Renders specified component, returning its content (or "").


getResponseBuffer

protected ResponseWriter getResponseBuffer()
Temporary response buffer.


clearResponseBuffer

protected String clearResponseBuffer()
Clears the temporary response buffer, returning its content (or "").