Interface CriterionDefinition<T>

Type Parameters:
T - Type of the criterion value
All Superinterfaces:
Comparable<ModelItem>, ElementDefinition<T>, Labelable, ModelItem, ModifiableLabelable
All Known Subinterfaces:
ContentTypesAwareCriterionDefinition, LanguageAwareCriterionDefinition, SearchModelCriterionDefinition<T>, SearchServiceCriterionDefinition<T>
All Known Implementing Classes:
AbstractCriterionDefinition, AbstractSearchServiceCriterionDefinition, AbstractStaticSearchModelCriterionDefinition, CompatibleRegimesCriterionDefinition, ContentPrivacyCriterionDefinition, ContentReferencingSearchModelCriterionDefinition, ContentReferencingSearchServiceCriterionDefinition, ContentSearchModelCriterionDefinition, ContentTypesAwareReferencingCriterionDefinition, DefaultSearchModelCriterionDefinition, DegreeUniversityCriterionDefinition, DublinCoreCriterionDefinition, LanguageAwareReferencingCriterionDefinition, ODFContributorOrManagerCriterionDefinition, PageCriterionDefinition, PageCriterionDefinition, PageTitleCriterionDefinition, ProgramItemContextCriterionDefinition, ReferencingAggregatorCriterionDefinition, ReferencingCriterionDefinition, ReferencingSearchModelCriterionDefinition, ReferencingSearchServiceCriterionDefinition, ResourceFormatCriterionDefinition, ShareableCourseCriterionDefinition, ShareableCoursePartCriterionDefinition, SiteCriterionDefinition, SitemapCriterionDefinition, SolrFilterCriterionDefinition, StaticContentReferencingSearchModelCriterionDefinition, StaticContentTypesAwareReferencingCriterionDefinition, StaticLanguageAwareReferencingCriterionDefinition, StaticReferencingSearchModelCriterionDefinition, StaticSolrFilterCriterionDefinition, TagCriterionDefinition, TitleOrWordingCriterionDefinition, WordingCriterionDefinition

public interface CriterionDefinition<T> extends ElementDefinition<T>
Represents the definition of a criterion definition
  • Method Details

    • getQuery

      default Query getQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)
      Gets the Query associated to the given value
      Parameters:
      value - The user-submitted value (or the default value if not set) for this criterion.
      operator - In advanced search mode, the operator chosen by the user. null to use the criterion-defined operator (simple search mode).
      language - The current search language.
      contextualParameters - the search contextual parameters.
      Returns:
      the Query associated to the given value
    • getQuery

      default Query getQuery(Object value, Map<String,Object> allValues, String language, Map<String,Object> contextualParameters)
      Get the Query associated to the given value.
      Parameters:
      value - The user-submitted value (or the default value if not set) for this criterion.
      allValues - All the user-submitted values.
      language - The current search language.
      contextualParameters - the search contextual parameters.
      Returns:
      Query associated to the given value.
    • getQuery

      Query getQuery(Object value, Query.Operator operator, Map<String,Object> allValues, String language, Map<String,Object> contextualParameters)
      Get the Query associated to the given value.
      Parameters:
      value - The user-submitted value (or the default value if not set) for this criterion.
      operator - In advanced search mode, the operator chosen by the user. null to use the criterion-defined operator (simple search mode).
      allValues - All the user-submitted values.
      language - The current search language.
      contextualParameters - the search contextual parameters.
      Returns:
      Query associated to the given value.
    • convertQueryValue

      Object convertQueryValue(Object value, Map<String,Object> contextualParameters)
      Converts the given value to have the right typed for value to give to the getQuery(Object, Map, String, Map) method
      Parameters:
      value - the value to convert
      contextualParameters - the search contextual parameters.
      Returns:
      the value, converted to a well typed value
    • getSolrFacetFieldName

      String getSolrFacetFieldName(Map<String,Object> contextualParameters)
      Retrieves the name of the criterion's solr facet field
      Parameters:
      contextualParameters - the search contextual parameters.
      Returns:
      the name of the criterion's solr facet field. Can be null if the criterion is not facetable
    • getJoinedPaths

      List<String> getJoinedPaths(Map<String,Object> contextualParameters)
      Retrieves the joined paths of the criterion
      Parameters:
      contextualParameters - the search contextual parameters.
      Returns:
      the joined paths, or an empty list if the criterion is not joined
    • getType

      Description copied from interface: ModelItem
      Retrieves the type.
      Specified by:
      getType in interface ElementDefinition<T>
      Specified by:
      getType in interface ModelItem
      Returns:
      the type.