Package org.ametys.cms.search.model
Interface SearchModel
- All Superinterfaces:
Model
,ModelItemAccessor
,ModelItemContainer
- All Known Subinterfaces:
SearchUIModel
- All Known Implementing Classes:
DefaultSearchModel
,DefaultSearchUIModel
,ReferenceTableSearchUIModel
,ReferencingContentsWithSameValuesSearchUIModel
,SearchModelWrapper
,StaticSearchUIModel
This interface represents a search model.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addCriterion
(SearchModelCriterionDefinition criterion, Map<String, Object> contextualParameters) Add the given criterion to the simple criteriadefault void
addFacetedCriterion
(SearchModelCriterionDefinition criterion, Map<String, Object> contextualParameters) Add the given criterion to the faceted criteriagetContentTypes
(Map<String, Object> contextualParameters) Get the list of content types.getCriteria
(Map<String, Object> contextualParameters) Retrieves the criteria in simple modedefault ModelViewItem
getCriterion
(String name, Map<String, Object> contextualParameters) Retrieves the simple criterion with the given namegetExcludedContentTypes
(Map<String, Object> contextualParameters) Get the list of excluded content types.getFacetedCriteria
(Map<String, Object> contextualParameters) Retrieves the faceted criteria.default ModelViewItem
getFacetedCriterion
(String name, Map<String, Object> contextualParameters) Retrieves the faceted criterion with the given namedefault String
Retrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family Iddefault String
getId()
Retrieves the model id (an id must be unique in the familyModel.getFamilyId()
default Collection
<? extends ModelItem> Retrieves all the model items of this accessordefault ModelViewItem
getResultItem
(String itemPath, Map<String, Object> contextualParameters) Retrieves the search result item with the given pathgetResultItems
(Map<String, Object> contextualParameters) Retrieves the search result itemsgetWorkspace
(Map<String, Object> contextualParameters) Get the specific workspace to use.resultItemsToJSON
(Map<String, Object> contextualParameters) Converts the search model's result items on a JSON listConverts the search model in a JSON mapMethods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItem
-
Method Details
-
getContentTypes
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
Retrieves the criteria in simple mode- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the criteria in simple mode
-
getCriterion
Retrieves the simple criterion with the given name- Parameters:
name
- The name of the criterion to retrievecontextualParameters
- 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 addcontextualParameters
- the contextual parameters
-
getFacetedCriteria
Retrieves the faceted criteria.- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the faceted criteria.
-
getFacetedCriterion
Retrieves the faceted criterion with the given name- Parameters:
name
- The name of the faceted criterion to retrievecontextualParameters
- 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 addcontextualParameters
- the contextual parameters
-
getResultItems
Retrieves the search result items- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the search result items
-
getResultItem
Retrieves the search result item with the given path- Parameters:
itemPath
- the path of the result item to retrievecontextualParameters
- the contextual parameters- Returns:
- the search result item with
-
getWorkspace
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
Converts the search model in a JSON map- Parameters:
contextualParameters
- The contextual parameters- Returns:
- the search model as a JSON map
-
resultItemsToJSON
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
Description copied from interface:Model
Retrieves the model id (an id must be unique in the familyModel.getFamilyId()
-
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 interfaceModel
- Returns:
- content point (for example "org.ametys.cms.contenttype.ContentTypeExtensionPoint" for a content)
-
getModelItems
Description copied from interface:ModelItemAccessor
Retrieves all the model items of this accessor- Specified by:
getModelItems
in interfaceModelItemAccessor
- Returns:
- the model items
-