Class DateFieldFill
- java.lang.Object
-
- com.funnelback.publicui.search.model.collection.facetednavigation.CategoryDefinition
-
- com.funnelback.publicui.search.model.collection.facetednavigation.impl.DateFieldFill
-
- All Implemented Interfaces:
MetadataBasedCategory
public class DateFieldFill extends CategoryDefinition implements MetadataBasedCategory
CategoryDefinitionbased on a metadata class containing date values.Will generate multiple values for each value of this metadata class.
- Since:
- 12.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDateFieldFill.ConstraintAndLabel-
Nested classes/interfaces inherited from class com.funnelback.publicui.search.model.collection.facetednavigation.CategoryDefinition
CategoryDefinition.CountSupplier, CategoryDefinition.FacetSearchData, CategoryDefinition.MetadataAndValue, CategoryDefinition.SearchResonseForCountSupplier
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONSTRAINT_AND_LABEL_SEPARATORThis separates the query constraint e.g.private static java.util.regex.PatternCONSTRAINT_AND_LABEL_SEPERATOR_PATTERNprivate java.util.List<QueryProcessorOption<?>>qpOptions-
Fields inherited from class com.funnelback.publicui.search.model.collection.facetednavigation.CategoryDefinition
data, facetName, label, MD_VALUE_SEPARATOR, QS_PARAM_SEPARATOR, subCategories
-
Fields inherited from interface com.funnelback.publicui.search.model.collection.facetednavigation.MetadataBasedCategory
INDEX_FIELD_BOUNDARY, METADATA_ABSENT_PREFIX
-
-
Constructor Summary
Constructors Constructor Description DateFieldFill(java.lang.String metaDataClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallValuesDefinedByUser()Tells you if all the CategoryValues this CategoryDefiniton can produce are ones that must be set on the category by the user.java.util.List<CategoryValueComputedDataHolder>computeData(SearchTransaction st, FacetDefinition facetDefinition)DateFieldFill.ConstraintAndLabelconstraintAndLabelFromCGIValue(java.lang.String value)java.lang.StringconstructCGIValue(java.lang.String queryConstraint, java.lang.String label)Constructs the CGI query value from the query constraint e.g.java.lang.StringgetMetadataClass()java.lang.StringgetQueryConstraint(java.lang.String value)The passed-in value is already a date constraint, so return it as-is.java.util.List<QueryProcessorOption<?>>getQueryProcessorOptions(SearchQuestion question)Get additional query processor options to apply for this category definition.java.lang.StringgetQueryStringCategoryExtraPart()Gets the extra part of the query string param name e.g.private CategoryValueComputedDataHoldermakeValue(java.lang.String label, java.lang.Integer count, boolean selected, java.lang.String queryStringParamValue)booleanmatches(java.lang.String value, java.lang.String extraParams)Given the value of a query string parameter, and any extra parameters, whether this category types is relevant for this parameter.booleanselectedValuesAreNested()-
Methods inherited from class com.funnelback.publicui.search.model.collection.facetednavigation.CategoryDefinition
computeValues, getAllQueryStringParamNames, getData, getFacetName, getFacetSearchData, getLabel, getMatchingFacetSelectedDetails, getQueryStringParamName, getSubCategories, matches, parseMetadata, setData, setFacetedNavProps, setFacetName, setLabel, toString
-
-
-
-
Field Detail
-
qpOptions
private final java.util.List<QueryProcessorOption<?>> qpOptions
-
CONSTRAINT_AND_LABEL_SEPARATOR
public static final java.lang.String CONSTRAINT_AND_LABEL_SEPARATOR
This separates the query constraint e.g. d=2016 from the label e.g. "2016" The separator must be one that does not appear in the query constraint We can not use ascii control chars like 29 (group separator) because XML 1.0 will throw a fit and not all programs work with XML 1.1 for example xmllint. Instead we will just make a separator that I hope will not be in the constraint.- See Also:
- Constant Field Values
-
CONSTRAINT_AND_LABEL_SEPERATOR_PATTERN
private static final java.util.regex.Pattern CONSTRAINT_AND_LABEL_SEPERATOR_PATTERN
-
-
Method Detail
-
computeData
public java.util.List<CategoryValueComputedDataHolder> computeData(SearchTransaction st, FacetDefinition facetDefinition)
- Specified by:
computeDatain classCategoryDefinition
-
makeValue
private CategoryValueComputedDataHolder makeValue(java.lang.String label, java.lang.Integer count, boolean selected, java.lang.String queryStringParamValue)
-
getQueryStringCategoryExtraPart
public java.lang.String getQueryStringCategoryExtraPart()
Gets the extra part of the query string param name e.g. f.| =value. - Specified by:
getQueryStringCategoryExtraPartin classCategoryDefinition- Returns:
-
matches
public boolean matches(java.lang.String value, java.lang.String extraParams)Given the value of a query string parameter, and any extra parameters, whether this category types is relevant for this parameter.
For example: f.By Date|dc.date=2010-01-01:
- value = 2010-01-01
- extra = dc.date
A category of type "metadata fill" for the "dc.date" metadata should return true.
- Specified by:
matchesin classCategoryDefinition- Parameters:
value- The value to check for.extraParams- The extra parameter to check for.- Returns:
- true if this category definition matches, false otherwise.
-
getMetadataClass
public java.lang.String getMetadataClass()
- Specified by:
getMetadataClassin interfaceMetadataBasedCategory- Returns:
- The metadata class for this category type
-
getQueryConstraint
public java.lang.String getQueryConstraint(java.lang.String value)
The passed-in value is already a date constraint, so return it as-is.- Specified by:
getQueryConstraintin interfaceMetadataBasedCategory- Parameters:
value- A date constraint, e.g.d<10Jan2015- Returns:
- The corresponding query constraint (ex: "x:$++ <value> $++", or "v:<value>")
-
constraintAndLabelFromCGIValue
public DateFieldFill.ConstraintAndLabel constraintAndLabelFromCGIValue(java.lang.String value)
-
constructCGIValue
public java.lang.String constructCGIValue(java.lang.String queryConstraint, java.lang.String label)Constructs the CGI query value from the query constraint e.g. d=2008 and the label e.g. 2008- Parameters:
queryConstraint-label-- Returns:
-
getQueryProcessorOptions
public java.util.List<QueryProcessorOption<?>> getQueryProcessorOptions(SearchQuestion question)
Description copied from class:CategoryDefinitionGet additional query processor options to apply for this category definition.
That gives the opportunity to the category definition to add additional QPOs that it may need. QPOs may differ depending if the facet is currently selected or not, such as setting
-count_urlsdynamically depending on the current number of segments in the URL drill down facet- Specified by:
getQueryProcessorOptionsin classCategoryDefinition- Parameters:
question- Can be used to inspect the currently selected facets and return appropriate QPOs- Returns:
- A list of query processor options
-
allValuesDefinedByUser
public boolean allValuesDefinedByUser()
Description copied from class:CategoryDefinitionTells you if all the CategoryValues this CategoryDefiniton can produce are ones that must be set on the category by the user.Values defined by the user are ones like gscopes where values not from the user come from other sources such as metadata.
- Specified by:
allValuesDefinedByUserin classCategoryDefinition- Returns:
- true if all values are defined by the user and not generated from the data.
-
selectedValuesAreNested
public boolean selectedValuesAreNested()
- Specified by:
selectedValuesAreNestedin classCategoryDefinition- Returns:
- true if returned selected values are nested.
-
-