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 ContentTypeExtensionPointThe content type extension pointprotected HierarchicalReferenceTablesHelperThe helper component for hierarchical reference tablesprotected SearchModelCriterionViewItemHelperThe helper forSearchUIModelcriterion definitionprotected SystemPropertyExtensionPointThe 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 inSearchUIColumns._createReferencingCriteria(ContentType contentType, 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_getCriteria(ContentType contentType) Retrieves the criteria for the given content typeprotected ViewItemContainer_getResultItems(ContentType contentType) Retrieves the result items for the given content typevoidconfigure(Configuration configuration) protected SearchModelCriterionViewItemRetrieves the criteria for content languageprotected SearchModelCriterionViewItemRetrieves the criteria used to exclude candidatesprotected SearchModelCriterionViewItemcreateLikeTitleCriterion(ElementDefinition titleReference) Retrieves the title attribute criterion, with a 'LIKE' operator and an hidden widgetprotected SearchModelCriterionViewItemcreateReferencingCriterionViewItem(ContentType contentType, ElementDefinition reference) Retrieves aSearchModelCriterionViewItemfor 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 itemsvoidservice(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, toJSONMethods inherited from class org.ametys.cms.search.model.DefaultSearchModel
_resultItemsToJSON, addCriteria, addFacetedCriteria, getContentTypes, getWorkspace, resultItemsToJSON, setContentTypes, setCriteria, setExcludedContentTypes, setFacetedCriteria, setResultItems, setWorkspaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItemMethods inherited from interface org.ametys.cms.search.model.SearchModel
getContentTypes, getCriterion, getFacetedCriterion, getFamilyId, getId, getModelItems, getResultItem, getWorkspace, resultItemsToJSONMethods 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 forSearchUIModelcriterion definition
-
-
Constructor Details
-
ReferenceTableSearchUIModel
public ReferenceTableSearchUIModel()
-
-
Method Details
-
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 classDefaultSearchModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- The list of excluded content types.
-
getCriteria
Description copied from interface:SearchModelRetrieves the criteria in simple mode- Specified by:
getCriteriain interfaceSearchModel- Overrides:
getCriteriain classDefaultSearchModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the criteria in simple mode
-
getFacetedCriteria
Description copied from interface:SearchModelRetrieves the faceted criteria.- Specified by:
getFacetedCriteriain interfaceSearchModel- Overrides:
getFacetedCriteriain classDefaultSearchModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the faceted criteria.
-
getAdvancedCriteria
Description copied from interface:SearchUIModelRetrieves the criteria in advanced mode- Specified by:
getAdvancedCriteriain interfaceSearchUIModel- Overrides:
getAdvancedCriteriain classDefaultSearchUIModel- Parameters:
contextualParameters- the contextual parameters- Returns:
- the criteria in advanced mode
-
getResultItems
Description copied from interface:SearchModelRetrieves the search result items- Specified by:
getResultItemsin interfaceSearchModel- Overrides:
getResultItemsin 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 inSearchUIColumns. 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
Returnstrueif the model item can be used as criteria- Parameters:
modelItem- the model item- Returns:
trueif 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 aSearchModelCriterionViewItemfor 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 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
-