Class DefaultSearchUIModel
java.lang.Object
org.ametys.cms.search.model.DefaultSearchModel
org.ametys.cms.search.ui.model.impl.DefaultSearchUIModel
- All Implemented Interfaces:
SearchModel,SearchUIModel,Model,ModelItemAccessor,ModelItemContainer,Labelable
- Direct Known Subclasses:
ReferenceTableSearchUIModel,ReferencingContentsWithSameValuesSearchUIModel,StaticSearchUIModel
Default implementation of a
SearchUIModel.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringThe default URL for CSV exportprotected static final StringThe URL for print resultsprotected static final StringThe default URL for searchprotected static final StringThe default plugin name for URLsFields inherited from interface org.ametys.cms.search.ui.model.SearchUIModel
TAG_PUBLIC -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorDefaultSearchUIModel(SearchUIModel searchUIModelToCopy, Map<String, Object> contextualParameters) Constructor by copying an existingSearchUIModel. -
Method Summary
Modifier and TypeMethodDescription_getAdvancedCriteriaListInfo(ViewItemAccessor criteria) Return information on a list of advancedSearchModelCriterionViewItem, serialized as a Map.voidaddAdvancedCriteria(SearchModelCriterionDefinitionHelper criterionDefinitionHelper, Map<String, Object> contextualParameters, String... references) Add criteria to the advanced criteria.protected booleanIndicates if sorting on join columns which contain at least onemultipledefinitionin its path (intermediate ones only) must be allowed.getAdvancedCriteria(Map<String, Object> contextualParameters) Retrieves the criteria in advanced modeRetrieves the description.getExportCSVUrl(Map<String, Object> contextualParameters) Get the URL for CSV export of resultsgetExportCSVUrlPlugin(Map<String, Object> contextualParameters) Get the plugin name for CSV export of resultsgetLabel()Retrieves the label.getName()Get the name.intgetPageSize(Map<String, Object> contextualParameters) Get the page size.getPrintUrl(Map<String, Object> contextualParameters) Get the URL for print resultsgetPrintUrlPlugin(Map<String, Object> contextualParameters) Get the plugin name for print resultsgetSearchUrl(Map<String, Object> contextualParameters) Get the URL for searchgetSearchUrlPlugin(Map<String, Object> contextualParameters) Get the plugin name for searchGet the name of the view to use for summary of the content.getTags()Get the registered tags for this search modelbooleanDetermines if the search model has the given tagvoidsetAdvancedCriteria(ViewItemContainer criteria) Set the advanced criteriavoidsetAllowSortOnMultipleJoin(boolean sortOnMultipleJoin) Set totrueto allow sort on multiple join (default tofalse)voidsetDescription(I18nizableText description) Set the description of the modelvoidsetExportCSVUrl(String exportCSVUrl) Set the URL for CSV export of resultsvoidsetExportCSVUrlPlugin(String exportCSVUrlPlugin) Set the plugin name for CSV export of resultsvoidsetLabel(I18nizableText label) Set the label of the modelvoidsetPageSize(int pageSize) Set the page sizevoidsetPrintUrl(String printUrl) Set the URL for print resultsvoidsetPrintUrlPlugin(String printUrlPlugin) Set the plugin name for print resultsvoidsetSearchUrl(String searchUrl) Set the URL for searchvoidsetSearchUrlPlugin(String searchUrlPlugin) Set the plugin name for searchvoidsetSummaryView(String summaryView) Set The name of the view to use for summary of the contentvoidSet the tags of this search modelConverts the search model in a JSON mapMethods inherited from class org.ametys.cms.search.model.DefaultSearchModel
_resultItemsToJSON, addCriteria, addFacetedCriteria, getContentTypes, getCriteria, getExcludedContentTypes, getFacetedCriteria, getResultItems, getWorkspace, resultItemsToJSON, setContentTypes, setCriteria, setExcludedContentTypes, setFacetedCriteria, setResultItems, setWorkspaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItemMethods inherited from interface org.ametys.cms.search.model.SearchModel
getContentTypes, getCriteria, getCriterion, getExcludedContentTypes, getFacetedCriteria, getFacetedCriterion, getFamilyId, getId, getModelItems, getResultItem, getResultItems, getWorkspace, resultItemsToJSONMethods inherited from interface org.ametys.cms.search.ui.model.SearchUIModel
addAdvancedCriterion, addAdvancedCriterion, addCriterion, addCriterion, addFacetedCriterion, addFacetedCriterion, getAdvancedCriterion, isPublic
-
Field Details
-
__DEFAULT_URL_PLUGIN
The default plugin name for URLs- See Also:
-
__DEFAULT_SEARCH_URL
The default URL for search- See Also:
-
__DEFAULT_EXPORT_CSV_URL
The default URL for CSV export- See Also:
-
__DEFAULT_PRINT_URL
The URL for print results- See Also:
-
-
Constructor Details
-
DefaultSearchUIModel
public DefaultSearchUIModel()Default constructor -
DefaultSearchUIModel
public DefaultSearchUIModel(SearchUIModel searchUIModelToCopy, Map<String, Object> contextualParameters) Constructor by copying an existingSearchUIModel.- Parameters:
searchUIModelToCopy- TheSearchUIModelto copycontextualParameters- The contextual parameters
-
-
Method Details
-
getName
Description copied from interface:LabelableGet the name. -
getLabel
Description copied from interface:LabelableRetrieves the label. -
setLabel
Set the label of the model- Parameters:
label- the label
-
getDescription
Description copied from interface:LabelableRetrieves the description.- Specified by:
getDescriptionin interfaceLabelable- Returns:
- the description.
-
setDescription
Set the description of the model- Parameters:
description- the description
-
getAdvancedCriteria
Description copied from interface:SearchUIModelRetrieves the criteria in advanced mode- Specified by:
getAdvancedCriteriain interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the criteria in advanced mode
-
addAdvancedCriteria
public void addAdvancedCriteria(SearchModelCriterionDefinitionHelper criterionDefinitionHelper, Map<String, Object> contextualParameters, String... references) Add criteria to the advanced criteria. The created criteria reference the given paths- Parameters:
criterionDefinitionHelper- the criterion definition helpercontextualParameters- the contextual parametersreferences- the paths to the items the criteria will reference
-
setAdvancedCriteria
Set the advanced criteria- Parameters:
criteria- The advanced criteria to set
-
getPageSize
Description copied from interface:SearchUIModelGet the page size.- Specified by:
getPageSizein interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters.- Returns:
- The page size, unlimited or default used when negative or 0.
-
setPageSize
Set the page size- Parameters:
pageSize- The page size to set. Set to negative or 0 for unlimited or default
-
getSearchUrl
Description copied from interface:SearchUIModelGet the URL for search- Specified by:
getSearchUrlin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the URL for search
-
setSearchUrl
Set the URL for search- Parameters:
searchUrl- The URL to set
-
getSearchUrlPlugin
Description copied from interface:SearchUIModelGet the plugin name for search- Specified by:
getSearchUrlPluginin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the plugin name for search
-
setSearchUrlPlugin
Set the plugin name for search- Parameters:
searchUrlPlugin- the plugin name to set
-
getExportCSVUrl
Description copied from interface:SearchUIModelGet the URL for CSV export of results- Specified by:
getExportCSVUrlin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the URL for CSV export
-
setExportCSVUrl
Set the URL for CSV export of results- Parameters:
exportCSVUrl- The URL to set
-
getExportCSVUrlPlugin
Description copied from interface:SearchUIModelGet the plugin name for CSV export of results- Specified by:
getExportCSVUrlPluginin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the plugin name for CSV export
-
setExportCSVUrlPlugin
Set the plugin name for CSV export of results- Parameters:
exportCSVUrlPlugin- the plugin name to set
-
getPrintUrl
Description copied from interface:SearchUIModelGet the URL for print results- Specified by:
getPrintUrlin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the URL for print results
-
setPrintUrl
Set the URL for print results- Parameters:
printUrl- The URL to set
-
getPrintUrlPlugin
Description copied from interface:SearchUIModelGet the plugin name for print results- Specified by:
getPrintUrlPluginin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the plugin name for print results
-
setPrintUrlPlugin
Set the plugin name for print results- Parameters:
printUrlPlugin- the plugin name to set
-
getSummaryView
Description copied from interface:SearchUIModelGet the name of the view to use for summary of the content.- Specified by:
getSummaryViewin interfaceSearchUIModel- Returns:
- the name of the view to use for summary of the content. Can be null.
-
setSummaryView
Set The name of the view to use for summary of the content- Parameters:
summaryView- the name to set
-
allowSortOnMultipleJoin
Indicates if sorting on join columns which contain at least onemultipledefinitionin its path (intermediate ones only) must be allowed.
If the final definition of the path is multiple, the column will not be sortable though.- Returns:
trueif sorting on join columns which contains at least one multiple item in its path (intermediate ones only) must be allowed.
-
setAllowSortOnMultipleJoin
Set totrueto allow sort on multiple join (default tofalse)- Parameters:
sortOnMultipleJoin-trueto allow sort on multiple join,falseotherwise
-
toJSON
Description copied from interface:SearchModelConverts the search model in a JSON map- Specified by:
toJSONin interfaceSearchModel- Overrides:
toJSONin classDefaultSearchModel- Parameters:
contextualParameters- The contextual parameters- Returns:
- the search model as a JSON map
-
_getAdvancedCriteriaListInfo
Return information on a list of advancedSearchModelCriterionViewItem, serialized as a Map.- Parameters:
criteria- A map of advanced criteria.- Returns:
- the detailed information serialized in a Map.
-
setTags
Set the tags of this search model- Parameters:
tags- the set of tags to set
-
hasTag
Description copied from interface:SearchUIModelDetermines if the search model has the given tag- Specified by:
hasTagin interfaceSearchUIModel- Parameters:
tagName- The tag name- Returns:
- true if the search model is tagged with the given tag name
-
getTags
Description copied from interface:SearchUIModelGet the registered tags for this search model- Specified by:
getTagsin interfaceSearchUIModel- Returns:
- the tags
-