public class CollectionFilterFetchingProxy extends java.lang.Object implements ResultsFetchingProxy
Result
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
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
Constructor and Description |
---|
CollectionFilterFetchingProxy() |
Modifier and Type | Method and Description |
---|---|
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
|
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 sessionatg.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 pagingprotected int getFetchSize(int pPageSize)
pPageSize
- the actual pageSize