Class ResourceSearchable
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.frontoffice.search.metamodel.impl.ResourceSearchable
-
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Searchable
,Disposable
,Initializable
,Configurable
,Contextualizable
,Serviceable
public class ResourceSearchable extends AbstractLogEnabled implements Searchable, Serviceable, PluginAware, Contextualizable, Initializable, Disposable, Configurable
Searchable
forResource
s
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
__CRITERION_DEFINITIONS_PREFIX_ID
The prefix for the ids of criterion definitionsprivate Returnable
_contentReturnable
private Context
_context
protected int
_criteriaPosition
The criteria positionprivate DublinCoreMetadataProvider
_dcProvider
private ThreadSafeComponentManager<Enumerator>
_enumeratorManager
protected I18nizableText
_label
The labelprivate ServiceManager
_manager
private Returnable
_pageReturnable
private String
_pluginName
private Returnable
_resourceReturnable
private LanguageEnumerator
_sitemapEnumerator
-
Constructor Summary
Constructors Constructor Description ResourceSearchable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_isSubQueryNonEmpty(Query queryOnCriterion)
private Query
_queryOnContent(Query queryOnVisibleContentAttachments)
private Query
_queryOnPage(Query queryOnVisiblePageAttachments)
private Query
_queryOnPageThroughContents(Query queryOnVisibleContentAttachments)
void
configure(Configuration configuration)
void
contextualize(Context context)
int
criteriaPosition()
The position of the criteria provided by thisSearchable
among criteria provided by otherSearchable
s.void
dispose()
Collection<SearchCriterionDefinition>
getCriteria(AdditionalParameterValueMap additionalParameterValues)
Gets the criteriaI18nizableText
getLabel()
Gets the label of the searchablevoid
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.void
service(ServiceManager manager)
void
setPluginInfo(String pluginName, String featureName, String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.-
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
-
__CRITERION_DEFINITIONS_PREFIX_ID
protected static final String __CRITERION_DEFINITIONS_PREFIX_ID
The prefix for the ids of criterion definitions- See Also:
- Constant Field Values
-
_label
protected I18nizableText _label
The label
-
_criteriaPosition
protected int _criteriaPosition
The criteria position
-
_manager
private ServiceManager _manager
-
_resourceReturnable
private Returnable _resourceReturnable
-
_pageReturnable
private Returnable _pageReturnable
-
_contentReturnable
private Returnable _contentReturnable
-
_pluginName
private String _pluginName
-
_dcProvider
private DublinCoreMetadataProvider _dcProvider
-
_enumeratorManager
private ThreadSafeComponentManager<Enumerator> _enumeratorManager
-
_sitemapEnumerator
private LanguageEnumerator _sitemapEnumerator
-
-
Constructor Detail
-
ResourceSearchable
public ResourceSearchable()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
getLabel
public I18nizableText getLabel()
Description copied from interface:Searchable
Gets the label of the searchable- Specified by:
getLabel
in interfaceSearchable
- Returns:
- the label of the searchable
-
getCriteria
public Collection<SearchCriterionDefinition> 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
-
criteriaPosition
public int 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
-
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- Specified by:
joinQuery
in interfaceSearchable
- Parameters:
queryOnCriterion
- The query on the criterion to join fromreturnables
- The returnables to join toadditionalParameters
- The additional parameters- Returns:
- the joined query
-
_isSubQueryNonEmpty
private boolean _isSubQueryNonEmpty(Query queryOnCriterion)
-
_queryOnContent
private Query _queryOnContent(Query queryOnVisibleContentAttachments)
-
_queryOnPage
private Query _queryOnPage(Query queryOnVisiblePageAttachments)
-
_queryOnPageThroughContents
private Query _queryOnPageThroughContents(Query queryOnVisibleContentAttachments)
-
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
- Returns:
- some relations the type must have with some
Returnable
s
-
-