Interface ContentFilter

All Known Subinterfaces:
WebContentFilter
All Known Implementing Classes:
DefaultContentFilter, DefaultWebContentFilter, EventsFilter, StaticContentFilter, StaticWebContentFilter

public interface ContentFilter
This interface represents a filter for Content
  • Method Details

    • getId

      Get the filter id
      Returns:
      The filter id
    • setId

      void setId(String id)
      Set the filter id.
      Parameters:
      id - The id to set.
    • getContentTypes

      Get the content types to match contents
      Returns:
      The content types to match contents
    • addContentType

      void addContentType(String cTypeId)
      Add a content type to the filter
      Parameters:
      cTypeId - The content type id to add
    • getMetadataValues

      Get the content types to match contents
      Returns:
      The content types to match contents
    • getMetadataCondition

      The metadata condition
      Returns:
      The metadata condition
    • addMetadata

      void addMetadata(String metadataId, String value)
      Add a metadata filter
      Parameters:
      metadataId - The metadata id.
      value - The value to test. Set null to test existence
    • setMetadataCondition

      Set the metadata condition
      Parameters:
      condition - The condition to set
    • getAdditionalFilterExpression

      Get the current filter expression
      Returns:
      The expression. Can be null.
    • setAdditionalFilterExpression

      Set the filter expression that should complete metadata filtering (by doing an AND between both)
      Parameters:
      expression - The expression to set. Can be null to remove curren expression
    • getContextLanguage

      Get the context language
      Returns:
      The context language
    • setContextLanguage

      Set the context language
      Parameters:
      context - The context language to set
    • getView

      Get the name of View used for matching contents
      Returns:
      The name of View used for matching contents
    • setView

      void setView(String viewName)
      Set the filter view
      Parameters:
      viewName - The name of View
    • getLength

      int getLength()
      Get the max number of results
      Returns:
      The max number of results
    • setLength

      void setLength(int length)
      Set the max number o results
      Parameters:
      length - The max number of results
    • getSortCriteria

      Get the sort criteria allows to sort query results.
      Returns:
      the sort criteria
    • addSortCriteria

      void addSortCriteria(String metadataId, boolean ascending, boolean useLowerCase)
      Add a sort criteria
      Parameters:
      metadataId - The metadata id to sort
      ascending - true to ascending sort
      useLowerCase - true for case insensitive order on a string property
    • setResolver

      Set the ametys object resolver to execute query
      Parameters:
      resolver - The ametys object resolver to set
    • getMatchingContents

      Get the contents matching this filter.
      Returns:
      The matching contents.
    • getMatchingContents

      Get the contents matching this filter.
      Parameters:
      lang - The current language.
      Returns:
      The matching contents.