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
FieldsModifier and TypeFieldDescriptionprotected ContentTypeExtensionPointThe content type extension pointprotected ContextThe context.protected HierarchicalReferenceTablesHelperThe helper component for hierarchical reference tablesprotected ServiceManagerThe service managerThe search column roles.protected ThreadSafeComponentManager<SearchUICriterion>ComponentManager forSearchUICriterions.The search criteria roles.protected SearchCriterionHelperThe search criterion helperprotected SystemPropertyExtensionPointThe 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
Constructors -
Method Summary
Modifier and TypeMethodDescription_copyAndFilterViewItemsForColumns(List<ViewItem> viewItems) Copy the given view items and filter to keep only items that can be used inSearchUIColumns.protected boolean_filterModelItemForColumn(ModelItem modelItem) Returnstrueif model item can be used as column search UIprotected boolean_filterModelItemForCriteria(ModelItem modelItem) Returnstrueif the model item can be used as criteriaprotected ViewItemContainer_getResultItems(ContentType contentType) Retrieves the result items for the given content typeprotected voidaddAttributeCriterionComponent(ContentType contentType, String attributePath, Query.Operator operator) Add an attribute criterion component to the manager.protected voidaddCriteriaComponents(ContentType cType) Add criteria components to the manager.protected voidaddCriteriaComponents(ContentType cType, ViewItemContainer viewContainer) Add criteria components to the manager.protected voidAdd criteria component to exclude the candidatesprotected voidaddLikeTitleCriterionComponent(ContentType contentType, String attributePath) Add the title attribute criterion component to the manager, with a 'LIKE' operator and an hidden widgetprotected voidaddSystemCriterionComponent(ContentType contentType, String property) Add a system criterion component to the manager.voidconfigure(Configuration configuration) voidcontextualize(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.voidservice(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, setResultItemsMethods 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
getResultItemMethods inherited from interface org.ametys.cms.search.ui.model.SearchUIModel
allowSortOnMultipleJoin, getAdvancedCriterion, getCriterion, getFacetedCriterion
-
Field Details
-
_searchCriteriaManager
ComponentManager forSearchUICriterions. -
_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:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
getExcludedContentTypes
Description copied from interface:SearchModelGet the list of excluded content types.- Specified by:
getExcludedContentTypesin interfaceSearchModel- Overrides:
getExcludedContentTypesin classAbstractSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- The list of 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- Overrides:
getCriteriain classAbstractSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of search criteria in simple mode
-
getFacetedCriteria
Description copied from interface:SearchModelGet the list of faceted search criteria.- Specified by:
getFacetedCriteriain interfaceSearchModel- Specified by:
getFacetedCriteriain interfaceSearchUIModel- Overrides:
getFacetedCriteriain classAbstractSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of faceted search criteria.
-
getAdvancedCriteria
Description copied from interface:SearchUIModelGet the list of search criteria in advanced mode- Specified by:
getAdvancedCriteriain interfaceSearchUIModel- Overrides:
getAdvancedCriteriain classAbstractSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the list of search criteria in advanced mode
-
getResultItems
Description copied from interface:SearchModelRetrieves the search result items- Specified by:
getResultItemsin interfaceSearchModel- Overrides:
getResultItemsin 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
Returnstrueif the model item can be used as criteria- Parameters:
modelItem- the model item- Returns:
trueif 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 inSearchUIColumns. Also copy the children of view item accessors- Parameters:
viewItems- the view items to copy- Returns:
- the view items copies
-
_filterModelItemForColumn
Returnstrueif model item can be used as column search UI- Parameters:
modelItem- the model item- Returns:
trueif model item can be used as column search UI
-