com.endeca.portal.data.functions
Class NegativeRefinementFilter

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.NegativeRefinementFilter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class NegativeRefinementFilter
extends QueryFilter

NegativeRefinementFilter provides a function for filtering out all records associated with a refinement. This filter applies to the MDEX query as a NOT record filter for the specified dimension and dimension value (e.g. NOT(Vintage:1992).

Author:
Endeca Technologies, Inc.
See Also:
Serialized Form

Field Summary
static java.lang.String JSON_CONFIG_ANCESTORS
           
static java.lang.String JSON_CONFIG_DIM_VAL_NAME
           
static java.lang.String JSON_CONFIG_DIMENSION_NAME
           
static java.lang.String JSON_CONFIG_NAME
           
static java.lang.String PASSTHROUGH_NEGATIVE_REFINEMENT_FILTER
           
static java.lang.String PASSTHROUGH_RECORD_FILTER_INFO
           
 
Fields inherited from class com.endeca.portal.data.functions.QueryFunction
CLASS_PROPERTY, operator
 
Constructor Summary
protected NegativeRefinementFilter()
          Empty constructor is not public, to nudge users toward one of the more useful constructors.
  NegativeRefinementFilter(com.endeca.navigation.Dimension dim, com.endeca.navigation.DimVal dimVal)
          Convenience constructor for creating a NegativeRefinementFilter from Dimension and DimVal objects in the presentation API.
  NegativeRefinementFilter(org.json.JSONObject jsonObject)
          Constructs a NegativeRefinementFilter from its JSON representation.
  NegativeRefinementFilter(java.lang.String dimensionName, java.lang.String dimValName)
           
 
Method Summary
 void applyToDiscoveryServiceQuery(com.endeca.mdex.conversation.Request query)
          Apply this function to a Request.
 void applyToENEQuery(com.endeca.navigation.ENEQuery query)
          Apply this function to an ENEQuery.
 java.util.List<java.lang.String> getAncestors()
           
static java.util.List<java.lang.String> getAncestors(com.endeca.mdex.conversation.Results results, java.lang.String dimension, java.lang.String dimVal)
          Returns the ancestors of a specific dimension from a NegativeRefinementFilter returned in a V7 Results object.
 java.lang.String getDimensionName()
           
 java.lang.String getDimValName()
           
 java.util.List<java.lang.reflect.Method> getGetters()
          Return the list of property getters on this function.
static java.util.List<NegativeRefinementFilter> getNegativeRefinements(com.endeca.mdex.conversation.Request request)
          Gets the RecordFilterInfo passthrough element, and finds the NegativeRefinementFilter elements from a request object
static java.util.List<NegativeRefinementFilter> getNegativeRefinements(com.endeca.mdex.conversation.Results results)
          Gets the RecordFilterInfo passthrough element, and finds the NegativeRefinementFilter elements from the V7 results object.
 java.util.List<java.lang.reflect.Method> getSetters()
          Return the list of property setters on this function.
 void setAncestors(java.util.List<java.lang.String> ancestors)
           
 void setAncestors(java.lang.String ancestors)
           
 void setDimensionName(java.lang.String dimensionName)
           
 void setDimValName(java.lang.String dimValName)
           
 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, getInstance, getInstance, getName, getOperator, hashCode, init, setName, setOperator, setOperator, toJSON, toXML
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

JSON_CONFIG_NAME

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

JSON_CONFIG_DIM_VAL_NAME

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

JSON_CONFIG_DIMENSION_NAME

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

JSON_CONFIG_ANCESTORS

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

PASSTHROUGH_RECORD_FILTER_INFO

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

PASSTHROUGH_NEGATIVE_REFINEMENT_FILTER

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

NegativeRefinementFilter

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


NegativeRefinementFilter

public NegativeRefinementFilter(java.lang.String dimensionName,
                                java.lang.String dimValName)

NegativeRefinementFilter

public NegativeRefinementFilter(com.endeca.navigation.Dimension dim,
                                com.endeca.navigation.DimVal dimVal)
Convenience constructor for creating a NegativeRefinementFilter from Dimension and DimVal objects in the presentation API.

Parameters:
dim - Dimension object
dimVal - Dimension value

NegativeRefinementFilter

public NegativeRefinementFilter(org.json.JSONObject jsonObject)
                         throws org.json.JSONException,
                                java.lang.IllegalArgumentException,
                                java.lang.ClassNotFoundException,
                                java.lang.IllegalAccessException,
                                java.lang.InstantiationException,
                                java.lang.reflect.InvocationTargetException
Constructs a NegativeRefinementFilter from its JSON representation.

Parameters:
jsonObject - JSON representation of the NegativeRefinementFilter.
Throws:
org.json.JSONException - Thrown if an error occurs while constructing the JSONObject.
java.lang.IllegalArgumentException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
Method Detail

getSetters

public java.util.List<java.lang.reflect.Method> getSetters()
Description copied from class: QueryFunction
Return the list of property setters on this function. Must be implemented by subclass. Required for correct JSON serialization/deserialization support. For most subclasses, implementing this method should be simple, as long as your setter methods follow standard Java naming conventions (e.g. "setPropertyName(PropertyType)"). All you should need to write is:
 private static List setters = Reflection.getSetters(MyFunctionClass.class);
 \@Override
 public List getSetters() {
        return setters;
 }
 

Specified by:
getSetters in class QueryFunction
Returns:
the list of setters

getGetters

public java.util.List<java.lang.reflect.Method> getGetters()
Description copied from class: QueryFunction
Return the list of property getters on this function. Must be implemented by subclass. Required for correct JSON serialization/deserialization support. For most subclasses, implementing this method should be simple, as long as your getter methods follow standard Java naming conventions (e.g. "getPropertyName()"). All you should need to write is:
 private static List getters = Reflection.getGetters(MyFunctionClass.class);
 \@Override
 public List getGetters() {
        return getters;
 }
 

Specified by:
getGetters in class QueryFunction
Returns:
the list of getters

getDimValName

public java.lang.String getDimValName()

setDimValName

public void setDimValName(java.lang.String dimValName)

getDimensionName

public java.lang.String getDimensionName()

setDimensionName

public void setDimensionName(java.lang.String dimensionName)

getAncestors

public java.util.List<java.lang.String> getAncestors()

setAncestors

public void setAncestors(java.util.List<java.lang.String> ancestors)

setAncestors

public void setAncestors(java.lang.String ancestors)

applyToENEQuery

public void applyToENEQuery(com.endeca.navigation.ENEQuery query)
Description copied from class: QueryFunction
Apply this function to an ENEQuery. Must be implemented by subclass.

Specified by:
applyToENEQuery in class QueryFunction

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

getNegativeRefinements

public static java.util.List<NegativeRefinementFilter> getNegativeRefinements(com.endeca.mdex.conversation.Results results)
Gets the RecordFilterInfo passthrough element, and finds the NegativeRefinementFilter elements from the V7 results object.

Parameters:
results -
Returns:

getNegativeRefinements

public static java.util.List<NegativeRefinementFilter> getNegativeRefinements(com.endeca.mdex.conversation.Request request)
Gets the RecordFilterInfo passthrough element, and finds the NegativeRefinementFilter elements from a request object

Parameters:
results -
Returns:

getAncestors

public static java.util.List<java.lang.String> getAncestors(com.endeca.mdex.conversation.Results results,
                                                            java.lang.String dimension,
                                                            java.lang.String dimVal)
Returns the ancestors of a specific dimension from a NegativeRefinementFilter returned in a V7 Results object.

Parameters:
results -
dimension -
dimVal -
Returns: