Class AbstractContentBasedReturnable
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdder
org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdderReturnable
org.ametys.web.frontoffice.search.metamodel.impl.AbstractContentBasedReturnable
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Returnable
,Initializable
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
ContentReturnable
,CourseReturnable
,PrivateContentReturnable
,ProgramReturnable
public abstract class AbstractContentBasedReturnable
extends AbstractParameterAdderReturnable
implements Contextualizable, Initializable
Abstract class for all
Returnable
based on Content
s-
Field Summary
Modifier and TypeFieldDescriptionprotected AbstractContentBasedSearchable
The associated content searchableprotected ContentFilterHelper
The content filter helperprotected ContentHelper
The content helperprotected Context
The contextprotected I18nizableText
The labelprotected SearchableExtensionPoint
The extension point for searchablesFields inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdder
_manager, _pluginName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected abstract String
The Avalon Role for the associated Content Searchablevoid
configure
(Configuration configuration) void
contextualize
(Context context) filterReturnedDocumentQuery
(Collection<ContextQueriesWrapper> contextQueriesWrappers, AdditionalParameterValueMap additionalParameterValues) Returns the query to execute in order to filter returned objects (according to their type) during the search.protected abstract Collection<String>
getContentTypes
(AdditionalParameterValueMap additionalParameterValues) Gets the content types which will be used to construct the query to filter the returned documentsprotected abstract String
Gets the prefix for definitions (for facets, sorts...)getFacets
(AdditionalParameterValueMap additionalParameterValues) Gets the facetsgetLabel()
Gets the label of the type of resultgetSorts
(AdditionalParameterValueMap additionalParameterValues) Gets the sortsvoid
protected SearchContext.LangQueryProducer
The producer of the lang queryRetrieves the relations the type must have with someSearchable
s.void
service
(ServiceManager manager) The joiner for the sitemap queryThe joiner for the site queryThe joiner for the tag queryMethods 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.web.frontoffice.search.metamodel.Returnable
additionalServiceParameters, getId, getSaxer, selectedByDefault
-
Field Details
-
_contentFilterHelper
The content filter helper -
_contentHelper
The content helper -
_searchableEP
The extension point for searchables -
_associatedContentSearchable
The associated content searchable -
_context
The context -
_label
The label
-
-
Constructor Details
-
AbstractContentBasedReturnable
public AbstractContentBasedReturnable()
-
-
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
-
_setAssociatedContentSearchable
Sets_associatedContentSearchable
. Called duringinitialize()
-
associatedContentSearchableRole
The Avalon Role for the associated Content Searchable- Returns:
- The Avalon Role for the associated Content Searchable
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getLabel
Description copied from interface:Returnable
Gets the label of the type of result- Specified by:
getLabel
in interfaceReturnable
- Returns:
- the label of the type of result
-
filterReturnedDocumentQuery
public Query filterReturnedDocumentQuery(Collection<ContextQueriesWrapper> contextQueriesWrappers, AdditionalParameterValueMap additionalParameterValues) Description copied from interface:Returnable
Returns the query to execute in order to filter returned objects (according to their type) during the search.
It should callContextQueriesWrapper#getQuery
in order to make aJoinQuery
on interesting parts ofContextQueriesWrapper
s and then constructs anAndQuery
composed of aDocumentTypeQuery
and the result of the call.- Specified by:
filterReturnedDocumentQuery
in interfaceReturnable
- Parameters:
contextQueriesWrappers
- The contextqueries
additionalParameterValues
- The additional parameter values- Returns:
- the query to execute in order to filter returned objects (according to their type) during the search.
-
siteQueryJoiner
The joiner for the site query- Returns:
- The joiner for the site query
-
sitemapQueryJoiner
The joiner for the sitemap query- Returns:
- The joiner for the sitemap query
-
langQueryProducer
The producer of the lang query- Returns:
- The producer of the lang query
-
tagQueryJoiner
The joiner for the tag query- Returns:
- The joiner for the tag query
-
getContentTypes
protected abstract Collection<String> getContentTypes(AdditionalParameterValueMap additionalParameterValues) Gets the content types which will be used to construct the query to filter the returned documents- Parameters:
additionalParameterValues
- The additional parameter values- Returns:
- the content types which will be used to construct the query to filter the returned documents
-
getFacets
Description copied from interface:Returnable
Gets the facets- Specified by:
getFacets
in interfaceReturnable
- Parameters:
additionalParameterValues
- The additional parameter values- Returns:
- the facets
-
getSorts
Description copied from interface:Returnable
Gets the sorts- Specified by:
getSorts
in interfaceReturnable
- Parameters:
additionalParameterValues
- The additional parameter values- Returns:
- the sorts
-
getDefinitionPrefix
Gets the prefix for definitions (for facets, sorts...)- Returns:
- the prefix for definitions
-
relationsWith
Description copied from interface:Returnable
Retrieves the relations the type must have with someSearchable
s.
It does not have to be exhaustive (for instance ifSearchable.relationsWith()
declares the relation, it is useless to declare it twice)- Specified by:
relationsWith
in interfaceReturnable
- Returns:
- some relations the type must have with some
Searchable
s
-