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

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

public class AtomFeedExportProvider
extends BoundPropertiesContentProvider

Provider, specialized for atom data, which limits a wrapped provider to exposing a specified set of properties; the properties are specified via binding expressions. The specialization includes optionally generating author, links, base uri, and language info.

Consumers should specify at least the following properties:

author
Name of entity who authored this feed.
id
URI which uniquely identifies this feed. Should be an absolute uri (ex: "http://example.org/my-feed").
title
Feed title (in the current locale).

Consumers may also specify following standard atom properties:

category
List of keywords (aka tags) which apply to this feed.
contributor
List of the names of additional contributors to this feed.
icon
URL of a small icon that represents this feed.
link
List of links to resources related to this feed.
logo
URL of a medium-sized image that represents this feed.
rights
Textual description of the intellectual property rights to the content of this feed (in the current locale).
subtitle
Feed subtitle (in the current locale).
updated
Last updated date of this feed.


Field Summary
protected  Object[] m_aggregatePropertyKeys
          Aggregate bound properties keys and autogenerated keys.
protected  Map m_autogeneratedValues
          Autogenerated property values cache.
 
Fields inherited from class com.webmethods.caf.faces.data.object.BoundPropertiesContentProvider
m_keys, m_provider, m_var
 
Constructor Summary
AtomFeedExportProvider()
          Blank provider.
AtomFeedExportProvider(IContentProvider provider, Map keys, String var)
          Provider limiting specified provider to specified keys.
 
Method Summary
protected  Map getAutogeneratedValues()
           
 Object[] getPropertyKeys()
          Returns list of properties supported by this content provider.
 Class getType(Object propertyKey)
          Returns java type of the given property
 Object getValue(Object propertyKey)
          Returns value of the given property
 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 setValue(Object propertyKey, Object value)
          Sets new value of the given property
 
Methods inherited from class com.webmethods.caf.faces.data.object.BoundPropertiesContentProvider
createDefaultKeys, getKeys, getProvider, getVar, setKeys, setProvider, setVar, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_aggregatePropertyKeys

protected Object[] m_aggregatePropertyKeys
Aggregate bound properties keys and autogenerated keys.


m_autogeneratedValues

protected Map m_autogeneratedValues
Autogenerated property values cache.

Constructor Detail

AtomFeedExportProvider

public AtomFeedExportProvider()
Blank provider. Must be initialized with BoundPropertiesContentProvider.setProvider(com.webmethods.caf.faces.data.IContentProvider), BoundPropertiesContentProvider.setKeys(java.util.Map), and BoundPropertiesContentProvider.setVar(java.lang.String).


AtomFeedExportProvider

public AtomFeedExportProvider(IContentProvider provider,
                              Map keys,
                              String var)
Provider limiting specified provider to specified keys.

Method Detail

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
Overrides:
getPropertyKeys in class BoundPropertiesContentProvider
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
Overrides:
getType in class BoundPropertiesContentProvider
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
Overrides:
getValue in class BoundPropertiesContentProvider
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
Overrides:
hasProperty in class BoundPropertiesContentProvider
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
Overrides:
isReadOnly in class BoundPropertiesContentProvider
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
Overrides:
setValue in class BoundPropertiesContentProvider
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

getAutogeneratedValues

protected Map getAutogeneratedValues()