Package org.ametys.cms.search.ui.model
Class ReferenceTableSearchUIModel
java.lang.Object
org.ametys.cms.search.ui.model.AbstractSearchUIModel
org.ametys.cms.search.ui.model.ReferenceTableSearchUIModel
- All Implemented Interfaces:
SearchModel
,SearchUIModel
,LogEnabled
,Configurable
,Contextualizable
,Serviceable
public class ReferenceTableSearchUIModel
extends AbstractSearchUIModel
implements Serviceable, Contextualizable, Configurable
Generic implementation of
SearchUIModel
for reference tables
The search tool model automatically declares simple first level attributes as criteria and columns.-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentTypeExtensionPoint
The content type extension pointprotected Context
The context.protected HierarchicalReferenceTablesHelper
The helper component for hierarchical reference tablesprotected ServiceManager
The service managerThe search column roles.protected ThreadSafeComponentManager<SearchUICriterion>
ComponentManager forSearchUICriterion
s.The search criteria roles.protected SearchCriterionHelper
The search criterion helperprotected SystemPropertyExtensionPoint
The systemPropertyExtension pointFields inherited from class org.ametys.cms.search.ui.model.AbstractSearchUIModel
_advancedSearchCriteria, _cTypes, _excludedCTypes, _facetedCriteria, _logger, _resultItems, _searchCriteria, DEFAULT_EXPORT_CSV_URL, DEFAULT_EXPORT_DOC_URL, DEFAULT_EXPORT_PDF_URL, DEFAULT_EXPORT_XML_URL, DEFAULT_PRINT_URL, DEFAULT_SEARCH_URL, DEFAULT_URL_PLUGIN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_copyAndFilterViewItemsForColumns
(List<ViewItem> viewItems) Copy the given view items and filter to keep only items that can be used inSearchUIColumn
s.protected boolean
_filterModelItemForColumn
(ModelItem modelItem) Returnstrue
if model item can be used as column search UIprotected boolean
_filterModelItemForCriteria
(ModelItem modelItem) Returnstrue
if the model item can be used as criteriaprotected ViewItemContainer
_getResultItems
(ContentType contentType) Retrieves the result items for the given content typeprotected void
addAttributeCriterionComponent
(ContentType contentType, String attributePath, Query.Operator operator) Add an attribute criterion component to the manager.protected void
addCriteriaComponents
(ContentType cType) Add criteria components to the manager.protected void
addCriteriaComponents
(ContentType cType, ViewItemContainer viewContainer) Add criteria components to the manager.protected void
Add criteria component to exclude the candidatesprotected void
addLikeTitleCriterionComponent
(ContentType contentType, String attributePath) Add the title attribute criterion component to the manager, with a 'LIKE' operator and an hidden widgetprotected void
addSystemCriterionComponent
(ContentType contentType, String property) Add a system criterion component to the manager.void
configure
(Configuration configuration) void
contextualize
(Context context) getAdvancedCriteria
(Map<String, Object> contextualParameters) Get the list of search criteria in advanced modegetCriteria
(Map<String, Object> contextualParameters) Get the list of search criteria in simple modegetExcludedContentTypes
(Map<String, Object> contextualParameters) Get the list of excluded content types.getFacetedCriteria
(Map<String, Object> contextualParameters) Get the list of faceted search criteria.getResultItems
(Map<String, Object> contextualParameters) Retrieves the search result itemsprotected List<SearchUICriterion>
getSearchUICriteria
(ContentType cType) Lookup all the criteria.void
service
(ServiceManager manager) Methods inherited from class org.ametys.cms.search.ui.model.AbstractSearchUIModel
getContentTypes, getExportCSVUrl, getExportCSVUrlPlugin, getExportDOCUrl, getExportDOCUrlPlugin, getExportPDFUrl, getExportPDFUrlPlugin, getExportXMLUrl, getExportXMLUrlPlugin, getLogger, getPageSize, getPrintUrl, getPrintUrlPlugin, getSearchUrl, getSearchUrlPlugin, getSummaryView, getWorkspace, setAdvancedCriteria, setContentTypes, setCriteria, setExcludedContentTypes, setFacetedCriteria, setLogger, setResultItems
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.cms.search.model.SearchModel
getResultItem
Methods inherited from interface org.ametys.cms.search.ui.model.SearchUIModel
allowSortOnMultipleJoin, getAdvancedCriterion, getCriterion, getFacetedCriterion
-
Field Details
-
_searchCriteriaManager
ComponentManager forSearchUICriterion
s. -
_searchCriteriaRoles
The search criteria roles. -
_searchColumnRoles
The search column roles. -
_context
The context. -
_manager
The service manager -
_hierarchicalReferenceTableContentsHelper
The helper component for hierarchical reference tables -
_contentTypeExtensionPoint
The content type extension point -
_systemPropertyExtensionPoint
The systemPropertyExtension point -
_searchCriterionHelper
The search criterion helper
-
-
Constructor Details
-
ReferenceTableSearchUIModel
public ReferenceTableSearchUIModel()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getExcludedContentTypes
Description copied from interface:SearchModel
Get the list of excluded content types.- Specified by:
getExcludedContentTypes
in interfaceSearchModel
- Overrides:
getExcludedContentTypes
in classAbstractSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- The list of excluded content types.
-
getCriteria
Description copied from interface:SearchModel
Get the list of search criteria in simple mode- Specified by:
getCriteria
in interfaceSearchModel
- Specified by:
getCriteria
in interfaceSearchUIModel
- Overrides:
getCriteria
in classAbstractSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of search criteria in simple mode
-
getFacetedCriteria
Description copied from interface:SearchModel
Get the list of faceted search criteria.- Specified by:
getFacetedCriteria
in interfaceSearchModel
- Specified by:
getFacetedCriteria
in interfaceSearchUIModel
- Overrides:
getFacetedCriteria
in classAbstractSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of faceted search criteria.
-
getAdvancedCriteria
Description copied from interface:SearchUIModel
Get the list of search criteria in advanced mode- Specified by:
getAdvancedCriteria
in interfaceSearchUIModel
- Overrides:
getAdvancedCriteria
in classAbstractSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the list of search criteria in advanced mode
-
getResultItems
Description copied from interface:SearchModel
Retrieves the search result items- Specified by:
getResultItems
in interfaceSearchModel
- Overrides:
getResultItems
in classAbstractSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the search result items
-
addCriteriaComponents
protected void addCriteriaComponents(ContentType cType) throws ConfigurationException, ComponentException Add criteria components to the manager.- Parameters:
cType
- the simple content type.- Throws:
ConfigurationException
- if a configuration error occurs.ComponentException
- if a component cannot be initialized.
-
addCriteriaComponents
protected void addCriteriaComponents(ContentType cType, ViewItemContainer viewContainer) throws ConfigurationException, ComponentException Add criteria components to the manager.- Parameters:
cType
- the simple content type.viewContainer
- the view item container- Throws:
ConfigurationException
- if a configuration error occurs.ComponentException
- if a component cannot be initialized.
-
addExcludeCandidateSystemCriterionComponent
protected void addExcludeCandidateSystemCriterionComponent(ContentType cType) throws ConfigurationException Add criteria component to exclude the candidates- Parameters:
cType
- the simple content type- Throws:
ConfigurationException
- if an error occurs while creating the criteria configuration
-
_filterModelItemForCriteria
Returnstrue
if the model item can be used as criteria- Parameters:
modelItem
- the model item- Returns:
true
if the model item can be used as criteria
-
addLikeTitleCriterionComponent
protected void addLikeTitleCriterionComponent(ContentType contentType, String attributePath) throws ConfigurationException, ComponentException Add the title attribute criterion component to the manager, with a 'LIKE' operator and an hidden widget- Parameters:
contentType
- the simple content type.attributePath
- the attribute path.- Throws:
ConfigurationException
- if a configuration error occurs.ComponentException
- if a component cannot be initialized.
-
addAttributeCriterionComponent
protected void addAttributeCriterionComponent(ContentType contentType, String attributePath, Query.Operator operator) throws ConfigurationException, ComponentException Add an attribute criterion component to the manager.- Parameters:
contentType
- the simple content type.attributePath
- the attribute path.operator
- the criterion operator.- Throws:
ConfigurationException
- if a configuration error occurs.ComponentException
- if a component cannot be initialized.
-
addSystemCriterionComponent
protected void addSystemCriterionComponent(ContentType contentType, String property) throws ConfigurationException, ComponentException Add a system criterion component to the manager.- Parameters:
contentType
- the simple content type.property
- the system property.- Throws:
ConfigurationException
- if a configuration error occurs.ComponentException
- if a component cannot be initialized.
-
getSearchUICriteria
Lookup all the criteria.- Parameters:
cType
- the simple content type.- Returns:
- the search criteria list.
- Throws:
ComponentException
- if a component cannot be looked up.
-
_getResultItems
Retrieves the result items for the given content type- Parameters:
contentType
- The content type- Returns:
- the result items
-
_copyAndFilterViewItemsForColumns
Copy the given view items and filter to keep only items that can be used inSearchUIColumn
s. Also copy the children of view item accessors- Parameters:
viewItems
- the view items to copy- Returns:
- the view items copies
-
_filterModelItemForColumn
Returnstrue
if model item can be used as column search UI- Parameters:
modelItem
- the model item- Returns:
true
if model item can be used as column search UI
-