Front-end application developers who wish to display disabled refinements need to introduce a specific front-end application code that augments queries with the configuration for disabled refinements.
The MDEX Engine computes the refinements that must be returned based on two navigation states:
The base navigation state. This is the regular navigation state with some of the top-level filters removed.
Note
In this context, filters refer to the previously chosen range filters, record filters, EQL filters, text searches, and dimensions (including multiselect-OR dimensions) that act as filters for the current navigation state.
The default navigation state. This is the navigation state against which the MDEX Engine computes all operations other than those it needs to compute for returning disabled refinements.
The MDEX Engine computes disabled refinements using the following logic:
Typically, the MDEX Engine computes refinements and other portions of the response that define the current navigation state based on records that have passed various top-level filters. This section discusses top-level filters, and explains how selections in each of them affect the base navigation state.
The top-level filters can be one of the following:
The following diagram shows these filters:
When the front-end application users make their selections, they can choose items from each of these filters. To compute results for the base navigation state, the MDEX Engine then decides whether to include or remove these filters.
Within each of these filters, users can make multiple selections. For example, for a given Dimension 1, users can make one or more selections, such as DS1, DS2, or DS3. Similarly, they can make more than one selection with text search, or within a specific range filter. It is important to note how the granularity of these choices affects the base navigation state: All selections (and not some) from a given dimension are removed from the base navigation state. Similarly, all text searches and all range filters (and not some) are removed from the base navigation state.
Use the
DisabledRefinementsConfig
class to display disabled
refinement results. The MDEX Engine returns disabled refinements together with
the query results.
The methods of this class enable you to specify various parts of the base navigation state. (The MDEX Engine uses the base navigation state to compute disabled refinements.) For example, using the methods from this class, you can specify the following parts of your current navigation state:
In addition, the following two methods of the ENEQuery class are used for disabled refinements:
Note
If you do not call these methods, the MDEX Engine does not return disabled refinements.
For more information about this class and methods, see the Oracle Commerce Presentation API for Java Reference (Javadoc).
Example 37. Java example
The following example illustrates the front-end application code required for returning disabled refinements along with the query results:
ENEQuery query = new ENEQuery(); // ... // Set up other query parameters appropriately // ... DisabledRefinementsConfig drCfg = new DisabledRefinementsConfig(); // Include text searches in base navigation state drCfg.setTextSearchesInBase(true); // Include navigation selections from the dimension with ID 100000 in base navigation state drCfg.setDimensionInBase(100000, true); // Provide the disabled refinements configuration query.setNavDisabledRefinementsConfig(drCfg);
The
DisabledRefinementsConfig
class lets you configure
disabled refinement results which are returned with the query results.
In addition, use the following property of the ENEQuery class to
configure the display of disabled
refinements:ENEQuery.Nav.DisabledRefinementsConfig
For more information about this class and property, see the Oracle Commerce API Guide for .NET.
Example 38. .NET example
The following example illustrates the front-end application code required for returning disabled refinements along with the query results:
ENEQuery query = new ENEQuery(); // ... // set up other query parameters appropriately // ... DisabledRefinementsConfig drCfg = new DisabledRefinementsConfig(); // Include text searches in base navigation state drCfg.TextSearchInBase = true; // Include navigation selections from the dimension with ID 100000 in base navigation state drCfg.setDimensionInBase(100000, true); // Provide the disabled refinements configuration query.NavDisabledRefinementsConfig = drCfg;