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,SkillSearchUIModel,StaticSearchUIModel
This interface represents a search model.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddCriterion(SearchModelCriterionDefinition criterion, Map<String, Object> contextualParameters) Add the given criterion to the simple criteriadefault voidaddFacetedCriterion(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 ModelViewItemgetCriterion(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 ModelViewItemgetFacetedCriterion(String name, Map<String, Object> contextualParameters) Retrieves the faceted criterion with the given namedefault StringRetrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family Iddefault StringgetId()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 ModelViewItemgetResultItem(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
nullif 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
nullif 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:ModelRetrieves the model id (an id must be unique in the familyModel.getFamilyId() -
getFamilyId
Description copied from interface:ModelRetrieves the Family Id (for example the extension point) Each model Id have to be unique in it's family Id- Specified by:
getFamilyIdin interfaceModel- Returns:
- content point (for example "org.ametys.cms.contenttype.ContentTypeExtensionPoint" for a content)
-
getModelItems
Description copied from interface:ModelItemAccessorRetrieves all the model items of this accessor- Specified by:
getModelItemsin interfaceModelItemAccessor- Returns:
- the model items
-