Class AbstractContentBasedSearchable
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdder
org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdderSearchable
org.ametys.web.frontoffice.search.metamodel.impl.AbstractContentBasedSearchable
- All Implemented Interfaces:
Cacheable
,LogEnabled
,PluginAware
,Searchable
,Disposable
,Initializable
,Configurable
,Serviceable
- Direct Known Subclasses:
CalendarContentSearchable
,ContentSearchable
,CourseSearchable
,PrivateContentSearchable
,ProgramSearchable
public abstract class AbstractContentBasedSearchable
extends AbstractParameterAdderSearchable
implements Initializable, Disposable, Cacheable
Abstract class for all
Searchable
based on Content
s-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.util.Cacheable
Cacheable.SingleCacheConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Returnable
The associated content returnableprotected ContentHelper
The content helperprotected ContentTypeExtensionPoint
The extension point for content typesprotected ContentTypesHelper
The content types helperprotected int
The criteria positionprotected String
The id of extension pointprotected I18nizableText
The labelprotected Returnable
The page returnableprotected SearchComponentHelper
The search component helperFields inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdder
_manager, _pluginName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected abstract String
The Avalon Role for the associated Content ReturnablebuildQuery
(AbstractTreeNode<SearchServiceCriterion<?>> criterionTree, Map<String, Object> userCriteria, Collection<Returnable> returnables, Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameters, String currentLang, Map<String, Object> contextualParameters) Builds the query of the criterion treevoid
configure
(Configuration configuration) int
The position of the criteria provided by thisSearchable
among criteria provided by otherSearchable
s.void
dispose()
Returns the instance of the implementation ofAbstractCacheManager
to use.getContentTypeIds
(AdditionalParameterValueMap additionalParameterValues) Gets the content type identifiers which will be used to retrieve the criteriagetCriteria
(AdditionalParameterValueMap additionalParameterValues) Gets the criteriaprotected abstract String
Gets the prefix for criterion definitionsgetLabel()
Gets the label of the searchableGets the managed caches.Retrieves the name of the title criterion definitionboolean
Determines if the cache has a computable size.void
Retrieves the relations the type must have with someReturnable
s.void
service
(ServiceManager manager) Methods inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdder
additionalServiceParameters, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.core.util.Cacheable
createCaches, getCache, isCachingEnabled, removeCaches
Methods inherited from interface org.ametys.web.frontoffice.search.metamodel.Searchable
additionalServiceParameters, joinQuery
-
Field Details
-
_id
The id of extension point -
_label
The label -
_criteriaPosition
The criteria position -
_pageReturnable
The page returnable -
_associatedContentReturnable
The associated content returnable -
_contentTypeExtensionPoint
The extension point for content types -
_contentHelper
The content helper -
_contentTypesHelper
The content types helper -
_searchComponentHelper
The search component helper
-
-
Constructor Details
-
AbstractContentBasedSearchable
public AbstractContentBasedSearchable()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAbstractParameterAdder
- Throws:
ConfigurationException
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractParameterAdder
- Throws:
ServiceException
-
_setAssociatedContentReturnable
Sets_associatedContentReturnable
. Called duringinitialize()
-
associatedContentReturnableRole
The Avalon Role for the associated Content Returnable- Returns:
- The Avalon Role for the associated Content Returnable
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getCacheManager
Description copied from interface:Cacheable
Returns the instance of the implementation ofAbstractCacheManager
to use.
This is not meant to be called manually.- Specified by:
getCacheManager
in interfaceCacheable
- Returns:
- The
AbstractCacheManager
to bind
-
getManagedCaches
Description copied from interface:Cacheable
Gets the managed caches.
This is meant to be implemented in order to describe the managed caches and automatically create and remove the corresponding caches inCacheable.createCaches()
andCacheable.removeCaches()
default methods.
This is not meant to be called manually.- Specified by:
getManagedCaches
in interfaceCacheable
- Returns:
- A collection of
Cacheable.SingleCacheConfiguration
s to manage
-
hasComputableSize
Description copied from interface:Cacheable
Determines if the cache has a computable size. This operation can be very slow.- Specified by:
hasComputableSize
in interfaceCacheable
- Returns:
true
if we can compute the size on the cache.
-
getCriterionDefinitionPrefix
Gets the prefix for criterion definitions- Returns:
- the prefix for criterion definitions
-
dispose
- Specified by:
dispose
in interfaceDisposable
-
getLabel
Description copied from interface:Searchable
Gets the label of the searchable- Specified by:
getLabel
in interfaceSearchable
- Returns:
- the label of the searchable
-
criteriaPosition
Description copied from interface:Searchable
The position of the criteria provided by thisSearchable
among criteria provided by otherSearchable
s.
All criteria provided by the sameSearchable
are always packed together, this integer just affects the relative position compared to otherSearchable
criteria.
The lowest the integer, the higher it will appear in the UI.- Specified by:
criteriaPosition
in interfaceSearchable
- Returns:
- The position of the criteria of this
Searchable
-
getCriteria
public Collection<SearchServiceCriterionDefinition> getCriteria(AdditionalParameterValueMap additionalParameterValues) Description copied from interface:Searchable
Gets the criteria- Specified by:
getCriteria
in interfaceSearchable
- Parameters:
additionalParameterValues
- The additional parameter values- Returns:
- the criteria
-
getContentTypeIds
protected abstract Set<String> getContentTypeIds(AdditionalParameterValueMap additionalParameterValues) Gets the content type identifiers which will be used to retrieve the criteria- Parameters:
additionalParameterValues
- The additional parameter values- Returns:
- the content type identifiers which will be used to retrieve the criteria
-
buildQuery
public Query buildQuery(AbstractTreeNode<SearchServiceCriterion<?>> criterionTree, Map<String, Object> userCriteria, Collection<Returnable> returnables, Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameters, String currentLang, Map<String, Object> contextualParameters) Description copied from interface:Searchable
Builds the query of the criterion tree- Specified by:
buildQuery
in interfaceSearchable
- Parameters:
criterionTree
- The criterion tree of the service instanceuserCriteria
- The user input criteriareturnables
- The returnables of the service instancesearchables
- The searchables of the service instanceadditionalParameters
- The values of additional parameters of the service instancecurrentLang
- The current langcontextualParameters
- the search contextual parameters.- Returns:
- The query of the criterion tree
-
getTitleCriterionDefinitionName
Retrieves the name of the title criterion definition- Returns:
- the name of the title criterion definition
-
relationsWith
Description copied from interface:Searchable
Retrieves the relations the type must have with someReturnable
s.
It does not have to be exhaustive (for instance ifReturnable.relationsWith()
declares the relation, it is useless to declare it twice)- Specified by:
relationsWith
in interfaceSearchable
- Returns:
- some relations the type must have with some
Returnable
s
-