com.endeca.navigation
Class ENEQueryToolkit

java.lang.Object
  extended by com.endeca.navigation.ENEQueryToolkit

public class ENEQueryToolkit
extends Object

ENEQueryToolkit provides static methods for managing the value of the primary URL query parameter in a navigation query. This parameter specifies the list of refinement dimensions that were used to generate the current query results. Managing the parameter's value allows you to maintain application state.

With ENEQueryToolkit, you can update the list of refinement dimensions to reflect the user's latest refinement selection. That selection may require the addition of a new refinement dimension, the removal of a dimension, or the substitution of one dimension ID for another (as in the case where the user selects a refinement from a nested dimension hierarchy).


Method Summary
static boolean isImplicitRefinement(Dimension dim, DimVal refinement)
          Determines if a dimension value refinement is an implicit refinement within the context of a given dimension.
static DimValIdList removeDescriptor(Navigation n, DimVal descriptor)
          Generates the navigation descriptors of the ENEQuery after removing a descriptor.
static DimValIdList selectAncestor(Navigation n, DimVal ancestor, DimVal descriptor)
          Generates the navigation descriptors of the ENEQuery for a selected ancestor.
static DimValIdList selectRefinement(Navigation n, DimVal refinement)
          Generates the navigation descriptors of the ENEQuery for a selected refinement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

selectRefinement

public static DimValIdList selectRefinement(Navigation n,
                                            DimVal refinement)
Generates the navigation descriptors of the ENEQuery for a selected refinement. This method adds a refinement value to the set of navigation descriptors already existing in a Navigation object and generates a new set of navigation values for the ENEQuery. In general, new refinements are placed at the end of the descriptor list. Existing descriptors that are ancestors of the refinements are removed.

Parameters:
n - the current Navigation object
refinement - the refinement dimension value (DimVal object) that will be used to reduce the current record set
Returns:
a DimValIdList object containing the IDs of the new navigation query descriptors after the addition of the specified refinement value to the existing set of navigation descriptors in the Navigation object.

selectAncestor

public static DimValIdList selectAncestor(Navigation n,
                                          DimVal ancestor,
                                          DimVal descriptor)
Generates the navigation descriptors of the ENEQuery for a selected ancestor. This method replaces the specified navigation descriptor (the descriptor parameter) with the ancestor dimension value (the ancestor parameter), and generates a new set of navigation values for the ENEQuery. The order of the descriptors remains the same as the order in the current Navigation object. However, the specified ancestor is substituted for the specified descriptor.

Parameters:
n - the current Navigation object
ancestor - the ancestor (a DimVal object) which will be used to generate new navigation values
descriptor - the descriptor (a DimVal object) which will be replaced with its ancestor
Returns:
a DimValIdList object containing the IDs of the new navigation query descriptors after the current navigation descriptor is replaced with its ancestor.

removeDescriptor

public static DimValIdList removeDescriptor(Navigation n,
                                            DimVal descriptor)
Generates the navigation descriptors of the ENEQuery after removing a descriptor. This method removes the specified navigation descriptor (the descriptor parameter) from the set of descriptors in the Navigation object and generates a new set of navigation values for the ENEQuery. The order of the descriptors in the new navigation query remains the same as the order in the current Navigation object (specified by the n parameter), with the descriptor removed. Ancestors of the descriptor do not remain after the descriptor has been removed.

Parameters:
n - the current Navigation object
descriptor - the descriptor (a DimVal object) which will be removed
Returns:
a DimValIdList object containing the IDs of the new navigation query descriptors after the removal of the specified descriptor.

isImplicitRefinement

public static boolean isImplicitRefinement(Dimension dim,
                                           DimVal refinement)
Determines if a dimension value refinement is an implicit refinement within the context of a given dimension. An implicit refinement is one that is assigned to all records visible in the current navigation state. In other words, an implicit refinement is one whose selection will not actually narrow the current set of result records.

Parameters:
dim - the dimension (a Dimension object) in which the given refinement should be checked
refinement - the refinement (a DimVal object) which will be checked
Returns:
true if refinement is an implicit refinement within the dimension dim, or false otherwise.


2010 Endeca Technologies, Inc.
Endeca Confidential