Package org.ametys.cms.search.ui.model
Class ReferenceTableSearchUIModel
java.lang.Object
org.ametys.cms.search.model.DefaultSearchModel
org.ametys.cms.search.ui.model.impl.DefaultSearchUIModel
org.ametys.cms.search.ui.model.ReferenceTableSearchUIModel
- All Implemented Interfaces:
SearchModel
,SearchUIModel
,Model
,ModelItemAccessor
,ModelItemContainer
,Configurable
,Serviceable
public class ReferenceTableSearchUIModel
extends DefaultSearchUIModel
implements Serviceable, 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 ContentTypeExtensionPoint
The content type extension pointprotected HierarchicalReferenceTablesHelper
The helper component for hierarchical reference tablesprotected SearchModelCriterionViewItemHelper
The helper forSearchUIModel
criterion definitionprotected SystemPropertyExtensionPoint
The systemPropertyExtension pointFields inherited from class org.ametys.cms.search.ui.model.impl.DefaultSearchUIModel
__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 inSearchUIColumn
s._createReferencingCriteria
(ContentType contentType, 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
_getCriteria
(ContentType contentType) Retrieves the criteria for the given content typeprotected ViewItemContainer
_getResultItems
(ContentType contentType) Retrieves the result items for the given content typevoid
configure
(Configuration configuration) protected SearchModelCriterionViewItem
Retrieves the criteria for content languageprotected SearchModelCriterionViewItem
Retrieves the criteria used to exclude candidatesprotected SearchModelCriterionViewItem
createLikeTitleCriterion
(ElementDefinition titleReference) Retrieves the title attribute criterion, with a 'LIKE' operator and an hidden widgetprotected SearchModelCriterionViewItem
createReferencingCriterionViewItem
(ContentType contentType, ElementDefinition reference) Retrieves aSearchModelCriterionViewItem
for referencing the given definitiongetAdvancedCriteria
(Map<String, Object> contextualParameters) Retrieves the criteria in advanced modegetCriteria
(Map<String, Object> contextualParameters) Retrieves the criteria in simple modegetExcludedContentTypes
(Map<String, Object> contextualParameters) Get the list of excluded content types.getFacetedCriteria
(Map<String, Object> contextualParameters) Retrieves the faceted criteria.getResultItems
(Map<String, Object> contextualParameters) Retrieves the search result itemsvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.cms.search.ui.model.impl.DefaultSearchUIModel
_getAdvancedCriteriaListInfo, addAdvancedCriteria, allowSortOnMultipleJoin, getExportCSVUrl, getExportCSVUrlPlugin, getExportDOCUrl, getExportDOCUrlPlugin, getExportPDFUrl, getExportPDFUrlPlugin, getExportXMLUrl, getExportXMLUrlPlugin, getPageSize, getPrintUrl, getPrintUrlPlugin, getSearchUrl, getSearchUrlPlugin, getSummaryView, setAdvancedCriteria, setAllowSortOnMultipleJoin, setExportCSVUrl, setExportCSVUrlPlugin, setExportDOCUrl, setExportDOCUrlPlugin, setExportPDFUrl, setExportPDFUrlPlugin, setExportXMLUrl, setExportXMLUrlPlugin, setPageSize, setPrintUrl, setPrintUrlPlugin, setSearchUrl, setSearchUrlPlugin, setSummaryView, toJSON
Methods inherited from class org.ametys.cms.search.model.DefaultSearchModel
_resultItemsToJSON, addCriteria, addFacetedCriteria, getContentTypes, 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, getCriterion, getFacetedCriterion, getFamilyId, getId, getModelItems, getResultItem, getWorkspace, resultItemsToJSON
Methods inherited from interface org.ametys.cms.search.ui.model.SearchUIModel
addAdvancedCriterion, addAdvancedCriterion, addCriterion, addCriterion, addFacetedCriterion, addFacetedCriterion, getAdvancedCriterion
-
Field Details
-
_hierarchicalReferenceTableContentsHelper
The helper component for hierarchical reference tables -
_contentTypeExtensionPoint
The content type extension point -
_systemPropertyExtensionPoint
The systemPropertyExtension point -
_searchModelCriterionViewItemHelper
The helper forSearchUIModel
criterion definition
-
-
Constructor Details
-
ReferenceTableSearchUIModel
public ReferenceTableSearchUIModel()
-
-
Method Details
-
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 classDefaultSearchModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- The list of excluded content types.
-
getCriteria
Description copied from interface:SearchModel
Retrieves the criteria in simple mode- Specified by:
getCriteria
in interfaceSearchModel
- Overrides:
getCriteria
in classDefaultSearchModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the criteria in simple mode
-
getFacetedCriteria
Description copied from interface:SearchModel
Retrieves the faceted criteria.- Specified by:
getFacetedCriteria
in interfaceSearchModel
- Overrides:
getFacetedCriteria
in classDefaultSearchModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the faceted criteria.
-
getAdvancedCriteria
Description copied from interface:SearchUIModel
Retrieves the criteria in advanced mode- Specified by:
getAdvancedCriteria
in interfaceSearchUIModel
- Overrides:
getAdvancedCriteria
in classDefaultSearchUIModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the criteria in advanced mode
-
getResultItems
Description copied from interface:SearchModel
Retrieves the search result items- Specified by:
getResultItems
in interfaceSearchModel
- Overrides:
getResultItems
in classDefaultSearchModel
- Parameters:
contextualParameters
- the contextual parameters- Returns:
- the search result items
-
_getCriteria
Retrieves the criteria for the given content type- Parameters:
contentType
- The content type- Returns:
- the criteria
-
_createReferencingCriteria
protected List<ViewItem> _createReferencingCriteria(ContentType contentType, List<ViewItem> viewItems) 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:
contentType
- the content typeviewItems
- the view items to copy- Returns:
- the view items copies
-
createExcludeCandidateCriterion
Retrieves the criteria used to exclude candidates- Returns:
- the criteria used to exclude candidates
-
_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
-
createLikeTitleCriterion
Retrieves the title attribute criterion, with a 'LIKE' operator and an hidden widget- Parameters:
titleReference
- the title reference- Returns:
- the like title criterion
-
createReferencingCriterionViewItem
protected SearchModelCriterionViewItem createReferencingCriterionViewItem(ContentType contentType, ElementDefinition reference) Retrieves aSearchModelCriterionViewItem
for referencing the given definition- Parameters:
contentType
- the simple content type.reference
- the referenced definition.- Returns:
- the criterion
-
createContentLanguageCriterion
Retrieves the criteria for content language- Returns:
- the criteria for content language
-
_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
-