com.endeca.portal.data.functions
Class RefinementFilter

java.lang.Object
  extended by com.endeca.portal.data.functions.QueryFunction
      extended by com.endeca.portal.data.functions.QueryFilter
          extended by com.endeca.portal.data.functions.RefinementFilter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class RefinementFilter
extends QueryFilter

Defines a single refinement (essentially represents a DimVal and its path) to be added to a QueryState.

See Also:
Serialized Form

Nested Class Summary
static class RefinementFilter.MultiSelect
           
 
Field Summary
static java.lang.String JSON_CONFIG_DIM_VAL_ID
           
static java.lang.String JSON_CONFIG_DIMENSION_ID
           
static java.lang.String JSON_CONFIG_MULTI_SELECT
           
static java.lang.String JSON_CONFIG_NAVIGABLE
           
 
Fields inherited from class com.endeca.portal.data.functions.QueryFunction
CLASS_PROPERTY
 
Constructor Summary
protected RefinementFilter()
          Empty constructor is not public, to nudge users toward one of the more useful constructors.
  RefinementFilter(java.lang.String attributeValue, java.lang.String attributeKey)
          Constructs a refinement filter with the specified attributeValue and attributeKey ID, defaulting to multiselect "none" and defaulting navigable to "true."
  RefinementFilter(java.lang.String attributeValue, java.lang.String attributeKey, RefinementFilter.MultiSelect multiSelect)
          Constructs a refinement filter with the specified attributeValue and attributeKey ID, and multiselect value and defaulting navigable to "true."
  RefinementFilter(java.lang.String attributeValue, java.lang.String attributeKey, RefinementFilter.MultiSelect multiSelect, boolean navigable)
          Constructs a refinement filter with the specified attributeValue and attributeKey ID, multiselect value and navigable value.
 
Method Summary
 void applyToDiscoveryServiceQuery(com.endeca.mdex.conversation.Request query)
          Apply this function to a Request.
 void beforeQueryStateAdd(QueryState state)
          Checks to see if other is either single select on the same attribute or a duplicate multi select refinement, and if one is found we remove the function in the query state.
 java.lang.String getAttributeKey()
           
 java.lang.String getAttributeValue()
           
 java.lang.String getDimensionId()
          Deprecated. As of Latitude 2.1, replaced by getAttributeKey()
 java.lang.String getDimValId()
          Deprecated. As of Latitude 2.1, replaced by getAttributeValue()
 RefinementFilter.MultiSelect getMultiSelect()
           
 boolean isMultiSelectAnd()
           
 boolean isMultiSelectOr()
           
 boolean isNavigable()
           
 boolean isSingleSelect()
           
 void setAttributeKey(java.lang.String attributeKey)
           
 void setAttributeValue(java.lang.String attributeValue)
           
 void setDimensionId(java.lang.String dimensionId)
          Deprecated. As of Latitude 2.1, replaced by setAttributeKey(String)
 void setDimValId(java.lang.String dimValId)
          Deprecated. As of Latitude 2.1, replaced by setAttributeValue(String)
 void setMultiSelect(RefinementFilter.MultiSelect multiSelect)
           
 void setNavigable(boolean navigable)
           
 java.lang.String toString()
          This class' toString is abstract: all concrete subclasses are expected to provide an implementation. toString is used in comparing QueryFunction instances for equality, so if you implement a QueryFunction subclass it is important that your toString implementation be consistent and deterministic.
 
Methods inherited from class com.endeca.portal.data.functions.QueryFunction
clone, equals, equals, getName, hashCode, initializeFromJSON, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

JSON_CONFIG_DIM_VAL_ID

public static final java.lang.String JSON_CONFIG_DIM_VAL_ID
See Also:
Constant Field Values

JSON_CONFIG_DIMENSION_ID

public static final java.lang.String JSON_CONFIG_DIMENSION_ID
See Also:
Constant Field Values

JSON_CONFIG_MULTI_SELECT

public static final java.lang.String JSON_CONFIG_MULTI_SELECT
See Also:
Constant Field Values

JSON_CONFIG_NAVIGABLE

public static final java.lang.String JSON_CONFIG_NAVIGABLE
See Also:
Constant Field Values
Constructor Detail

RefinementFilter

protected RefinementFilter()
Empty constructor is not public, to nudge users toward one of the more useful constructors.


RefinementFilter

public RefinementFilter(java.lang.String attributeValue,
                        java.lang.String attributeKey)
Constructs a refinement filter with the specified attributeValue and attributeKey ID, defaulting to multiselect "none" and defaulting navigable to "true."

Parameters:
attributeValue -
attributeKey -

RefinementFilter

public RefinementFilter(java.lang.String attributeValue,
                        java.lang.String attributeKey,
                        RefinementFilter.MultiSelect multiSelect)
Constructs a refinement filter with the specified attributeValue and attributeKey ID, and multiselect value and defaulting navigable to "true."

Parameters:
attributeValue -
attributeKey -
multiSelect -

RefinementFilter

public RefinementFilter(java.lang.String attributeValue,
                        java.lang.String attributeKey,
                        RefinementFilter.MultiSelect multiSelect,
                        boolean navigable)
Constructs a refinement filter with the specified attributeValue and attributeKey ID, multiselect value and navigable value.

Parameters:
attributeValue -
attributeKey -
multiSelect -
navigable -
Method Detail

getAttributeValue

public java.lang.String getAttributeValue()

setAttributeValue

public void setAttributeValue(java.lang.String attributeValue)

getDimValId

@Deprecated
public java.lang.String getDimValId()
Deprecated. As of Latitude 2.1, replaced by getAttributeValue()


setDimValId

@Deprecated
public void setDimValId(java.lang.String dimValId)
Deprecated. As of Latitude 2.1, replaced by setAttributeValue(String)


getAttributeKey

public java.lang.String getAttributeKey()

setAttributeKey

public void setAttributeKey(java.lang.String attributeKey)

getDimensionId

@Deprecated
public java.lang.String getDimensionId()
Deprecated. As of Latitude 2.1, replaced by getAttributeKey()


setDimensionId

@Deprecated
public void setDimensionId(java.lang.String dimensionId)
Deprecated. As of Latitude 2.1, replaced by setAttributeKey(String)


getMultiSelect

public RefinementFilter.MultiSelect getMultiSelect()

setMultiSelect

public void setMultiSelect(RefinementFilter.MultiSelect multiSelect)

isNavigable

public boolean isNavigable()

setNavigable

public void setNavigable(boolean navigable)

isMultiSelectOr

public boolean isMultiSelectOr()

isMultiSelectAnd

public boolean isMultiSelectAnd()

isSingleSelect

public boolean isSingleSelect()

applyToDiscoveryServiceQuery

public void applyToDiscoveryServiceQuery(com.endeca.mdex.conversation.Request query)
                                  throws QueryFunctionUnsupportedException
Description copied from class: QueryFunction
Apply this function to a Request. Must be implemented by subclass.

Specified by:
applyToDiscoveryServiceQuery in class QueryFunction
Throws:
QueryFunctionUnsupportedException

toString

public java.lang.String toString()
Description copied from class: QueryFunction
This class' toString is abstract: all concrete subclasses are expected to provide an implementation. toString is used in comparing QueryFunction instances for equality, so if you implement a QueryFunction subclass it is important that your toString implementation be consistent and deterministic.

Specified by:
toString in class QueryFunction

beforeQueryStateAdd

public void beforeQueryStateAdd(QueryState state)
Checks to see if other is either single select on the same attribute or a duplicate multi select refinement, and if one is found we remove the function in the query state.

Overrides:
beforeQueryStateAdd in class QueryFunction