Class Name |
|
---|---|
Component |
|
This servlet bean takes as input a facet selection value and the repository ID of the refinementElement
that represents the facet, and outputs the value in a more human-readable form. The value is formatted by the /atg/commerce/search/refinement/DefaultMetaPropertyValueFormatter
component, which is specified by the defaultValueFormatter
property of the servlet bean.
The DefaultMetaPropertyValueFormatter
formats the following data types:
For a repository ID property (e.g.,
childSKUs.$repositoryId
), it returns the item display name.For a date property (e.g.,
creationDate
), it returns a locale-specific date string.For an enumerated property (e.g.,
stockAvailabilityStatus
), it returns the display name of the enumerated value.For a Boolean property (e.g.,
onSale
) it looks in a resource bundle for a key of the formatproperty-name
_0
(forfalse
) orproperty-name
_1
(fortrue
), and returns the string associated with that key. For example, for anonSale
property, the keys would beonSale_0
andonSale_1
. If the key is not found, the value is returned unchanged. The resource bundle is specified by theresourceBundle
property of theDefaultMetaPropertyValueFormatter
component.
You can also write custom formatters for specific properties. For more information, see the Faceted Search chapter.
Input Parameters
refinementId
The repository ID of the refinementElement
that represents the facet in the refinement repository.
refinementValue
The facet value returned by the search engine.
Output Parameter
displayValue
The formatted value.
Open Parameters
output
This open parameter is rendered if no errors occur when formatting the value.
error
This open parameter is rendered if any errors occur when formatting the value.
Example
<dsp:droplet name="/atg/commerce/search/refinement/RefinementValueDroplet"> <dsp:param name="refinementId" value="${facetHolder.facet.id}"/> <dsp:param name="refinementValue" value="${facetValueNode.facetValue.value}"/> <dsp:oparam name="output"> <dsp:valueof param="displayValue"/> </dsp:oparam> </dsp:droplet>