The ATG Platform and Commerce Reference Store use Oracle Endeca’s existing ResultsList
cartridge with some extensions to the cartridge’s handler class, described below.
The atg.endeca.assembler.cartridge.handler.ResultsListHandler
class overrides the com.endeca.infront.cartridge.ResultsListHandler
class and includes an additional sorters
property of type atg.Nucleus.ServiceMap
. The keys of this ServiceMap
are labels for the sorting options and the values are the components that perform the actual sorting. Out of the box, the CommerceReferenceStore
module sets the ResultsList
component sorters
property as follows:
sorters=\ Option1=/atg/endeca/assembler/cartridge/sort/Relevance,\ Option2=/atg/endeca/assembler/cartridge/sort/NameAscending,\ Option3=/atg/endeca/assembler/cartridge/sort/NameDescending,\ Option4=/atg/endeca/assembler/cartridge/sort/PriceAscending,\ Option5=/atg/endeca/assembler/cartridge/sort/PriceDescending
The atg.endeca.assembler.cartridge.handler.ResultsListHandler.setSorters()
method transforms the sorters
ServiceMap
into a List
of com.endeca.infront.cartridge.model.SortOptionConfig
components. It then passes that List
when it calls the com.endeca.infront.cartridge.model.SortOptionConfig.setSortOptions()
method to set the sort options. This technique of creating a ServiceMap
and then using it to create a List
of components is necessary because Nucleus cannot set Lists
of components directly.