Interface SearchModel

All Superinterfaces:
Model, ModelItemAccessor, ModelItemContainer
All Known Subinterfaces:
SearchUIModel
All Known Implementing Classes:
DefaultSearchModel, DefaultSearchUIModel, ReferenceTableSearchUIModel, ReferencingContentsWithSameValuesSearchUIModel, SearchModelWrapper, StaticSearchUIModel

public interface SearchModel extends Model
This interface represents a search model.
  • Method Details

    • getContentTypes

      Set<String> getContentTypes(Map<String,Object> contextualParameters)
      Get the list of content types.
      Parameters:
      contextualParameters - the contextual parameters.
      Returns:
      The list of content types.
    • getExcludedContentTypes

      Get the list of excluded content types.
      Parameters:
      contextualParameters - the contextual parameters
      Returns:
      The list of excluded content types.
    • getCriteria

      ViewItemContainer getCriteria(Map<String,Object> contextualParameters)
      Retrieves the criteria in simple mode
      Parameters:
      contextualParameters - the contextual parameters
      Returns:
      the criteria in simple mode
    • getCriterion

      default ModelViewItem getCriterion(String name, Map<String,Object> contextualParameters)
      Retrieves the simple criterion with the given name
      Parameters:
      name - The name of the criterion to retrieve
      contextualParameters - the contextual parameters
      Returns:
      the criterion or null if not found
    • addCriterion

      default void addCriterion(SearchModelCriterionDefinition criterion, Map<String,Object> contextualParameters)
      Add the given criterion to the simple criteria
      Parameters:
      criterion - the criterion to add
      contextualParameters - the contextual parameters
    • getFacetedCriteria

      Retrieves the faceted criteria.
      Parameters:
      contextualParameters - the contextual parameters
      Returns:
      the faceted criteria.
    • getFacetedCriterion

      default ModelViewItem getFacetedCriterion(String name, Map<String,Object> contextualParameters)
      Retrieves the faceted criterion with the given name
      Parameters:
      name - The name of the faceted criterion to retrieve
      contextualParameters - the contextual parameters
      Returns:
      the faceted criterion or null if not found
    • addFacetedCriterion

      default void addFacetedCriterion(SearchModelCriterionDefinition criterion, Map<String,Object> contextualParameters)
      Add the given criterion to the faceted criteria
      Parameters:
      criterion - the criterion to add
      contextualParameters - the contextual parameters
    • getResultItems

      Retrieves the search result items
      Parameters:
      contextualParameters - the contextual parameters
      Returns:
      the search result items
    • getResultItem

      default ModelViewItem getResultItem(String itemPath, Map<String,Object> contextualParameters)
      Retrieves the search result item with the given path
      Parameters:
      itemPath - the path of the result item to retrieve
      contextualParameters - the contextual parameters
      Returns:
      the search result item with
    • getWorkspace

      String getWorkspace(Map<String,Object> contextualParameters)
      Get the specific workspace to use.
      Parameters:
      contextualParameters - the contextual parameters.
      Returns:
      the workspace to use when searching, or null to use the default workspace.
    • toJSON

      Map<String,Object> toJSON(Map<String,Object> contextualParameters)
      Converts the search model in a JSON map
      Parameters:
      contextualParameters - The contextual parameters
      Returns:
      the search model as a JSON map
    • resultItemsToJSON

      List<Object> resultItemsToJSON(Map<String,Object> contextualParameters)
      Converts the search model's result items on a JSON list
      Parameters:
      contextualParameters - The contextual parameters
      Returns:
      the result items as a JSON list
    • getId

      default String getId()
      Description copied from interface: Model
      Retrieves the model id (an id must be unique in the family Model.getFamilyId()
      Specified by:
      getId in interface Model
      Returns:
      model id (for example the content type id for a content)
    • getFamilyId

      default String getFamilyId()
      Description copied from interface: Model
      Retrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family Id
      Specified by:
      getFamilyId in interface Model
      Returns:
      content point (for example "org.ametys.cms.contenttype.ContentTypeExtensionPoint" for a content)
    • getModelItems

      default Collection<? extends ModelItem> getModelItems()
      Description copied from interface: ModelItemAccessor
      Retrieves all the model items of this accessor
      Specified by:
      getModelItems in interface ModelItemAccessor
      Returns:
      the model items