The atg.projects.store.assembler.cartridge.PriceSliderContentItem
class represents the content item that the PriceSlider
cartridge returns to the renderer. The PriceSliderContentItem
class has these properties:
filterCrumb
: This property references thecom.endeca.infront.cartridge.model.RangeFilterBreadcrumb
object that is created by thePriceSliderHandler
whenever price slider settings have been applied for the current query. Continue reading below for more information on this object and how it is used.priceProperty
: This property references the record property that the slider is based on which, in this case, issku.activePrice
.sliderMin
: Specifies the lower end point for the price slider.sliderMax
: Specifies the upper end point for the price slider.enabled
: Indicates whether the price slider should be rendered. When this property is set totrue
, the slider is rendered. When it is set tofalse
, it is not rendered. ThePriceSliderHandler
sets this property based on the number of results returned for the query. If 0 or 1 result is returned,PriceSliderHandler
sets this property to false.
The /atg/endeca/assembler/cartridge/handler/PriceSlider
component, which is of class atg.projects.store.assembler.cartridge.handler.PriceSliderHandler
, is responsible for creating and populating the PriceSliderContentItem
object. The PriceSliderHandler
class is an extension of the com.endeca.infront.cartridge.NavigationCartridgeHandler
class and it overwrites the preprocess()
and process()
methods.
The PriceSliderHandler.preprocess()
method creates an MDEX request but does not execute it. The process()
method executes the MDEX request to get the search results. It also retrieves the current com.endeca.infront.navigation.NavigationState
object using the /atg/endeca/assembler/cartridge/manager/NavigationState
component referenced by the PriceSliderHandler
component’s navigationStateProperty
. The NavigationState
object contains the navigation choices that have led to the current result set, including any range filters that have been applied and the properties those range filters have been applied to. If an existing range filter has been applied to the sku.activePrice
property, it is an indicator that the price slider has already been applied to the current result set and the rendering of the price slider must take into account the existing settings. To do this, the PriceSliderHandler
creates a com.endeca.infront.cartridge.model.RangeFilterBreadcrumb
object and populates it with data from the range filter. Specifically, the RangeFilterBreadcrumb
includes:
The name of the property the range filter was applied to, the
sku.activePrice
property.The operation name, in this case,
BTWN
for the between operation.The upper and lower bounds of the range filter.
The PriceSliderHandler
then sets the PriceSliderContentItem.filterCrumb
property to reference this RangeFilterBreadcrumb
object, thereby making the existing slider settings available to the JSP renderer.
The PriceSliderHandler
also sets the slider end points by retrieving the priceSliderMaximumValue
and priceSliderMinimumValue
properties for the currently searched site (or sites) from the Site repository. The priceSliderMaximumValue
and priceSliderMinimumValue
properties are site-specific and can be configured through the Site Administration UI. If the current results come from more than one site, the PriceSliderHandler
uses the lowest priceSliderMinimumValue
and the highest priceSliderMaximumValue
from the sites. If no values have been set, PriceSliderHandler
uses the defaults of 0 and 1500 for the minimum and maximum values, respectively.
Finally, the PriceSliderHandler
evaluates the number of results returned for the query and sets the PriceSliderContentItem.enabled
property to true
if there is more than one result and false
if there is 0 or 1 result.
The PriceSlider
component has the following configurable properties:
storeSitePropertiesManager
: Specifies the component thatPriceSliderHandler
uses to retrieve the names of the site properties that store the slider minimum and slider maximum values.PriceSliderHandler
then queries the sites, uses these names, to get the values. Out of the box, this property is set to/atg/multisite/StoreSitePropertiesManager
.searchedSites
: Specifies the component thatPriceSliderHandler
uses to determine which sites have contributed records to the current results set.siteManager
: Specifies the component thatPriceSliderHandler
uses to retrieve sites from the Site repository.
The PriceSlider
component also inherits a number of properties from the /atg/endeca/assembler/cartridge/handler/NavigationCartridgeHandler
component, through a $basedOn
property configuration. Specifically, PriceSlider
inherits a reference to the /atg/endeca/assembler/cartridge/manager/NavigationState
component that provides information on the shopper’s current navigation state.