|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.search.formhandlers.CollectionFilterFetchingProxy
public class CollectionFilterFetchingProxy
A results fetcher that uses a collection filter to filter search results on the client side. Normally one should rely on the search server to filter results, however under certain circumstances it may be desirable or necessary to filter this way in order to consider some criteria in a nearer-to-realtime context, such as inventory status.
Collection filters configured for use in this class will be passed collections (ArrayList objects) ofResult
objects. Note that these are not repository items. Collection
filters written to filter repository items will not work.
This class only works for QueryRequest.Response
s
from a QueryRequest
.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Constructor Summary | |
---|---|
CollectionFilterFetchingProxy()
|
Method Summary | |
---|---|
SearchResponse |
fetch(BaseSearchFormHandler pFormHandler,
SearchRequest pSearchRequest,
atg.search.client.SearchSession pSearchSession)
Fetch results |
protected boolean |
filterItems(BaseSearchFormHandler pFormHandler,
QueryRequest.Response pResults,
java.util.List pUnfilteredItems,
int pPageSize,
boolean pUsingPaging)
Apply filter to specified unfiltered items. |
java.lang.String |
getCacheKey()
Get the cache key |
protected java.lang.String |
getCacheKey(BaseSearchFormHandler pFormHandler,
QueryRequest.Response pResults,
java.util.List pUnfilteredItems)
Return a string that uniquely identifies the unfiltered collection. |
double |
getFetchFactor()
When using paging, the page size is is multiplied by this value in order to request more results than are required by the page size, since it is expected that some items will be filtered out. |
protected int |
getFetchSize(int pPageSize)
Return the page size adjusted by the fetch factor. |
CachedCollectionFilter |
getFilter()
|
boolean |
getUpdateCache()
Set the updateCache property |
boolean |
getUseCache()
Get the useCache property |
void |
setCacheKey(java.lang.String pCacheKey)
Set a key to use as the cache key |
void |
setFetchFactor(double pFetchFactor)
When using paging, the page size is is multiplied by this value in order to request more results than are required by the page size, since it is expected that some items will be filtered out. |
void |
setFilter(CachedCollectionFilter pCachedCollectionFilter)
Set the cached collection filter |
void |
setUpdateCache(boolean pUpdateCache)
Set the updateCache property |
void |
setUseCache(boolean pUseCache)
Set useCache property |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public CollectionFilterFetchingProxy()
Method Detail |
---|
public void setFilter(CachedCollectionFilter pCachedCollectionFilter)
pCachedCollectionFilter
- the collection filterpublic CachedCollectionFilter getFilter()
public void setCacheKey(java.lang.String pCacheKey)
pCacheKey
- the cache key or nullpublic java.lang.String getCacheKey()
public void setUseCache(boolean pUseCache)
pUseCache
- true to pass useCache to filter, false otherwisepublic boolean getUseCache()
public void setUpdateCache(boolean pUpdateCache)
pUpadateCache
- true to tell filter to update cache, false
otherwisepublic boolean getUpdateCache()
pUpadateCache
- true to tell filter to update cache, false
otherwisepublic void setFetchFactor(double pFetchFactor)
pFetchFactor
- the fetch factor valuepublic double getFetchFactor()
public SearchResponse fetch(BaseSearchFormHandler pFormHandler, SearchRequest pSearchRequest, atg.search.client.SearchSession pSearchSession) throws atg.search.client.SearchClientException
fetch
in interface ResultsFetchingProxy
pFormHandler
- the form handler issuing the requestpRequest
- the client requestpSearchSession
- the search session
atg.search.es.exception.SearchException
atg.search.client.SearchClientException
protected java.lang.String getCacheKey(BaseSearchFormHandler pFormHandler, QueryRequest.Response pResults, java.util.List pUnfilteredItems)
pFormHandler
- the form handler invoking this filter (use
pFormHandler.getUserProfile() to get profile)pResults
- the unfiltered search resultspUnfilteredItems
- the unfiltered search resultsprotected boolean filterItems(BaseSearchFormHandler pFormHandler, QueryRequest.Response pResults, java.util.List pUnfilteredItems, int pPageSize, boolean pUsingPaging)
pFormHandler
- the form hander invoking this proxypResults
- the results object to populate with filtered itemspUnfilteredItems
- the unfiltered search result itemspPageSize
- the maximum number of items to show on the pagepUsingPaging
- true if using paging
protected int getFetchSize(int pPageSize)
pPageSize
- the actual pageSize
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |