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,Contextualizable,Serviceable
- Direct Known Subclasses:
CalendarContentSearchable,ContentSearchable,CourseSearchable,PrivateContentSearchable,ProgramSearchable
public abstract class AbstractContentBasedSearchable
extends AbstractParameterAdderSearchable
implements Initializable, Contextualizable, Disposable, Cacheable
Abstract class for all
Searchable based on Contents-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.util.Cacheable
Cacheable.SingleCacheConfiguration -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ReturnableThe associated content returnableprotected ContentHelperThe content helperprotected intThe criteria positionprotected ContentTypeExtensionPointThe extension point for content typesprotected StringThe id of extension pointprotected I18nizableTextThe labelprotected ReturnableThe page returnableprotected SearchComponentHelperThe search component helperFields inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdder
_manager, _pluginName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected abstract StringThe Avalon Role for the associated Content ReturnablebuildQuery(AbstractTreeNode<FOSearchCriterion> 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 treevoidconfigure(Configuration configuration) voidcontextualize(Context context) intThe position of the criteria provided by thisSearchableamong criteria provided by otherSearchables.voiddispose()Returns the instance of the implementation ofAbstractCacheManagerto use.protected abstract Collection<String>getContentTypes(AdditionalParameterValueMap additionalParameterValues) Gets the content types which will be used to retrieve the criteria relative to the Indexing ModelgetCriteria(AdditionalParameterValueMap additionalParameterValues) Gets the criteriaprotected abstract StringGets the prefix for criterion definitionsprotected StringGets the prefix for the ids of indexing field criterion definitionsgetLabel()Gets the label of the searchableGets the managed caches.protected StringGets the prefix for the ids of system property criterion definitionsbooleanDetermines if the cache has a computable size.voidRetrieves the relations the type must have with someReturnables.voidservice(ServiceManager manager) Methods inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdder
additionalServiceParameters, setPluginInfoMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.core.util.Cacheable
createCaches, getCache, isCachingEnabled, removeCachesMethods 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 -
_cTypeEP
The extension point for content types -
_contentHelper
The content helper -
_searchComponentHelper
The search component helper
-
-
Constructor Details
-
AbstractContentBasedSearchable
public AbstractContentBasedSearchable()
-
-
Method Details
-
configure
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classAbstractParameterAdder- Throws:
ConfigurationException
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein 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
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
getCacheManager
Description copied from interface:CacheableReturns the instance of the implementation ofAbstractCacheManagerto use.
This is not meant to be called manually.- Specified by:
getCacheManagerin interfaceCacheable- Returns:
- The
AbstractCacheManagerto bind
-
getManagedCaches
Description copied from interface:CacheableGets 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:
getManagedCachesin interfaceCacheable- Returns:
- A collection of
Cacheable.SingleCacheConfigurations to manage
-
hasComputableSize
Description copied from interface:CacheableDetermines if the cache has a computable size. This operation can be very slow.- Specified by:
hasComputableSizein interfaceCacheable- Returns:
trueif we can compute the size on the cache.
-
getSystemPropertyCriterionDefinitionPrefix
Gets the prefix for the ids of system property criterion definitions- Returns:
- the prefix for the ids of system property criterion definitions
-
getCriterionDefinitionPrefix
Gets the prefix for criterion definitions- Returns:
- the prefix for criterion definitions
-
dispose
- Specified by:
disposein interfaceDisposable
-
getLabel
Description copied from interface:SearchableGets the label of the searchable- Specified by:
getLabelin interfaceSearchable- Returns:
- the label of the searchable
-
criteriaPosition
Description copied from interface:SearchableThe position of the criteria provided by thisSearchableamong criteria provided by otherSearchables.
All criteria provided by the sameSearchableare always packed together, this integer just affects the relative position compared to otherSearchablecriteria.
The lowest the integer, the higher it will appear in the UI.- Specified by:
criteriaPositionin interfaceSearchable- Returns:
- The position of the criteria of this
Searchable
-
getCriteria
public Collection<SearchCriterionDefinition> getCriteria(AdditionalParameterValueMap additionalParameterValues) Description copied from interface:SearchableGets the criteria- Specified by:
getCriteriain interfaceSearchable- Parameters:
additionalParameterValues- The additional parameter values- Returns:
- the criteria
-
getContentTypes
protected abstract Collection<String> getContentTypes(AdditionalParameterValueMap additionalParameterValues) Gets the content types which will be used to retrieve the criteria relative to the Indexing Model- Parameters:
additionalParameterValues- The additional parameter values- Returns:
- the content types which will be used to retrieve the criteria relative to the Indexing Model
-
buildQuery
public Query buildQuery(AbstractTreeNode<FOSearchCriterion> criterionTree, Map<String, Object> userCriteria, Collection<Returnable> returnables, Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameters, String currentLang, Map<String, Object> contextualParameters) Description copied from interface:SearchableBuilds the query of the criterion tree- Specified by:
buildQueryin 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
-
getIndexingFieldCriterionDefinitionPrefix
Gets the prefix for the ids of indexing field criterion definitions- Returns:
- the prefix for the ids of indexing field criterion definitions
-
relationsWith
Description copied from interface:SearchableRetrieves the relations the type must have with someReturnables.
It does not have to be exhaustive (for instance ifReturnable.relationsWith()declares the relation, it is useless to declare it twice)- Specified by:
relationsWithin interfaceSearchable- Returns:
- some relations the type must have with some
Returnables
-