com.endeca.infront.cartridge
Class DimensionSearchResultsHandler

java.lang.Object
  extended by com.endeca.infront.cartridge.NavigationCartridgeHandler<DimensionSearchResultsConfig,DimensionSearchResults>
      extended by com.endeca.infront.cartridge.DimensionSearchResultsHandler
All Implemented Interfaces:
CartridgeHandler<DimensionSearchResultsConfig>

public class DimensionSearchResultsHandler
extends NavigationCartridgeHandler<DimensionSearchResultsConfig,DimensionSearchResults>

Cartridge handler that creates DimensionSearchResults model objects.


Constructor Summary
DimensionSearchResultsHandler()
           
 
Method Summary
protected  NavigationState createDimensionSearchNavigationState(NavigationState navigationState)
          Takes the global NavigationState and returns the NavigationState that gets used to submit the dimension search query.
protected  SearchFilter getDimensionSearchFilter(NavigationState navigationState)
          Gets the SearchFilter used for the dimension search.
 void preprocess(DimensionSearchResultsConfig cartridgeConfig)
          Creates a dimension search query if DimensionSearchResultsConfig.isEnabled() returns true.
 DimensionSearchResults process(DimensionSearchResultsConfig cartridgeConfig)
          Returns a DimensionSearchResults if DimensionSearchResultsConfig.isEnabled() is true, and there is at least 1 search term in the NavigationState else returns null.
protected  DimensionSearchResultsConfig wrapConfig(ContentItem pContentItem)
          Wraps the input ContentItem as a typed config object.
 
Methods inherited from class com.endeca.infront.cartridge.NavigationCartridgeHandler
createMdexRequest, dispatchNavigationEventInformation, executeMdexRequest, getActionPathProvider, getContentItemInitializer, getMdexRequestBroker, getNavigationState, initialize, populateNavigationPathDefaults, setActionPathProvider, setContentItemInitializer, setMdexRequestBroker, setNavigationState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DimensionSearchResultsHandler

public DimensionSearchResultsHandler()
Method Detail

wrapConfig

protected DimensionSearchResultsConfig wrapConfig(ContentItem pContentItem)
Description copied from class: NavigationCartridgeHandler
Wraps the input ContentItem as a typed config object. It is not expected that subclasses will mutate the input ContentItem, beyond passing it into their typed configuration class as a constructor argument.

Specified by:
wrapConfig in class NavigationCartridgeHandler<DimensionSearchResultsConfig,DimensionSearchResults>
Parameters:
pContentItem - the configuration for this cartridge handler. This will either be the fully initialized configuration object, if a ContentItemInitializer has been set, or it will simply be the instance configuration.
Returns:
an instance of ConfigType which wraps the input ContentItem.
See Also:
NavigationCartridgeHandler.initialize(ContentItem), NavigationCartridgeHandler.setContentItemInitializer(ContentItemInitializer)

preprocess

public void preprocess(DimensionSearchResultsConfig cartridgeConfig)
                throws CartridgeHandlerException
Creates a dimension search query if DimensionSearchResultsConfig.isEnabled() returns true.

Specified by:
preprocess in interface CartridgeHandler<DimensionSearchResultsConfig>
Overrides:
preprocess in class NavigationCartridgeHandler<DimensionSearchResultsConfig,DimensionSearchResults>
Parameters:
cartridgeConfig - the cartridge configuration returned by CartridgeHandler.initialize(ContentItem). This cartridge configuration may be modified by this handler. Note that this cartridge configuration is also passed to CartridgeHandler.process(ContentItem).
Throws:
CartridgeHandlerException - if an error occurs that is scoped to an individual cartridge instance. This exception will not halt the entire assembly process, which occurs across multiple cartridges; instead, this exception will be packaged in the overall response model. If an unchecked exception is thrown, then the entire assembly process will be halted.

getDimensionSearchFilter

protected SearchFilter getDimensionSearchFilter(NavigationState navigationState)
Gets the SearchFilter used for the dimension search. By default, this implementation uses the last SearchFilter in the navigationState.getFilterState().getSearchFilters() list.

Parameters:
navigationState - the global NavigationState object

createDimensionSearchNavigationState

protected NavigationState createDimensionSearchNavigationState(NavigationState navigationState)
Takes the global NavigationState and returns the NavigationState that gets used to submit the dimension search query. Since dimension search will apply any SearchFilter objects in the NavigationState as filters to the dimension search, and this cartridge handler implementation uses the last SearchFilter for the dimension search terms, this method removes the last search filter from the NavigationState.

Parameters:
navigationState - the global NavigationState object
Returns:
a modified NavigationState without the last SearchFilter

process

public DimensionSearchResults process(DimensionSearchResultsConfig cartridgeConfig)
                               throws CartridgeHandlerException
Returns a DimensionSearchResults if DimensionSearchResultsConfig.isEnabled() is true, and there is at least 1 search term in the NavigationState else returns null.

Specified by:
process in interface CartridgeHandler<DimensionSearchResultsConfig>
Overrides:
process in class NavigationCartridgeHandler<DimensionSearchResultsConfig,DimensionSearchResults>
Parameters:
cartridgeConfig - the cartridge configuration returned by CartridgeHandler.initialize(ContentItem). Note that this instance may have been modified by the CartridgeHandler.preprocess(ContentItem) method.
Returns:
the output value for this cartridge. If null is returned, then the corresponding node in the output tree will be deleted.
Throws:
CartridgeHandlerException - if an error occurs that is scoped to an individual cartridge instance. This exception will not halt the entire assembly process, which occurs across multiple cartridges; instead, this exception will be packaged in the overall response model. If an unchecked exception is thrown, then the entire assembly process will be halted.


Copyright © 2012, Oracle and/or its affiliates. All rights reserved.