Package org.ametys.cms.search.model
Class DefaultSearchModel
java.lang.Object
org.ametys.cms.search.model.DefaultSearchModel
- All Implemented Interfaces:
SearchModel
- Direct Known Subclasses:
DefaultSearchUIModel
Default implementation of a
SearchModel.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,SearchCriterion> The simple search criteria, indexed by ID.The content types of this search model.The content types excluded from this search model.protected Map<String,SearchCriterion> The faceted search criteria, indexed by ID.protected ViewItemContainerThe result itemsprotected Stringthe workspace -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.DefaultSearchModel(SearchModel searchModelToCopy, Map<String, Object> contextualParameters) Constructor by copying an existingSearchModel. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCriterion(SearchCriterion criterion) Add a criterionvoidaddFacetedCriterion(SearchCriterion criterion) Add a faceted criteriongetContentTypes(Map<String, Object> contextualParameters) Get the list of content types.Map<String,? extends SearchCriterion> getCriteria(Map<String, Object> contextualParameters) Get the list of search criteria in simple modegetExcludedContentTypes(Map<String, Object> contextualParameters) Get the list of excluded content types.Map<String,? extends SearchCriterion> getFacetedCriteria(Map<String, Object> contextualParameters) Get the list of faceted search criteria.getResultItems(Map<String, Object> contextualParameters) Retrieves the search result itemsgetWorkspace(Map<String, Object> contextualParameters) Get the specific workspace to use.voidsetContentTypes(Set<String> cTypes) Set the content types of the modelsvoidsetCriteria(Collection<? extends SearchCriterion> criteria) Set the criteriavoidsetExcludedContentTypes(Set<String> cTypes) Set the content types to excludevoidsetFacetedCriteria(Collection<? extends SearchCriterion> criteria) Set the faceted criteriavoidsetResulItems(ViewItemContainer resultItems) Set the result itemsvoidsetWorkspace(String workspace) Set the workspaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.cms.search.model.SearchModel
getCriterion, getFacetedCriterion, getResultItem
-
Field Details
-
_cTypes
The content types of this search model. -
_excludedCTypes
The content types excluded from this search model. -
_criteria
The simple search criteria, indexed by ID. -
_facetedCriteria
The faceted search criteria, indexed by ID. -
_resultItems
The result items -
_workspace
the workspace
-
-
Constructor Details
-
DefaultSearchModel
public DefaultSearchModel()Default constructor. -
DefaultSearchModel
Constructor by copying an existingSearchModel.- Parameters:
searchModelToCopy- TheSearchModelto copycontextualParameters- The contextual parameters
-
-
Method Details
-
getContentTypes
Description copied from interface:SearchModelGet the list of content types.- Specified by:
getContentTypesin interfaceSearchModel- Parameters:
contextualParameters- the contextual parameters.- Returns:
- The list of content types.
-
setContentTypes
Set the content types of the models- Parameters:
cTypes- The content types.
-
getExcludedContentTypes
Description copied from interface:SearchModelGet the list of excluded content types.- Specified by:
getExcludedContentTypesin interfaceSearchModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- The list of excluded content types.
-
setExcludedContentTypes
Set the content types to exclude- Parameters:
cTypes- The content types to exclude
-
getCriteria
Description copied from interface:SearchModelGet the list of search criteria in simple mode- Specified by:
getCriteriain interfaceSearchModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of search criteria in simple mode
-
addCriterion
Add a criterion- Parameters:
criterion- the criterion to add
-
setCriteria
Set the criteria- Parameters:
criteria- The criteria list
-
getFacetedCriteria
public Map<String,? extends SearchCriterion> getFacetedCriteria(Map<String, Object> contextualParameters) Description copied from interface:SearchModelGet the list of faceted search criteria.- Specified by:
getFacetedCriteriain interfaceSearchModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of faceted search criteria.
-
addFacetedCriterion
Add a faceted criterion- Parameters:
criterion- the faceted criterion to add
-
setFacetedCriteria
Set the faceted criteria- Parameters:
criteria- The list of faceted criteria
-
getResultItems
Description copied from interface:SearchModelRetrieves the search result items- Specified by:
getResultItemsin interfaceSearchModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the search result items
-
setResulItems
Set the result items- Parameters:
resultItems- The result items to set
-
getWorkspace
Description copied from interface:SearchModelGet the specific workspace to use.- Specified by:
getWorkspacein interfaceSearchModel- Parameters:
contextualParameters- the contextual parameters.- Returns:
- the workspace to use when searching, or null to use the default workspace.
-
setWorkspace
Set the workspace- Parameters:
workspace- The workspace to set
-