com.ibm.xsp.model
Class TabularDataModel

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by com.ibm.xsp.model.TabularDataModel
All Implemented Interfaces:
DataModelEx
Direct Known Subclasses:
AbstractDataModel, DominoViewDataModel

public abstract class TabularDataModel
extends javax.faces.model.DataModel
implements DataModelEx


Field Summary
protected  int _rowIndex
           
protected  java.lang.Object _wrappedData
           
protected  FacesDataIterator dataControl
           
static int RESORT_ASCENDING
           
static int RESORT_BOTH
           
static int RESORT_DESCENDING
           
static int RESORT_NONE
           
static int RESORT_UNKNOWN
           
static java.lang.String SORT_ASCENDING
           
static java.lang.String SORT_DESCENDING
           
static java.lang.String SORT_TOGGLE
           
static int TYPE_CATEGORY
           
static int TYPE_ENTRY
           
static int TYPE_TOTAL
           
static int TYPE_UNKNOWN
           
 
Constructor Summary
TabularDataModel()
          Construct an TabularDataModel instance
 
Method Summary
 void addSelectedId(java.lang.String id)
          Add the specified id to the selected list
 boolean canHaveMoreRows()
          Return true where the data model is not able to compute the precise number of rows in a data source and therefore can potentially have more rows than initial count.
 void clearSelectedIds()
          Clear the list of selected ids.
static java.lang.String codeToParameter(int resort)
           
 void collapseRow(java.lang.String position)
          collapse the row at this position
 void deleteSelectedItems()
          Delete the selected items and clear the list of selected ids.
 void duplicateRowData(int insertIndex)
          Duplicate the data for the currently selected row index and insert it into the data model at the specified insertion index.
 void expandRow(java.lang.String position)
          expand the row at this position
 int getCategoryColumnIndex(java.lang.String columnName)
           
 int getCategoryCount()
          Return the number of categoized columns
 java.lang.String getCategoryFilter()
          Return the category filter
 int getCategoryIndentLevel()
          Return the Category Indent Level (-1)
 java.lang.String getCategoryName()
          Return the Category name Returns null
 int getColumnIndentLevel()
          Return the Column Indent Level (-1)
 java.util.Vector getColumnValues()
          get the Columns Values as a Vector.
 FacesDataIterator getDataControl()
          Return the Data iterator for this Data Model
 int getIndentLevel()
          Return the Indent Level (-1)
 java.lang.String getResortColumn()
          Return the name of the resort column
 int getResortState(java.lang.String columnName)
          Return the resort state of the column specified
 int getResortType(java.lang.String columnName)
          Return the resort type of the column specified
 java.lang.String getRowId()
          Return the current row id
 int getRowIndex()
           
 java.lang.String getRowPosition()
          Return the current row position
 int getRowType()
          Return the row type - TYPE_ENTRY, TYPE_CATEGORY, TYPE_TOTAL Default is TYPE_UNKNOWN
 java.util.Iterator getSelectedIds()
          Return an iterator of the selected ids.
 java.lang.Object getWrappedData()
          Delegates to ValueBindingObject.getValueBinding(String)
 boolean hasCategoryFilter()
          Is a category filter applied to the data
 boolean hasFTFilter()
          has Full Test Search Filter
 boolean hasKeysFilter()
          has Keys filter applied
 int hasMoreRows(int maxCount)
          Check if it might have rows beyond the count.
 void insertRowData(java.lang.Object data)
          Insert the object representing the data for the currently selected row index.
 boolean isCategorized()
          Is the data source itself is categorized
 boolean isColumnCategorized(java.lang.String columnName)
          Is column categorized
 boolean isColumnSortable(java.lang.String columnName)
           
 boolean isRowAvailable()
          Return true is a row is available, i.e.
 boolean isRowCategory()
          Is current row a category heading
 boolean isRowCollapsed()
          Is the row collapsed.
 boolean isRowData()
          Is the row is regular data row (not a category or total)
 boolean isRowExpanded()
          Is the row expanded.
 boolean isRowLeaf()
          Return true is row is leaf
 boolean isRowNonData()
          Is the row is a category or total or any non-regular row entry
 boolean isRowTotal()
          Does current row contain a total value
 boolean isRowUnread()
          Is row unread
 boolean isRowUnread(java.lang.String onBehalfOfUser)
          Is row read by user specified
 boolean isSelectedId(java.lang.String id)
          Return true if the specified id is selected
static int parameterToCode(java.lang.String parameter)
           
 void removeRowData()
          Remove the data for the currently selected row index.
 void removeSelectedId(java.lang.String id)
          Remove the specified id from the selected list
 int resetResortState(java.lang.String columnName)
          Reset the resort state for the column (returns -1)
 void setDataControl(FacesDataIterator dataControl)
          Set the Data iterator for this Data Model
 void setResortOrder(java.lang.String columnName, java.lang.String sortOrder)
          Set the Resort order for specified column, ascending, descending, toggle
 void setRowData(java.lang.Object data)
          Set the object representing the data for the currently selected row index.
 void setRowIndex(int rowIndex)
           
 void setWrappedData(java.lang.Object data)
           
 void toggleRow(java.lang.String position)
          invert the expand/collapse state of a row
 
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, getRowCount, getRowData, removeDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
See Also:
Constant Field Values

TYPE_ENTRY

public static final int TYPE_ENTRY
See Also:
Constant Field Values

TYPE_CATEGORY

public static final int TYPE_CATEGORY
See Also:
Constant Field Values

TYPE_TOTAL

public static final int TYPE_TOTAL
See Also:
Constant Field Values

RESORT_UNKNOWN

public static final int RESORT_UNKNOWN
See Also:
Constant Field Values

RESORT_NONE

public static final int RESORT_NONE
See Also:
Constant Field Values

RESORT_ASCENDING

public static final int RESORT_ASCENDING
See Also:
Constant Field Values

RESORT_DESCENDING

public static final int RESORT_DESCENDING
See Also:
Constant Field Values

RESORT_BOTH

public static final int RESORT_BOTH
See Also:
Constant Field Values

SORT_ASCENDING

public static final java.lang.String SORT_ASCENDING
See Also:
Constant Field Values

SORT_DESCENDING

public static final java.lang.String SORT_DESCENDING
See Also:
Constant Field Values

SORT_TOGGLE

public static final java.lang.String SORT_TOGGLE
See Also:
Constant Field Values

dataControl

protected FacesDataIterator dataControl

_rowIndex

protected int _rowIndex

_wrappedData

protected java.lang.Object _wrappedData
Constructor Detail

TabularDataModel

public TabularDataModel()
Construct an TabularDataModel instance

Method Detail

hasMoreRows

public int hasMoreRows(int maxCount)
Check if it might have rows beyond the count. This happens when the data model is not able to compute the precise count number, or when it is too costly to achieve. So this function tries to

Returns:
the number of rows beyond the count. If the result is greater that maxCount it means there might be even more...

canHaveMoreRows

public boolean canHaveMoreRows()
Return true where the data model is not able to compute the precise number of rows in a data source and therefore can potentially have more rows than initial count.

Default is false

Returns:
true is data source can have more rows

isRowAvailable

public boolean isRowAvailable()
Return true is a row is available, i.e. current row index is between the first and last row indexes. (non-Javadoc)

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

isRowLeaf

public boolean isRowLeaf()
Return true is row is leaf

Default is false


getRowType

public int getRowType()
Return the row type - TYPE_ENTRY, TYPE_CATEGORY, TYPE_TOTAL Default is TYPE_UNKNOWN


getRowPosition

public java.lang.String getRowPosition()
Return the current row position


getRowId

public java.lang.String getRowId()
Return the current row id


setResortOrder

public void setResortOrder(java.lang.String columnName,
                           java.lang.String sortOrder)
Set the Resort order for specified column, ascending, descending, toggle


getResortType

public int getResortType(java.lang.String columnName)
Return the resort type of the column specified

RESORT_NONE, RESORT_ASCENDING, RESORT_DESCENDING, RESORT_BOTH

Default is RESORT_NONE

Parameters:
columnName - column
Returns:
resort type

getResortState

public int getResortState(java.lang.String columnName)
Return the resort state of the column specified

RESORT_NONE, RESORT_ASCENDING, RESORT_DESCENDING, RESORT_BOTH

Default is RESORT_NONE

Parameters:
columnName - column
Returns:
resort state

getResortColumn

public java.lang.String getResortColumn()
Return the name of the resort column


resetResortState

public int resetResortState(java.lang.String columnName)
Reset the resort state for the column (returns -1)


getCategoryIndentLevel

public int getCategoryIndentLevel()
Return the Category Indent Level (-1)


getIndentLevel

public int getIndentLevel()
Return the Indent Level (-1)


getColumnIndentLevel

public int getColumnIndentLevel()
Return the Column Indent Level (-1)


getColumnValues

public java.util.Vector getColumnValues()
get the Columns Values as a Vector. Returns null


getCategoryName

public java.lang.String getCategoryName()
Return the Category name Returns null


isRowCollapsed

public boolean isRowCollapsed()
Is the row collapsed. Default false


isRowExpanded

public boolean isRowExpanded()
Is the row expanded. Default false


isRowCategory

public boolean isRowCategory()
Is current row a category heading


isRowTotal

public boolean isRowTotal()
Does current row contain a total value


isRowUnread

public boolean isRowUnread()
Is row unread


isRowUnread

public boolean isRowUnread(java.lang.String onBehalfOfUser)
Is row read by user specified


isRowNonData

public boolean isRowNonData()
Is the row is a category or total or any non-regular row entry

Returns:
true if the row is a category or total or any non-regular row entry

isRowData

public boolean isRowData()
Is the row is regular data row (not a category or total)

Returns:
true if the row is regular data row (not a category or total)

isCategorized

public boolean isCategorized()
Is the data source itself is categorized

Returns:
true if data source itself is categorized

isColumnCategorized

public boolean isColumnCategorized(java.lang.String columnName)
Is column categorized


isColumnSortable

public boolean isColumnSortable(java.lang.String columnName)

getCategoryColumnIndex

public int getCategoryColumnIndex(java.lang.String columnName)
Returns:
index of category column among category columnns 0 = 1st catorized column, 1 = 2nd categorized column, etc. Integer.MIN_VALUE is returned for any error situation

getCategoryCount

public int getCategoryCount()
Return the number of categoized columns


getCategoryFilter

public java.lang.String getCategoryFilter()
Return the category filter


hasCategoryFilter

public boolean hasCategoryFilter()
Is a category filter applied to the data


hasKeysFilter

public boolean hasKeysFilter()
has Keys filter applied


hasFTFilter

public boolean hasFTFilter()
has Full Test Search Filter


toggleRow

public void toggleRow(java.lang.String position)
invert the expand/collapse state of a row


expandRow

public void expandRow(java.lang.String position)
expand the row at this position


collapseRow

public void collapseRow(java.lang.String position)
collapse the row at this position


getRowIndex

public int getRowIndex()
Specified by:
getRowIndex in class javax.faces.model.DataModel
See Also:
DataModel.getRowIndex()

setRowIndex

public void setRowIndex(int rowIndex)
Specified by:
setRowIndex in class javax.faces.model.DataModel

getWrappedData

public java.lang.Object getWrappedData()
Delegates to ValueBindingObject.getValueBinding(String)

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

setWrappedData

public void setWrappedData(java.lang.Object data)
Specified by:
setWrappedData in class javax.faces.model.DataModel

getDataControl

public FacesDataIterator getDataControl()
Return the Data iterator for this Data Model


setDataControl

public void setDataControl(FacesDataIterator dataControl)
Set the Data iterator for this Data Model


codeToParameter

public static java.lang.String codeToParameter(int resort)

parameterToCode

public static int parameterToCode(java.lang.String parameter)

getSelectedIds

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


clearSelectedIds

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


isSelectedId

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


addSelectedId

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


removeSelectedId

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


deleteSelectedItems

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

Throws:
java.io.IOException

setRowData

public void setRowData(java.lang.Object data)
Description copied from interface: DataModelEx
Set the object representing the data for the currently selected row index.

Specified by:
setRowData in interface DataModelEx
Parameters:
data - data to be set for the currently selected row index

insertRowData

public void insertRowData(java.lang.Object data)
Description copied from interface: DataModelEx
Insert the object representing the data for the currently selected row index.

Specified by:
insertRowData in interface DataModelEx
Parameters:
data - data to be inserted at the currently selected row index

duplicateRowData

public void duplicateRowData(int insertIndex)
                      throws javax.faces.FacesException
Description copied from interface: DataModelEx
Duplicate the data for the currently selected row index and insert it into the data model at the specified insertion index.

Specified by:
duplicateRowData in interface DataModelEx
Parameters:
insertIndex - the insertion index for the duplicated row data
Throws:
javax.faces.FacesException - if an error occurs duplicating row data

removeRowData

public void removeRowData()
                   throws javax.faces.FacesException
Description copied from interface: DataModelEx
Remove the data for the currently selected row index.

Specified by:
removeRowData in interface DataModelEx
Throws:
javax.faces.FacesException - if an error occurs removing row data