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
- Direct Known Subclasses:
ReferenceTableSearchUIModel
,ReferencingContentsWithSameValuesSearchUIModel
,StaticSearchUIModel
Default implementation of a
SearchUIModel
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
The default URL for CSV exportprotected static final String
The default URL for DOC exportprotected static final String
The default URL for PDF exportprotected static final String
The default URL for XML exportprotected static final String
The URL for print resultsprotected static final String
The default URL for searchprotected static final String
The default plugin name for URLs -
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.void
addAdvancedCriteria
(SearchModelCriterionDefinitionHelper criterionDefinitionHelper, Map<String, Object> contextualParameters, String... references) Add criteria to the advanced criteria.protected boolean
Indicates if sorting on join columns which contain at least onemultiple
definition
in its path (intermediate ones only) must be allowed.getAdvancedCriteria
(Map<String, Object> contextualParameters) Retrieves the criteria in advanced modegetExportCSVUrl
(Map<String, Object> contextualParameters) Get the URL for CSV export of resultsgetExportCSVUrlPlugin
(Map<String, Object> contextualParameters) Get the plugin name for CSV export of resultsgetExportDOCUrl
(Map<String, Object> contextualParameters) Get the URL for DOC export of resultsgetExportDOCUrlPlugin
(Map<String, Object> contextualParameters) Get the plugin name for DOC export of resultsgetExportPDFUrl
(Map<String, Object> contextualParameters) Get the URL for PDF export of resultsgetExportPDFUrlPlugin
(Map<String, Object> contextualParameters) Get the plugin name for PDF export of resultsgetExportXMLUrl
(Map<String, Object> contextualParameters) Get the URL for XML export of resultsgetExportXMLUrlPlugin
(Map<String, Object> contextualParameters) Get the plugin name for XML export of resultsint
getPageSize
(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.void
setAdvancedCriteria
(ViewItemContainer criteria) Set the advanced criteriavoid
setAllowSortOnMultipleJoin
(boolean sortOnMultipleJoin) Set totrue
to allow sort on multiple join (default tofalse
)void
setExportCSVUrl
(String exportCSVUrl) Set the URL for CSV export of resultsvoid
setExportCSVUrlPlugin
(String exportCSVUrlPlugin) Set the plugin name for CSV export of resultsvoid
setExportDOCUrl
(String exportDOCUrl) Set the URL for Doc export of resultsvoid
setExportDOCUrlPlugin
(String exportDOCUrlPlugin) Set the plugin name for Doc export of resultsvoid
setExportPDFUrl
(String exportPDFUrl) Set the URL for PDF export of resultsvoid
setExportPDFUrlPlugin
(String exportPDFUrlPlugin) Set the plugin name for PDF export of resultsvoid
setExportXMLUrl
(String exportXMLUrl) Set the URL for XML export of resultsvoid
setExportXMLUrlPlugin
(String exportXMLUrlPlugin) Set the plugin name for XML export of resultsvoid
setPageSize
(int pageSize) Set the page sizevoid
setPrintUrl
(String printUrl) Set the URL for print resultsvoid
setPrintUrlPlugin
(String printUrlPlugin) Set the plugin name for print resultsvoid
setSearchUrl
(String searchUrl) Set the URL for searchvoid
setSearchUrlPlugin
(String searchUrlPlugin) Set the plugin name for searchvoid
setSummaryView
(String summaryView) Set The name of the view to use for summary of the contentConverts 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, setWorkspace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItem
Methods inherited from interface org.ametys.cms.search.model.SearchModel
getContentTypes, getCriteria, getCriterion, getExcludedContentTypes, getFacetedCriteria, getFacetedCriterion, getFamilyId, getId, getModelItems, getResultItem, getResultItems, getWorkspace, resultItemsToJSON
Methods inherited from interface org.ametys.cms.search.ui.model.SearchUIModel
addAdvancedCriterion, addAdvancedCriterion, addCriterion, addCriterion, addFacetedCriterion, addFacetedCriterion, getAdvancedCriterion
-
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_EXPORT_DOC_URL
The default URL for DOC export- See Also:
-
__DEFAULT_EXPORT_XML_URL
The default URL for XML export- See Also:
-
__DEFAULT_EXPORT_PDF_URL
The default URL for PDF export -
__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
- TheSearchUIModel
to copycontextualParameters
- The contextual parameters
-
-
Method Details
-
getAdvancedCriteria
Description copied from interface:SearchUIModel
Retrieves the criteria in advanced mode- Specified by:
getAdvancedCriteria
in 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:SearchUIModel
Get the page size.- Specified by:
getPageSize
in 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:SearchUIModel
Get the URL for search- Specified by:
getSearchUrl
in 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:SearchUIModel
Get the plugin name for search- Specified by:
getSearchUrlPlugin
in 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:SearchUIModel
Get the URL for CSV export of results- Specified by:
getExportCSVUrl
in 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:SearchUIModel
Get the plugin name for CSV export of results- Specified by:
getExportCSVUrlPlugin
in 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
-
getExportDOCUrl
Description copied from interface:SearchUIModel
Get the URL for DOC export of results- Specified by:
getExportDOCUrl
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the URL for DOC export
-
setExportDOCUrl
Set the URL for Doc export of results- Parameters:
exportDOCUrl
- The URL to set
-
getExportDOCUrlPlugin
Description copied from interface:SearchUIModel
Get the plugin name for DOC export of results- Specified by:
getExportDOCUrlPlugin
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the plugin name for DOC export
-
setExportDOCUrlPlugin
Set the plugin name for Doc export of results- Parameters:
exportDOCUrlPlugin
- the plugin name to set
-
getExportXMLUrl
Description copied from interface:SearchUIModel
Get the URL for XML export of results- Specified by:
getExportXMLUrl
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the URL for XML export
-
setExportXMLUrl
Set the URL for XML export of results- Parameters:
exportXMLUrl
- The URL to set
-
getExportXMLUrlPlugin
Description copied from interface:SearchUIModel
Get the plugin name for XML export of results- Specified by:
getExportXMLUrlPlugin
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the plugin name for XML export
-
setExportXMLUrlPlugin
Set the plugin name for XML export of results- Parameters:
exportXMLUrlPlugin
- the plugin name to set
-
getExportPDFUrl
Description copied from interface:SearchUIModel
Get the URL for PDF export of results- Specified by:
getExportPDFUrl
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the URL for PDF export
-
setExportPDFUrl
Set the URL for PDF export of results- Parameters:
exportPDFUrl
- The URL to set
-
getExportPDFUrlPlugin
Description copied from interface:SearchUIModel
Get the plugin name for PDF export of results- Specified by:
getExportPDFUrlPlugin
in interfaceSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the plugin name for PDF export
-
setExportPDFUrlPlugin
Set the plugin name for PDF export of results- Parameters:
exportPDFUrlPlugin
- the plugin name to set
-
getPrintUrl
Description copied from interface:SearchUIModel
Get the URL for print results- Specified by:
getPrintUrl
in 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:SearchUIModel
Get the plugin name for print results- Specified by:
getPrintUrlPlugin
in 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:SearchUIModel
Get the name of the view to use for summary of the content.- Specified by:
getSummaryView
in 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 onemultiple
definition
in 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:
true
if sorting on join columns which contains at least one multiple item in its path (intermediate ones only) must be allowed.
-
setAllowSortOnMultipleJoin
Set totrue
to allow sort on multiple join (default tofalse
)- Parameters:
sortOnMultipleJoin
-true
to allow sort on multiple join,false
otherwise
-
toJSON
Description copied from interface:SearchModel
Converts the search model in a JSON map- Specified by:
toJSON
in interfaceSearchModel
- Overrides:
toJSON
in 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.
-