public class DefaultSearchCommandController<SC extends CsSearchCommand> extends AbstractCallContextDependantController implements SearchCommandController<SC>
SearchCommandController interface.CONTROLLER_CONTEXT| Constructor and Description |
|---|
DefaultSearchCommandController() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addFacetValue(CsSearchFacetValue facetValue)
Add the specified facet value to the search filter and execute the search again.
|
protected DataObject<TypedObject> |
convertResultItem(TypeService typeService,
DataObject<? extends ItemModel> metaTuple) |
void |
dispatchEvent(java.lang.String context,
java.lang.Object source,
java.util.Map<java.lang.String,java.lang.Object> data)
Notifies all event acceptors which are registered for events with the context code context.
|
protected void |
doSearch() |
protected void |
doSearchInternal()
Runs the search using the current search command.
|
java.util.Set<CsSearchFacetValue> |
getAppliedFacets()
Get the currently applied facet values.
|
java.util.List<CatalogModel> |
getAvailableCatalogs()
Get the list of available catalogs.
|
protected java.util.List<CatalogModel> |
getAvailableCatalogsInternal() |
java.util.Set<CsSearchFacet> |
getAvailableFacets()
Get the available facets that can be applied to the results.
|
java.util.List<CsSort> |
getAvailableSorts()
Get the available sorts that can be applied to the results.
|
BaseSiteService |
getBaseSiteService() |
int |
getCurrentPageNumber()
Get the current page number.
|
java.util.List<DataObject<TypedObject>> |
getCurrentPageResults()
Get the current page of results.
|
CsSort |
getCurrentSortOrder()
Get the currently applied sort order.
|
SC |
getDefaultSearchCommand()
Get the optional default search command.
|
DefaultPageable |
getPageable() |
int |
getPageSize()
Get the page size or the number of results to return in each page.
|
SC |
getSearchCommand()
Get the last executed search command.
|
protected CsSearchResult<SC,? extends ItemModel> |
getSearchResult() |
protected CsSearchService<SC,? extends ItemModel> |
getSearchService() |
int |
getTotalPages()
Get the total number of pages required to display the results of the search.
|
long |
getTotalResultCount()
Get the total number of results that match the search.
|
protected void |
handleCallContextControllerEvent(CallContextEvent event)
Called when an event is received from the call context controller.
|
protected boolean |
isImpersonateCustomer() |
boolean |
removeFacetValue(CsSearchFacetValue facetValue)
Remove the applied facet value from the search filter and execute teh search again.
|
protected void |
reset() |
void |
search(SC searchCommand)
Execute the search command.
|
void |
setBaseSiteService(BaseSiteService baseSiteService) |
boolean |
setCurrentPageNumber(int page)
Change the current page to the specified page number.
|
boolean |
setCurrentSortOrder(CsSort sort)
Change the current sort to the specified sort.
|
void |
setDefaultSearchCommand(SC defaultSearchCommand) |
void |
setImpersonateCustomer(boolean impersonateCustomer) |
void |
setSearchService(CsSearchService<SC,? extends ItemModel> searchService) |
bindToCallContextController, getCallContextController, setCallContextControllergetCockpitTypeService, getModelService, setCockpitTypeService, setModelServiceaddCockpitEventAcceptor, dispatchEvent, getAcceptors, removeCockpitEventAcceptor, setCockpitEventAcceptorsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCockpitEventAcceptor, removeCockpitEventAcceptor, setCockpitEventAcceptorsprotected CsSearchService<SC,? extends ItemModel> getSearchService()
public void setSearchService(CsSearchService<SC,? extends ItemModel> searchService)
public SC getSearchCommand()
SearchCommandControllergetSearchCommand in interface SearchCommandController<SC extends CsSearchCommand>public SC getDefaultSearchCommand()
SearchCommandControllergetDefaultSearchCommand in interface SearchCommandController<SC extends CsSearchCommand>public void setDefaultSearchCommand(SC defaultSearchCommand)
public DefaultPageable getPageable()
protected CsSearchResult<SC,? extends ItemModel> getSearchResult()
protected boolean isImpersonateCustomer()
public void setImpersonateCustomer(boolean impersonateCustomer)
public BaseSiteService getBaseSiteService()
public void setBaseSiteService(BaseSiteService baseSiteService)
public void dispatchEvent(java.lang.String context,
java.lang.Object source,
java.util.Map<java.lang.String,java.lang.Object> data)
WidgetControllerdispatchEvent in interface WidgetControllerdispatchEvent in class AbstractWidgetControllercontext - event contextsource - event sourcedata - parameters to be be passed to registered listenersprotected void handleCallContextControllerEvent(CallContextEvent event)
AbstractCallContextDependantControllerhandleCallContextControllerEvent in class AbstractCallContextDependantControllerevent - the eventprotected void doSearch()
throws SearchException
SearchExceptionprotected void doSearchInternal()
throws SearchException
isImpersonateCustomer() setting.
The implementation delegates to the search service. Subclasses can override this implementation to use another
search implementation.SearchException - Thrown if a search exception occurspublic void search(SC searchCommand) throws SearchException
SearchCommandControllersearch in interface SearchCommandController<SC extends CsSearchCommand>searchCommand - The search commandSearchException - Exception thrown on errorprotected void reset()
public java.util.List<CatalogModel> getAvailableCatalogs()
SearchCommandControllergetAvailableCatalogs in interface SearchCommandController<SC extends CsSearchCommand>protected java.util.List<CatalogModel> getAvailableCatalogsInternal()
public java.util.List<DataObject<TypedObject>> getCurrentPageResults()
PageableSearchResultsDataObject
instances that provide access to the TypedObject item as well as the meta data for the item.getCurrentPageResults in interface PageableSearchResultsprotected DataObject<TypedObject> convertResultItem(TypeService typeService, DataObject<? extends ItemModel> metaTuple)
public int getCurrentPageNumber()
PageableSearchResultsgetCurrentPageNumber in interface PageableSearchResultspublic boolean setCurrentPageNumber(int page)
throws SearchException
PageableSearchResultsPageableSearchResults.getCurrentPageResults() method.setCurrentPageNumber in interface PageableSearchResultspage - the page number, zero for the first page.SearchException - thrown if the search failedpublic long getTotalResultCount()
PageableSearchResultsgetTotalResultCount in interface PageableSearchResultspublic int getTotalPages()
PageableSearchResultsgetTotalPages in interface PageableSearchResultsPageableSearchResults.getTotalResultCount(),
PageableSearchResults.getPageSize()public int getPageSize()
PageableSearchResultsgetPageSize in interface PageableSearchResultspublic CsSort getCurrentSortOrder()
PageableSearchResultsgetCurrentSortOrder in interface PageableSearchResultspublic boolean setCurrentSortOrder(CsSort sort) throws SearchException
PageableSearchResultsPageableSearchResults.getCurrentPageResults() method.setCurrentSortOrder in interface PageableSearchResultssort - the new sortSearchException - thrown if the search failedpublic java.util.List<CsSort> getAvailableSorts()
PageableSearchResultsgetAvailableSorts in interface PageableSearchResultspublic java.util.Set<CsSearchFacetValue> getAppliedFacets()
FacetedPageableSearchResultsgetAppliedFacets in interface FacetedPageableSearchResultspublic java.util.Set<CsSearchFacet> getAvailableFacets()
FacetedPageableSearchResultsgetAvailableFacets in interface FacetedPageableSearchResultspublic boolean addFacetValue(CsSearchFacetValue facetValue) throws SearchException
FacetedPageableSearchResultsPageableSearchResults.getCurrentPageResults() method.addFacetValue in interface FacetedPageableSearchResultsfacetValue - the facet value to add to the search filtersSearchException - thrown if the search failedpublic boolean removeFacetValue(CsSearchFacetValue facetValue) throws SearchException
FacetedPageableSearchResultsPageableSearchResults.getCurrentPageResults() method.removeFacetValue in interface FacetedPageableSearchResultsfacetValue - the facet value to removeSearchException - thrown if the search failedCopyright © 2018 SAP SE. All Rights Reserved.