com.day.cq.search.eval
Class DateRangePredicateEvaluator

java.lang.Object
  extended by com.day.cq.search.eval.AbstractPredicateEvaluator
      extended by com.day.cq.search.eval.RangePropertyPredicateEvaluator
          extended by com.day.cq.search.eval.DateRangePredicateEvaluator
All Implemented Interfaces:
PredicateEvaluator

public class DateRangePredicateEvaluator
extends RangePropertyPredicateEvaluator

DateRangePropertyPredicate is a generic evaluator for checking a jcr DATE property against an interval. This uses the ISO8601 format for dates (YYYY-MM-DDTHH:mm:ss.SSSZ) and allows also partial representations (eg. YYYY-MM-DD).

You can define a lower bound and an upper bound or only one of them. The operation (eg. "lesser than" or "lesser or equals") can also be specified for lower and upper bound individually.

Properties:

property
relative path to a DATE property
lowerBound
lower bound to check property for
lowerOperation
">" (default) or ">=", applies to the lowerBound
upperBound
upper bound to check property for
upperOperation
"<" (default) or "<=", applies to the upperBound

Since:
5.2

Field Summary
static String EARLIER_THAN_LAST_YEAR
           
static String LAST_THREE_MONTHS
           
static String LAST_YEAR
           
static String THIS_MONTH
           
static String THIS_WEEK
           
static String THIS_YEAR
           
static String TODAY
           
 
Fields inherited from class com.day.cq.search.eval.RangePropertyPredicateEvaluator
LOWER_BOUND, LOWER_OPERATION, PROPERTY, UPPER_BOUND, UPPER_OPERATION
 
Constructor Summary
DateRangePredicateEvaluator()
           
 
Method Summary
 FacetExtractor getFacetExtractor(Predicate p, EvaluationContext context)
          Default implementation that always returns null, ie.
 String getXPathExpression(Predicate p, EvaluationContext context)
          Default implementation that always returns null, ie.
 
Methods inherited from class com.day.cq.search.eval.RangePropertyPredicateEvaluator
getOrderByProperties, getXPathExpression
 
Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getOrderByComparator, includes, isFiltering
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TODAY

public static final String TODAY
See Also:
Constant Field Values

THIS_WEEK

public static final String THIS_WEEK
See Also:
Constant Field Values

THIS_MONTH

public static final String THIS_MONTH
See Also:
Constant Field Values

LAST_THREE_MONTHS

public static final String LAST_THREE_MONTHS
See Also:
Constant Field Values

THIS_YEAR

public static final String THIS_YEAR
See Also:
Constant Field Values

LAST_YEAR

public static final String LAST_YEAR
See Also:
Constant Field Values

EARLIER_THAN_LAST_YEAR

public static final String EARLIER_THAN_LAST_YEAR
See Also:
Constant Field Values
Constructor Detail

DateRangePredicateEvaluator

public DateRangePredicateEvaluator()
Method Detail

getXPathExpression

public String getXPathExpression(Predicate p,
                                 EvaluationContext context)
Description copied from class: AbstractPredicateEvaluator
Default implementation that always returns null, ie. adds nothing to the XPath query. Subclasses can choose whether they want to implement this method or use the AbstractPredicateEvaluator.includes(Predicate, Row, EvaluationContext) method for advanced filtering (or both).

Specified by:
getXPathExpression in interface PredicateEvaluator
Overrides:
getXPathExpression in class RangePropertyPredicateEvaluator
Parameters:
p - predicate (for this evaluator type) which is evaluated
context - helper class which provides access to various elements of the query evaluation
Returns:
string containing an XPath predicateEvaluator expression

getFacetExtractor

public FacetExtractor getFacetExtractor(Predicate p,
                                        EvaluationContext context)
Description copied from class: AbstractPredicateEvaluator
Default implementation that always returns null, ie. no facets will be extracted for the predicate.

Specified by:
getFacetExtractor in interface PredicateEvaluator
Overrides:
getFacetExtractor in class AbstractPredicateEvaluator
Parameters:
p - predicate (for this evaluator type) which is evaluated
context - helper class which provides access to various elements of the query evaluation
Returns:
a FacetExtractor that is used to create a Facet or null if no extractor shall be provided


Copyright © 2009 Day Management AG. All Rights Reserved.