Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.2)

E22562-02

oracle.apps.fnd.applcore.globalSearch.ui
Class SearchResultCM

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by org.apache.myfaces.trinidad.model.CollectionModel
          extended by oracle.apps.fnd.applcore.globalSearch.ui.SearchResultCM
All Implemented Interfaces:
org.apache.myfaces.trinidad.model.LocalRowKeyIndex, org.apache.myfaces.trinidad.model.RowKeyIndex

public class SearchResultCM
extends org.apache.myfaces.trinidad.model.CollectionModel

A collectionModel based off a SearchResult. This class was designed for use in a af:table to show search results. It will dynamically extend it's search result as calls are made to show data that is not internally available. This implementation works off a contiguous sub-list of the search result. The table scrollbar will show only as many results as have been obtained from the search engine (typically many less than the heuristic number of results available). Example 1287908 hits, search pulls 10 results and shows them in a table about 10 at a time). As you scroll to the bottom of this list of 10, the search result will be extended (another 10), and the scroll position will jump back down to indicate the new results appended after the current scroll position. This implementation is very sensitive to the fetchsize of the af:table and the number or search results held in memory in the SearchResult. The extension of the search results is triggered by the table asking for rows a little more than a "fetchsize" beyond the number of cached search results. This is dependent on the table calling getRowCount() and this method lying to the UI (the table) to force the scrollbar to show; it is up to the isRowAvailable() method to tidy up after getRowCount(). It should be noted that when less then 1 fetchsize before the end of the result, af:table does *not* call getRowCount() again.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex
org.apache.myfaces.trinidad.model.LocalRowKeyIndex.Confidence, org.apache.myfaces.trinidad.model.LocalRowKeyIndex.LocalCachingStrategy
 
Constructor Summary
SearchResultCM()
          Public Constructor.
SearchResultCM(SearchResult sr)
          Public Constructor.
 
Method Summary
 int getRowCount()
           This method lies about the row count by up to AF_TABLE_FETCHSIZE + 2 to induce a scrollbar in the results table, however if it knows the truth due to an exhausted result set, it will tell it.
 java.lang.Object getRowData()
          
 int getRowIndex()
          
 java.lang.Object getRowKey()
          
 java.lang.Object getWrappedData()
          
 boolean isRowAvailable()
           This method always tells the truth, if it returns false there is no row.
 void setRowIndex(int rowIndex)
          
 void setRowKey(java.lang.Object newKey)
          
 void setWrappedData(java.lang.Object data)
          Data provided to this method must be a List object.
 
Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel
areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, getCachingStrategy, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowData, getSortCriteria, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, isSortable, setSortCriteria
 
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

SearchResultCM

public SearchResultCM()
Public Constructor.


SearchResultCM

public SearchResultCM(SearchResult sr)
Public Constructor.

Parameters:
sr - the wrapped search result data
Method Detail

getRowKey

public java.lang.Object getRowKey()

Specified by:
getRowKey in interface org.apache.myfaces.trinidad.model.RowKeyIndex
Specified by:
getRowKey in class org.apache.myfaces.trinidad.model.CollectionModel

setRowKey

public void setRowKey(java.lang.Object newKey)

Specified by:
setRowKey in interface org.apache.myfaces.trinidad.model.RowKeyIndex
Specified by:
setRowKey in class org.apache.myfaces.trinidad.model.CollectionModel

isRowAvailable

public boolean isRowAvailable()
This method always tells the truth, if it returns false there is no row. It will extend the search to determine the truth and will block until this completes.

Specified by:
isRowAvailable in interface org.apache.myfaces.trinidad.model.RowKeyIndex
Specified by:
isRowAvailable in class javax.faces.model.DataModel
See Also:
getRowCount()

getRowCount

public int getRowCount()
This method lies about the row count by up to AF_TABLE_FETCHSIZE + 2 to induce a scrollbar in the results table, however if it knows the truth due to an exhausted result set, it will tell it.

Specified by:
getRowCount in interface org.apache.myfaces.trinidad.model.RowKeyIndex
Specified by:
getRowCount in class javax.faces.model.DataModel
See Also:
isRowAvailable()

getRowData

public java.lang.Object getRowData()

Specified by:
getRowData in interface org.apache.myfaces.trinidad.model.RowKeyIndex
Specified by:
getRowData in class javax.faces.model.DataModel

getRowIndex

public int getRowIndex()

Specified by:
getRowIndex in interface org.apache.myfaces.trinidad.model.RowKeyIndex
Specified by:
getRowIndex in class javax.faces.model.DataModel

setRowIndex

public void setRowIndex(int rowIndex)

Specified by:
setRowIndex in interface org.apache.myfaces.trinidad.model.RowKeyIndex
Specified by:
setRowIndex in class javax.faces.model.DataModel

getWrappedData

public java.lang.Object getWrappedData()

Specified by:
getWrappedData in class javax.faces.model.DataModel

setWrappedData

public void setWrappedData(java.lang.Object data)
Data provided to this method must be a List object.

Specified by:
setWrappedData in class javax.faces.model.DataModel
Parameters:
data - the search result to wrap

Oracle Fusion Middleware extensions for Applications Core API Reference
11g Release 1 (11.1.2)

E22562-02

Copyright © 2011 Oracle. All Rights Reserved.