com.ibm.xsp.model
Class AbstractViewDataModel

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by com.ibm.xsp.model.TabularDataModel
          extended by com.ibm.xsp.model.AbstractDataModel
              extended by com.ibm.xsp.model.AbstractViewDataModel
All Implemented Interfaces:
ValueBindingObject, DataModelEx, ViewDataModel

public abstract class AbstractViewDataModel
extends AbstractDataModel
implements ViewDataModel


Field Summary
 
Fields inherited from class com.ibm.xsp.model.AbstractDataModel
_rowIndex, _wrappedData
 
Fields inherited from class com.ibm.xsp.model.TabularDataModel
dataControl, RESORT_ASCENDING, RESORT_BOTH, RESORT_DESCENDING, RESORT_NONE, RESORT_UNKNOWN, SORT_ASCENDING, SORT_DESCENDING, SORT_TOGGLE, TYPE_CATEGORY, TYPE_ENTRY, TYPE_TOTAL, TYPE_UNKNOWN
 
Fields inherited from interface com.ibm.xsp.model.ViewDataModel
SORT_ASCENDING, SORT_DESCENDING, SORT_NONE
 
Constructor Summary
protected AbstractViewDataModel()
          Default Constructor
 
Method Summary
 void addSelectedId(java.lang.String id)
          Add the specified id to the selected list
 void clearSelectedIds()
          Clear the list of selected ids.
 void deleteSelectedItems()
          Delete the selected items and clear the list of selected ids.
protected abstract  int doComputeRowCount()
          Compute the total number of rows for this data model.
protected abstract  void doDeleteSelectedItems(java.util.List selectedIds)
          Delete the selected items and clear the list of selected ids.
protected abstract  int doGetSortOrder(java.lang.String columnName)
          Get the sort order for the specified column
protected abstract  ViewRowData doGetViewRowData()
          Return a ViewRowData representing the data for the currently selected row index in the View
protected abstract  boolean doIsDataTransient(java.lang.Object wrappedData)
          Return true if this current wrapped data is transient
protected abstract  boolean doIsNumeric(java.lang.String columnName)
          Return true if the column has a numeric value
protected abstract  void doReload()
          Force a refresh of the view data model.
protected abstract  void doSetComputeTotals(boolean computeTotals)
          Indicates that column totals should be computed.
protected abstract  void doSetSortOrder(java.lang.String columnName, int sortOrder)
          Set the sort order for the specified column
 int getRowCount()
          see javax.faces.model.DataModel#getRowCount() (non-Javadoc)
 java.lang.Object getRowData()
          see javax.faces.model.DataModel#getRowData() (non-Javadoc)
 java.util.Iterator getSelectedIds()
          Return an iterator of the selected ids.
 int getSortOrder(java.lang.String columnName)
          Get the sort order for the specified column
 boolean isNumeric(java.lang.String columnName)
          Return true if the column has a numeric value
 boolean isSelectedId(java.lang.String id)
          Return true if the specified id is selected
 void reload()
          Force a refresh of the view data model.
 void removeSelectedId(java.lang.String id)
          Remove the specified id to the selected list
protected  void resetRowCount()
          Reset the row count to -1
 void setComputeTotals(boolean computeTotals)
          Indicates that column totals should be computed.
 void setSortOrder(java.lang.String columnName, int sortOrder)
          Set the sort order for the specified column
 
Methods inherited from class com.ibm.xsp.model.AbstractDataModel
getPropertyAsString, getPropertyValue, getRowIndex, getValueBinding, getWrappedData, isRowAvailable, setDisplayParameters, setRowIndex, setValueBinding, setWrappedData
 
Methods inherited from class com.ibm.xsp.model.TabularDataModel
canHaveMoreRows, codeToParameter, collapseRow, duplicateRowData, expandRow, getCategoryColumnIndex, getCategoryCount, getCategoryFilter, getCategoryIndentLevel, getCategoryName, getColumnIndentLevel, getColumnValues, getDataControl, getIndentLevel, getResortColumn, getResortState, getResortType, getRowId, getRowPosition, getRowType, hasCategoryFilter, hasFTFilter, hasKeysFilter, hasMoreRows, insertRowData, isCategorized, isColumnCategorized, isColumnSortable, isRowCategory, isRowCollapsed, isRowData, isRowExpanded, isRowLeaf, isRowNonData, isRowTotal, isRowUnread, isRowUnread, parameterToCode, removeRowData, resetResortState, setDataControl, setResortOrder, setRowData, toggleRow
 
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractViewDataModel

protected AbstractViewDataModel()
Default Constructor

Method Detail

getRowCount

public int getRowCount()
see javax.faces.model.DataModel#getRowCount() (non-Javadoc)

Specified by:
getRowCount in class javax.faces.model.DataModel
See Also:
DataModel.getRowCount()

getRowData

public java.lang.Object getRowData()
see javax.faces.model.DataModel#getRowData() (non-Javadoc)

Specified by:
getRowData in class javax.faces.model.DataModel
See Also:
DataModel.getRowData()

reload

public void reload()
Force a refresh of the view data model.

Specified by:
reload in interface ViewDataModel

setComputeTotals

public void setComputeTotals(boolean computeTotals)
Indicates that column totals should be computed.

Specified by:
setComputeTotals in interface ViewDataModel
Parameters:
computeTotals - The computeTotals to set.

isNumeric

public boolean isNumeric(java.lang.String columnName)
Return true if the column has a numeric value

Specified by:
isNumeric in interface ViewDataModel

setSortOrder

public void setSortOrder(java.lang.String columnName,
                         int sortOrder)
Set the sort order for the specified column

Specified by:
setSortOrder in interface ViewDataModel

getSortOrder

public int getSortOrder(java.lang.String columnName)
Get the sort order for the specified column

Specified by:
getSortOrder in interface ViewDataModel

getSelectedIds

public java.util.Iterator getSelectedIds()
Return an iterator of the selected ids.

Specified by:
getSelectedIds in interface ViewDataModel
Overrides:
getSelectedIds in class TabularDataModel

clearSelectedIds

public void clearSelectedIds()
Clear the list of selected ids.

Specified by:
clearSelectedIds in interface ViewDataModel
Overrides:
clearSelectedIds in class TabularDataModel

isSelectedId

public boolean isSelectedId(java.lang.String id)
Return true if the specified id is selected

Specified by:
isSelectedId in interface ViewDataModel
Overrides:
isSelectedId in class TabularDataModel

addSelectedId

public void addSelectedId(java.lang.String id)
Add the specified id to the selected list

Specified by:
addSelectedId in interface ViewDataModel
Overrides:
addSelectedId in class TabularDataModel

removeSelectedId

public void removeSelectedId(java.lang.String id)
Remove the specified id to the selected list

Specified by:
removeSelectedId in interface ViewDataModel
Overrides:
removeSelectedId in class TabularDataModel

deleteSelectedItems

public void deleteSelectedItems()
                         throws java.io.IOException
Delete the selected items and clear the list of selected ids.

Specified by:
deleteSelectedItems in interface ViewDataModel
Overrides:
deleteSelectedItems in class TabularDataModel
Throws:
java.io.IOException

resetRowCount

protected final void resetRowCount()
Reset the row count to -1


doReload

protected abstract void doReload()
Force a refresh of the view data model.


doSetComputeTotals

protected abstract void doSetComputeTotals(boolean computeTotals)
Indicates that column totals should be computed.

Parameters:
computeTotals - The computeTotals to set.

doIsNumeric

protected abstract boolean doIsNumeric(java.lang.String columnName)
Return true if the column has a numeric value


doComputeRowCount

protected abstract int doComputeRowCount()
Compute the total number of rows for this data model.

Returns:
the total number of rows for this data model

doGetViewRowData

protected abstract ViewRowData doGetViewRowData()
Return a ViewRowData representing the data for the currently selected row index in the View

Returns:
a ViewRowData representing the data for the currently selected

doSetSortOrder

protected abstract void doSetSortOrder(java.lang.String columnName,
                                       int sortOrder)
Set the sort order for the specified column


doGetSortOrder

protected abstract int doGetSortOrder(java.lang.String columnName)
Get the sort order for the specified column


doIsDataTransient

protected abstract boolean doIsDataTransient(java.lang.Object wrappedData)
Return true if this current wrapped data is transient

Parameters:
data -
Returns:

doDeleteSelectedItems

protected abstract void doDeleteSelectedItems(java.util.List selectedIds)
                                       throws java.io.IOException
Delete the selected items and clear the list of selected ids.

Throws:
java.io.IOException