com.webmethods.caf.faces.data.object
Class XMLTableContentProvider

java.lang.Object
  extended by com.webmethods.caf.faces.bean.PageFlowScopeAdapter
      extended by com.webmethods.caf.faces.data.object.ListTableContentProvider
          extended by com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
              extended by com.webmethods.caf.faces.data.object.XMLTableContentProvider
All Implemented Interfaces:
IPageFlowScopeAdapter, IAddressableTableContentProvider, IContentProvider, IRefreshable, IRefreshableContentProvider, IReorderableTableContentProvider, ISelectableTableContentProvider, ISortableTableContentProvider, ITableContentProvider, IUpdateableContentProvider, IUpdateableTableContentProvider, Serializable

public class XMLTableContentProvider
extends SelectableListTableContentProvider

Table provider which displays a list of W3C DOM Nodes. If this provider is configured with a rows xpath expression (see XMLTableContentProvider.setRowsXpath(String)), the xpath expression should resolve to a list of elements to display. If this provider is not configured with a rows xpath expression, the child elements of the root node will be displayed.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
SelectableListTableContentProvider.Row, SelectableListTableContentProvider.RowComparator
 
Field Summary
protected static Object[] EMPTY_ARGS
           
protected  Map m_descriptors
           
protected  Node m_root
           
protected  String m_rowsXpath
           
 
Fields inherited from class com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
m_autoIdCounter, m_map, m_originalList, m_selectableHelper
 
Fields inherited from class com.webmethods.caf.faces.data.object.ListTableContentProvider
m_array, m_canTemplateRow, m_index, m_list, m_onCreateRow, m_onDeleteRow, m_rowId, m_rowType, m_sort, m_templateRow, m_var
 
Fields inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter
fExpireWithPageFlow
 
Constructor Summary
XMLTableContentProvider()
          Creates a new, uninitialized table content-provider.
XMLTableContentProvider(Node root)
          Creates a new table content-provider initialized with the specified root node.
XMLTableContentProvider(Node root, String rowsXpath)
          Creates a new table content-provider initialized with the specified root node, and an xpath expression to apply to the root node to produce a list of elements to display.
XMLTableContentProvider(Node root, String rowsXpath, String rowIdBinding, String rowVariable)
          Creates a new table content-provider initialized with the specified root node, an xpath expression to apply to the root node to produce a list of elements to display, and a value-binding expression to use to produce a unique id for each node (using the specified row variable to identify the current row in the value-binding expression).
 
Method Summary
protected  Map getPropertyDescriptors()
          Returns map of bean property-names to bean property-descriptors for all of the bean's properties.
 Node getRoot()
          Root node.
 String getRowsXpath()
          Xpath expression to apply to the root node to produce a list of elements to display.
 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 setRoot(Node root)
          Root node.
 void setRowsXpath(String rowsXpath)
          Xpath expression to apply to the root node to produce a list of elements to display.
 void setValue(Object propertyKey, Object value)
          Sets new value of the given property
 
Methods inherited from class com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
createRow, deleteRow, getCurrentRow, getList, getNeedRefresh, getRowId, getRowSelectedCount, getRowSelectedIds, getRowUnselectedIds, getSelectedRows, getUseUnselectedModel, isAddressable, isAutoRefresh, isRowSelected, moveTo, refresh, setAutoRefresh, setCurrentRow, setList, setNeedRefresh, setRowById, setRowSelected, setRowSelectedIds, setRowUnselectedIds, setRowVariable, setTemplateRow, sort, supportsAutoRefresh, updateOriginalList
 
Methods inherited from class com.webmethods.caf.faces.data.object.ListTableContentProvider
calculateRowId, calculateRowId, getArray, getCanTemplateRow, getOnCreateRow, getOnDeleteRow, getPropertyKeys, getRowCount, getRowIdBinding, getRowIndex, getRowType, getRowVariable, getSort, isReorderable, isRowAvailable, isTemplateRow, newRow, setArray, setCanTemplateRow, setOnCreateRow, setOnDeleteRow, setRowId, setRowIdBinding, setRowIndex, setRowType, setSort, toString
 
Methods inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter
getExpireWithPageFlow, setExpireWithPageFlow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.webmethods.caf.faces.data.ITableContentProvider
getRowCount, getRowIndex, getRowVariable, isRowAvailable, setRowIndex
 
Methods inherited from interface com.webmethods.caf.faces.data.IContentProvider
getPropertyKeys, toString
 

Field Detail

EMPTY_ARGS

protected static final Object[] EMPTY_ARGS

m_descriptors

protected Map m_descriptors

m_rowsXpath

protected String m_rowsXpath

m_root

protected Node m_root
Constructor Detail

XMLTableContentProvider

public XMLTableContentProvider()
Creates a new, uninitialized table content-provider. This provider must be initialized with a root node.


XMLTableContentProvider

public XMLTableContentProvider(Node root)
Creates a new table content-provider initialized with the specified root node.


XMLTableContentProvider

public XMLTableContentProvider(Node root,
                               String rowsXpath)
Creates a new table content-provider initialized with the specified root node, and an xpath expression to apply to the root node to produce a list of elements to display.


XMLTableContentProvider

public XMLTableContentProvider(Node root,
                               String rowsXpath,
                               String rowIdBinding,
                               String rowVariable)
Creates a new table content-provider initialized with the specified root node, an xpath expression to apply to the root node to produce a list of elements to display, and a value-binding expression to use to produce a unique id for each node (using the specified row variable to identify the current row in the value-binding expression).

Method Detail

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 ListTableContentProvider
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 ListTableContentProvider
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 ListTableContentProvider
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 ListTableContentProvider
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 ListTableContentProvider
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

getRoot

public Node getRoot()
Root node.


setRoot

public void setRoot(Node root)
Root node.


getRowsXpath

public String getRowsXpath()
Xpath expression to apply to the root node to produce a list of elements to display. If null, the child elements of the root node will be displayed.


setRowsXpath

public void setRowsXpath(String rowsXpath)
Xpath expression to apply to the root node to produce a list of elements to display. If null, the child elements of the root node will be displayed.


getPropertyDescriptors

protected Map getPropertyDescriptors()
Returns map of bean property-names to bean property-descriptors for all of the bean's properties.