Package org.ametys.cms.search.ui.model
Class SearchModelCriterionViewItemHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.search.ui.model.SearchModelCriterionViewItemHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class SearchModelCriterionViewItemHelper
extends AbstractLogEnabled
implements Component, Serviceable
Helper for referencing
CriterionDefinition
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentSearchHelper
The content search helperprotected SearchModelCriterionDefinitionHelper
The search model criterion definition helperstatic final String
The component role. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateReferencingCriterionViewItem
(Model searchModel, String referencePath) Retrieves aSearchModelCriterionViewItem
referencing the element at the given pathcreateReferencingCriterionViewItem
(Model searchModel, String referencePath, Collection<ContentType> contentTypes) Retrieves aSearchModelCriterionViewItem
referencing the element at the given pathcreateReferencingCriterionViewItem
(Model searchModel, String referencePath, Set<String> contentTypeIds) Retrieves aSearchModelCriterionViewItem
referencing the element at the given pathcreateReferencingCriterionViewItem
(Model searchModel, String referencePath, ContentType... contentTypes) Retrieves aSearchModelCriterionViewItem
referencing the element at the given pathcreateReferencingCriterionViewItem
(Model searchModel, ElementDefinition reference, String referencePath) Retrieves aSearchModelCriterionViewItem
referencing the given definitionvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role. -
_contentSearchHelper
The content search helper -
_criterionDefinitionHelper
The search model criterion definition helper
-
-
Constructor Details
-
SearchModelCriterionViewItemHelper
public SearchModelCriterionViewItemHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
createReferencingCriterionViewItem
public SearchModelCriterionViewItem createReferencingCriterionViewItem(Model searchModel, String referencePath) Retrieves aSearchModelCriterionViewItem
referencing the element at the given path- Parameters:
searchModel
- TheSearchUIModel
defining this criterionreferencePath
- the path of the element to reference- Returns:
- the
SearchModelCriterionViewItem
-
createReferencingCriterionViewItem
public SearchModelCriterionViewItem createReferencingCriterionViewItem(Model searchModel, String referencePath, ContentType... contentTypes) Retrieves aSearchModelCriterionViewItem
referencing the element at the given path- Parameters:
searchModel
- TheSearchUIModel
defining this criterionreferencePath
- the path of the element to referencecontentTypes
- the content types containing the reference- Returns:
- the
SearchModelCriterionViewItem
-
createReferencingCriterionViewItem
public SearchModelCriterionViewItem createReferencingCriterionViewItem(Model searchModel, String referencePath, Collection<ContentType> contentTypes) Retrieves aSearchModelCriterionViewItem
referencing the element at the given path- Parameters:
searchModel
- TheSearchUIModel
defining this criterionreferencePath
- the path of the element to referencecontentTypes
- the content types containing the reference- Returns:
- the
SearchModelCriterionViewItem
-
createReferencingCriterionViewItem
public SearchModelCriterionViewItem createReferencingCriterionViewItem(Model searchModel, String referencePath, Set<String> contentTypeIds) Retrieves aSearchModelCriterionViewItem
referencing the element at the given path- Parameters:
searchModel
- TheSearchUIModel
defining this criterionreferencePath
- the path of the element to referencecontentTypeIds
- the identifiers of the content types containing the reference- Returns:
- the
SearchModelCriterionViewItem
-
createReferencingCriterionViewItem
public SearchModelCriterionViewItem createReferencingCriterionViewItem(Model searchModel, ElementDefinition reference, String referencePath) Retrieves aSearchModelCriterionViewItem
referencing the given definition- Parameters:
searchModel
- TheSearchUIModel
defining this criterionreference
- the definition of the element to referencereferencePath
- the path of the reference from the model containing the reference- Returns:
- the
SearchModelCriterionViewItem
.Can benull
if the reference can not be used as a criterion
-