Package org.ametys.cms.search.ui.model
Class AbstractSearchUIModel
java.lang.Object
org.ametys.cms.search.ui.model.AbstractSearchUIModel
- All Implemented Interfaces:
SearchModel,SearchUIModel,LogEnabled,Contextualizable,Serviceable
- Direct Known Subclasses:
CriteriaSearchUIModelWrapper,ReferenceTableSearchUIModel,ReferencingContentsWithSameValuesSearchUIModel,StaticSearchUIModel
public abstract class AbstractSearchUIModel
extends Object
implements SearchUIModel, LogEnabled, Serviceable, Contextualizable
Abstract class for SearchUIModel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,SearchUICriterion> The search criteria in advanced mode, indexed by ID.protected Map<String,SearchUIColumn> The result columns, indexed by ID.protected ContextThe context.protected ContentTypeExtensionPointThe content type extension pointThe content types of this search model.The content types excluded from this search model.protected Map<String,SearchUICriterion> The search criteria used as facets, indexed by ID.protected LoggerThe logger.protected ServiceManagerThe service managerprotected Map<String,SearchUICriterion> The search criteria in simple mode, indexed by ID.protected SearchUIModelHelperThe search model helper.protected static final StringThe default URL for CSV exportprotected static final StringThe default URL for DOC exportprotected static final StringThe default URL for XML exportprotected static final StringThe URL for print resultsprotected static final StringThe default URL for searchprotected static final StringThe default plugin name for URLs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddContentTypesConfiguration(DefaultConfiguration conf, Set<String> baseContentTypeIds) Add the content types configuration.voidcontextualize(Context context) getAdvancedCriteria(Map<String, Object> contextualParameters) Get the list of search criteria in advanced modegetContentTypes(Map<String, Object> contextualParameters) Get the list of content types.getCriteria(Map<String, Object> contextualParameters) Get the list of search criteria in simple modeprotected ConfigurationgetCustomCriteriaConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String customCriterionId, I18nizableText group) Get the configuration of a custom criteria component.getExcludedContentTypes(Map<String, Object> contextualParameters) Get the list of excluded content types.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 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 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 resultsgetFacetedCriteria(Map<String, Object> contextualParameters) Get the list of faceted search criteria.protected ConfigurationgetIndexingFieldCriteriaConfiguration(Set<String> baseContentTypeIds, String path, Query.Operator operator) Get the configuration of a metadata criteria component.protected ConfigurationgetIndexingFieldCriteriaConfiguration(Set<String> baseContentTypeIds, String path, Query.Operator operator, I18nizableText group) Get the configuration of a metadata criteria component.protected ConfigurationgetIndexingFieldCriteriaConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String path, Query.Operator operator, I18nizableText group) Get the configuration of a metadata criteria component.protected final LoggerGet the logger.protected ConfigurationgetMetadataColumnConfiguration(Set<String> baseContentTypeIds, String metadataPath) Get the configuration of a metadata column component.protected ConfigurationgetMetadataColumnConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String metadataPath) Get the configuration of a metadata column component.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 resultsgetResultFields(Map<String, Object> contextualParameters) Get the column for 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.protected ConfigurationgetSystemColumnConfiguration(Set<String> baseContentTypeIds, String property) Get the configuration of a system column component.protected ConfigurationgetSystemColumnConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String property) Get the configuration of a system column component.protected ConfigurationgetSystemCriteriaConfiguration(Set<String> baseContentTypeIds, String property) Get the configuration of a system criteria component.protected ConfigurationgetSystemCriteriaConfiguration(Set<String> baseContentTypeIds, String property, I18nizableText group) Get the configuration of a system criteria component.protected ConfigurationgetSystemCriteriaConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String property, I18nizableText group) Get the configuration of a system criteria component.getWorkspace(Map<String, Object> contextualParameters) Get the specific workspace to use.voidservice(ServiceManager manager) voidsetAdvancedCriteria(Collection<SearchUICriterion> criteria) Set the criteria in advanced mode.voidsetContentTypes(Set<String> cTypes) Set the content types.voidsetCriteria(Collection<SearchUICriterion> criteria) Set the criteria in simple mode.voidsetExcludedContentTypes(Set<String> cTypes) Set the excluded content types.voidsetFacetedCriteria(Collection<SearchCriterion> criteria) Set the criteria to use as facets.voidCalled at creation time to provide aLogger.voidsetResultFields(Collection<SearchUIColumn> fields) Set the result columns.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.cms.search.ui.model.SearchUIModel
allowSortOnMultipleJoin, getAdvancedCriterion, getCriterion, getFacetedCriterion, getResultField
-
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_PRINT_URL
The URL for print results- See Also:
-
_cTypeEP
The content type extension point -
_searchModelHelper
The search model helper. -
_logger
The logger. -
_manager
The service manager -
_context
The context. -
_cTypes
The content types of this search model. -
_excludedCTypes
The content types excluded from this search model. -
_searchCriteria
The search criteria in simple mode, indexed by ID. -
_advancedSearchCriteria
The search criteria in advanced mode, indexed by ID. -
_facetedCriteria
The search criteria used as facets, indexed by ID. -
_columns
The result columns, indexed by ID.
-
-
Constructor Details
-
AbstractSearchUIModel
public AbstractSearchUIModel()
-
-
Method Details
-
setLogger
Description copied from interface:LogEnabledCalled at creation time to provide aLogger.- Specified by:
setLoggerin interfaceLogEnabled- Parameters:
logger- aLoggerfor messages.
-
getLogger
Get the logger.- Returns:
- the logger.
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
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.- 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 excluded content types.- Parameters:
cTypes- The excluded content types.
-
getCriteria
Description copied from interface:SearchModelGet the list of search criteria in simple mode- Specified by:
getCriteriain interfaceSearchModel- Specified by:
getCriteriain interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of search criteria in simple mode
-
setCriteria
Set the criteria in simple mode.- Parameters:
criteria- A collection of search criteria.
-
getAdvancedCriteria
Description copied from interface:SearchUIModelGet the list of search criteria in advanced mode- Specified by:
getAdvancedCriteriain interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of search criteria in advanced mode
-
setAdvancedCriteria
Set the criteria in advanced mode.- Parameters:
criteria- A collection of search criteria.
-
getFacetedCriteria
Description copied from interface:SearchModelGet the list of faceted search criteria.- Specified by:
getFacetedCriteriain interfaceSearchModel- Specified by:
getFacetedCriteriain interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of faceted search criteria.
-
setFacetedCriteria
Set the criteria to use as facets.- Parameters:
criteria- A collection of search criteria.
-
getResultFields
Description copied from interface:SearchModelGet the column for results- Specified by:
getResultFieldsin interfaceSearchModel- Specified by:
getResultFieldsin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters. Can be null.- Returns:
- the column for results
-
setResultFields
Set the result columns.- Parameters:
fields- A collection of search columns.
-
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.
-
getWorkspace
Description copied from interface:SearchUIModelGet the specific workspace to use.- Specified by:
getWorkspacein interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters.- Returns:
- the workspace to use when searching, or null to use the default workspace.
-
getSearchUrl
Description copied from interface:SearchUIModelGet the URL for search- Specified by:
getSearchUrlin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the URL for search
-
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
-
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
-
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
-
getExportDOCUrl
Description copied from interface:SearchUIModelGet the URL for DOC export of results- Specified by:
getExportDOCUrlin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the URL for DOC export
-
getExportDOCUrlPlugin
Description copied from interface:SearchUIModelGet the plugin name for DOC export of results- Specified by:
getExportDOCUrlPluginin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the plugin name for DOC export
-
getExportXMLUrl
Description copied from interface:SearchUIModelGet the URL for XML export of results- Specified by:
getExportXMLUrlin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the URL for XML export
-
getExportXMLUrlPlugin
Description copied from interface:SearchUIModelGet the plugin name for XML export of results- Specified by:
getExportXMLUrlPluginin interfaceSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the plugin name for XML export
-
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
-
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
-
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.
-
getIndexingFieldCriteriaConfiguration
protected Configuration getIndexingFieldCriteriaConfiguration(Set<String> baseContentTypeIds, String path, Query.Operator operator) throws ConfigurationException Get the configuration of a metadata criteria component.- Parameters:
baseContentTypeIds- the "base" content type identifiers.path- the field path.operator- the criteria operator, can be null.- Returns:
- the configuration to provide to the metadata criteria component.
- Throws:
ConfigurationException- if an error occurs.
-
getIndexingFieldCriteriaConfiguration
protected Configuration getIndexingFieldCriteriaConfiguration(Set<String> baseContentTypeIds, String path, Query.Operator operator, I18nizableText group) throws ConfigurationException Get the configuration of a metadata criteria component.- Parameters:
baseContentTypeIds- the "base" content type identifiers.path- the field path.operator- the criteria operator, can be null.group- The group. Can be null.- Returns:
- the configuration to provide to the metadata criteria component.
- Throws:
ConfigurationException- if an error occurs.
-
getIndexingFieldCriteriaConfiguration
protected Configuration getIndexingFieldCriteriaConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String path, Query.Operator operator, I18nizableText group) throws ConfigurationException Get the configuration of a metadata criteria component.- Parameters:
originalConf- the original criteria configuration.baseContentTypeIds- the "base" content type identifiers.path- the field path, separated by '/'.operator- the criteria operator, can be null.group- The group. Can be null.- Returns:
- the configuration to provide to the metadata criterion component.
- Throws:
ConfigurationException- if an error occurs.
-
getSystemCriteriaConfiguration
protected Configuration getSystemCriteriaConfiguration(Set<String> baseContentTypeIds, String property) Get the configuration of a system criteria component.- Parameters:
baseContentTypeIds- the "base" content type identifiers.property- the system property.- Returns:
- the configuration to provide to the system criterion component.
-
getSystemCriteriaConfiguration
protected Configuration getSystemCriteriaConfiguration(Set<String> baseContentTypeIds, String property, I18nizableText group) Get the configuration of a system criteria component.- Parameters:
baseContentTypeIds- the "base" content type identifiers.property- the system property.group- The group. Can be null.- Returns:
- the configuration to provide to the system criterion component.
-
getSystemCriteriaConfiguration
protected Configuration getSystemCriteriaConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String property, I18nizableText group) throws ConfigurationException Get the configuration of a system criteria component.- Parameters:
originalConf- the original column configuration.baseContentTypeIds- the "base" content type identifiers.property- the system property.group- The group. Can be null.- Returns:
- the configuration to provide to the system criterion component.
- Throws:
ConfigurationException- if an error occurs.
-
getCustomCriteriaConfiguration
protected Configuration getCustomCriteriaConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String customCriterionId, I18nizableText group) throws ConfigurationException Get the configuration of a custom criteria component.- Parameters:
originalConf- the original column configuration.baseContentTypeIds- the "base" content type identifiers.customCriterionId- the custom criterion idgroup- The group. Can be null.- Returns:
- the configuration to provide to the custom criterion component.
- Throws:
ConfigurationException- if an error occurs.
-
getMetadataColumnConfiguration
protected Configuration getMetadataColumnConfiguration(Set<String> baseContentTypeIds, String metadataPath) throws ConfigurationException Get the configuration of a metadata column component.- Parameters:
baseContentTypeIds- the "base" content type identifiers.metadataPath- the metadata path.- Returns:
- the configuration to provide to the metadata column component.
- Throws:
ConfigurationException- if an error occurs.
-
getMetadataColumnConfiguration
protected Configuration getMetadataColumnConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String metadataPath) throws ConfigurationException Get the configuration of a metadata column component.- Parameters:
originalConf- the original column configuration.baseContentTypeIds- the base content type identifiers.metadataPath- the metadata path.- Returns:
- the configuration to provide to the metadata column component.
- Throws:
ConfigurationException- if an error occurs.
-
getSystemColumnConfiguration
protected Configuration getSystemColumnConfiguration(Set<String> baseContentTypeIds, String property) throws ConfigurationException Get the configuration of a system column component.- Parameters:
baseContentTypeIds- the "base" content type identifiers.property- the system property.- Returns:
- the configuration to provide to the system column component.
- Throws:
ConfigurationException- if an error occurs.
-
getSystemColumnConfiguration
protected Configuration getSystemColumnConfiguration(Configuration originalConf, Set<String> baseContentTypeIds, String property) throws ConfigurationException Get the configuration of a system column component.- Parameters:
originalConf- the original column configuration.baseContentTypeIds- the "base" content type identifiers.property- the system property.- Returns:
- the configuration to provide to the system column component.
- Throws:
ConfigurationException- if an error occurs.
-
addContentTypesConfiguration
protected void addContentTypesConfiguration(DefaultConfiguration conf, Set<String> baseContentTypeIds) Add the content types configuration.- Parameters:
conf- The configuration to write to.baseContentTypeIds- The "base" content type identifiers.
-