|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.search.query.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) of com.primus.searchstudio.Result objects. Note that these are not repository items. Collection filters written to filter repository items will not work. Page Mode. For <query> type queries using the paging attribute/value pageMode="group", this filter may generate empty groups, or groups which don't contain the number of items specified in the result list control parameters.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Constructor Summary | |
---|---|
CollectionFilterFetchingProxy()
|
Method Summary | |
---|---|
Results |
fetch(BaseSearchFormHandler pFormHandler,
ClientRequest pRequest,
SearchSession pSearchSession)
Fetch results |
protected boolean |
filterItems(BaseSearchFormHandler pFormHandler,
Results 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,
Results 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. |
atg.service.collections.filter.CachedCollectionFilter |
getFilter()
|
boolean |
getUpdateCache()
Set the updateCache property |
boolean |
getUseCache()
Get the useCache property |
protected int |
parseInt(java.lang.String pIntString)
Return the integer value of the string parameter or -1 if the string does not contain an valid integer string . |
protected int |
parseInt(java.lang.String pIntString,
int pDefault)
Return the integer value of the string parameter or the specified default value if the string does not contain an valid integer string |
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(atg.service.collections.filter.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(atg.service.collections.filter.CachedCollectionFilter pCachedCollectionFilter)
pCachedCollectionFilter
- the collection filterpublic atg.service.collections.filter.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 Results fetch(BaseSearchFormHandler pFormHandler, ClientRequest pRequest, SearchSession pSearchSession) throws SearchException
fetch
in interface ResultsFetchingProxy
pFormHandler
- the form handler issuing the requestpRequest
- the client requestpSearchSession
- the search session
SearchException
protected java.lang.String getCacheKey(BaseSearchFormHandler pFormHandler, Results 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, Results 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
protected int parseInt(java.lang.String pIntString)
pIntString
- the string to parse
protected int parseInt(java.lang.String pIntString, int pDefault)
pIntString
- the string to parsepDefault
- the default value if pIntString is not an int
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |