Class PrivateContentSearchable
- 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
-
- org.ametys.web.frontoffice.search.metamodel.impl.PrivateContentSearchable
-
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Searchable
,Disposable
,Initializable
,Configurable
,Contextualizable
,Serviceable
public class PrivateContentSearchable extends AbstractContentBasedSearchable
This class is a generic searchable to be used to search on aprivate
ContentType
.
You must associate it with aReturnable
which is or extendsPrivateContentReturnable
<extension point="org.ametys.web.frontoffice.search.metamodel.SearchableExtensionPoint" id="my.searchable.id" class="org.ametys.web.frontoffice.search.metamodel.impl.PrivateContentSearchable"> <label i18n="true">...</label> <criteriaPosition>11</criteriaPosition> <associatedReturnable>my.returnable.id</associatedReturnable> <baseContentType>my.content.type.1</baseContentType> <baseContentType>my.content.type.2</baseContentType> <contentTypeParameter order="99"> <label i18n="true">...</label> <description i18n="true">...</description> </contentTypeParameter> </extension>
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__PARAMETER_SUB_CONTENT_TYPES_SUFFIX
protected String
_associatedContentReturnableRole
The associated content returnable roleprotected String
_avalonRole
The Avalon role of this Searchableprotected Collection<String>
_baseContentTypes
The base private content types of this searchableprotected String
_criterionDefinitionPrefix
Theprefix
for criterion definitionsprotected String
_parameterSubContentTypeUniqueName
The unique name accross the whole application for the parameter for this searchable to select the sub content types.protected String
_shortAvalonRole
The "short version" of the Avalon role of this Searchable-
Fields inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractContentBasedSearchable
_associatedContentReturnable, _criteriaPosition, _cTypeEP, _label, _pageReturnable
-
Fields inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractParameterAdder
_manager, _pluginName
-
-
Constructor Summary
Constructors Constructor Description PrivateContentSearchable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_configureAssociatedContentReturnableRole(Configuration configuration)
Initializes_associatedContentReturnableRole
field from configurationprotected void
_configureBaseContentTypes(Configuration configuration)
Initializes_baseContentTypes
field from configurationprotected void
_initAvalonRole(Configuration configuration)
Initializes_avalonRole
field from configurationprotected void
_initCriterionDefinitionPrefix()
Initializes_criterionDefinitionPrefix
fieldprotected void
_initParameterSubContentTypeUniqueName()
Initializes_parameterSubContentTypeUniqueName
fieldprotected void
_initShortAvalonRole()
Initializes_shortAvalonRole
fieldprivate boolean
_isHandledContentType(String cTypeId)
protected String
associatedContentReturnableRole()
The Avalon Role for the associated Content Returnableprotected Configuration
buildFinalConfiguration(Configuration initialConfiguration)
Builds the final configuration object which will be passed to the superclass, from the "real" XML configurationprotected Configuration
buildParametersConfiguration(Configuration initialConfiguration)
Builds the configuration object for parametersvoid
configure(Configuration configuration)
protected Collection<String>
getContentTypes(AdditionalParameterValueMap additionalParameterValues)
Gets the content types which will be used to retrieve the criteria relative to the Indexing Modelprotected String
getCriterionDefinitionPrefix()
Gets the prefix for criterion definitionsvoid
initialize()
Optional<Query>
joinQuery(Query queryOnCriterion, Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameters)
Returns the query which joins the given one (on a criterion) with the given result typesCollection<Returnable>
relationsWith()
Retrieves the relations the type must have with someReturnable
s.-
Methods inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractContentBasedSearchable
_setAssociatedContentReturnable, contextualize, criteriaPosition, dispose, getCriteria, getIndexingFieldCriterionDefinitionPrefix, getLabel, getSystemPropertyCriterionDefinitionPrefix, service
-
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.web.frontoffice.search.metamodel.Searchable
additionalServiceParameters
-
-
-
-
Field Detail
-
__PARAMETER_SUB_CONTENT_TYPES_SUFFIX
private static final String __PARAMETER_SUB_CONTENT_TYPES_SUFFIX
- See Also:
- Constant Field Values
-
_avalonRole
protected String _avalonRole
The Avalon role of this Searchable
-
_shortAvalonRole
protected String _shortAvalonRole
The "short version" of the Avalon role of this Searchable
-
_parameterSubContentTypeUniqueName
protected String _parameterSubContentTypeUniqueName
The unique name accross the whole application for the parameter for this searchable to select the sub content types.
-
_associatedContentReturnableRole
protected String _associatedContentReturnableRole
The associated content returnable role
-
_criterionDefinitionPrefix
protected String _criterionDefinitionPrefix
Theprefix
for criterion definitions
-
_baseContentTypes
protected Collection<String> _baseContentTypes
The base private content types of this searchable
-
-
Constructor Detail
-
PrivateContentSearchable
public PrivateContentSearchable()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAbstractContentBasedSearchable
- Throws:
ConfigurationException
-
buildFinalConfiguration
protected Configuration buildFinalConfiguration(Configuration initialConfiguration) throws ConfigurationException
Builds the final configuration object which will be passed to the superclass, from the "real" XML configuration- Parameters:
initialConfiguration
- The source configuration- Returns:
- the built configuration object
- Throws:
ConfigurationException
- If some values or attributes cannot be retrieved
-
buildParametersConfiguration
protected Configuration buildParametersConfiguration(Configuration initialConfiguration) throws ConfigurationException
Builds the configuration object for parameters- Parameters:
initialConfiguration
- The source configuration- Returns:
- the configuration object for parameters
- Throws:
ConfigurationException
- If some values or attributes cannot be retrieved
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAbstractContentBasedSearchable
- Throws:
Exception
-
associatedContentReturnableRole
protected String associatedContentReturnableRole()
Description copied from class:AbstractContentBasedSearchable
The Avalon Role for the associated Content Returnable- Specified by:
associatedContentReturnableRole
in classAbstractContentBasedSearchable
- Returns:
- The Avalon Role for the associated Content Returnable
-
getCriterionDefinitionPrefix
protected String getCriterionDefinitionPrefix()
Description copied from class:AbstractContentBasedSearchable
Gets the prefix for criterion definitions- Specified by:
getCriterionDefinitionPrefix
in classAbstractContentBasedSearchable
- Returns:
- the prefix for criterion definitions
-
relationsWith
public Collection<Returnable> 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
- Overrides:
relationsWith
in classAbstractContentBasedSearchable
- Returns:
- some relations the type must have with some
Returnable
s
-
getContentTypes
protected Collection<String> getContentTypes(AdditionalParameterValueMap additionalParameterValues)
Description copied from class:AbstractContentBasedSearchable
Gets the content types which will be used to retrieve the criteria relative to the Indexing Model- Specified by:
getContentTypes
in classAbstractContentBasedSearchable
- Parameters:
additionalParameterValues
- The additional parameter values- Returns:
- the content types which will be used to retrieve the criteria relative to the Indexing Model
-
joinQuery
public Optional<Query> joinQuery(Query queryOnCriterion, Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameters)
Description copied from interface:Searchable
Returns the query which joins the given one (on a criterion) with the given result types- Parameters:
queryOnCriterion
- The query on the criterion to join fromreturnables
- The returnables to join toadditionalParameters
- The additional parameters- Returns:
- the joined query
-
_initAvalonRole
protected void _initAvalonRole(Configuration configuration) throws ConfigurationException
Initializes_avalonRole
field from configuration- Parameters:
configuration
- The configuration- Throws:
ConfigurationException
- If a configuration value cannot be retrieved
-
_initShortAvalonRole
protected void _initShortAvalonRole()
Initializes_shortAvalonRole
field
-
_initParameterSubContentTypeUniqueName
protected void _initParameterSubContentTypeUniqueName()
Initializes_parameterSubContentTypeUniqueName
field
-
_configureAssociatedContentReturnableRole
protected void _configureAssociatedContentReturnableRole(Configuration configuration) throws ConfigurationException
Initializes_associatedContentReturnableRole
field from configuration- Parameters:
configuration
- The configuration- Throws:
ConfigurationException
- If a configuration value cannot be retrieved
-
_configureBaseContentTypes
protected void _configureBaseContentTypes(Configuration configuration) throws ConfigurationException
Initializes_baseContentTypes
field from configuration- Parameters:
configuration
- The configuration- Throws:
ConfigurationException
- If a configuration value cannot be retrieved
-
_isHandledContentType
private boolean _isHandledContentType(String cTypeId)
-
_initCriterionDefinitionPrefix
protected void _initCriterionDefinitionPrefix()
Initializes_criterionDefinitionPrefix
field
-
-