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
SearchableforResources
-
-
Field Summary
Fields Modifier and Type Field Description protected static String__CRITERION_DEFINITIONS_PREFIX_IDThe prefix for the ids of criterion definitionsprotected int_criteriaPositionThe criteria positionprotected I18nizableText_labelThe label
-
Constructor Summary
Constructors Constructor Description ResourceSearchable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Configuration configuration)voidcontextualize(Context context)intcriteriaPosition()The position of the criteria provided by thisSearchableamong criteria provided by otherSearchables.voiddispose()Collection<SearchCriterionDefinition>getCriteria(AdditionalParameterValueMap additionalParameterValues)Gets the criteriaI18nizableTextgetLabel()Gets the label of the searchablevoidinitialize()Optional<Query>joinQuery(Query queryOnCriterion, SearchCriterionDefinition criterion, 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 someReturnables.voidservice(ServiceManager manager)voidsetPluginInfo(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
-
-
Constructor Detail
-
ResourceSearchable
public ResourceSearchable()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAwareSets 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:
setPluginInfoin 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:
contextualizein interfaceContextualizable- Throws:
ContextException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
disposein interfaceDisposable
-
getLabel
public I18nizableText getLabel()
Description copied from interface:SearchableGets the label of the searchable- Specified by:
getLabelin interfaceSearchable- Returns:
- the label of the 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
-
criteriaPosition
public int 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
-
joinQuery
public Optional<Query> joinQuery(Query queryOnCriterion, SearchCriterionDefinition criterion, Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameters)
Description copied from interface:SearchableReturns the query which joins the given one (on a criterion) with the given result types- Specified by:
joinQueryin interfaceSearchable- Parameters:
queryOnCriterion- The query on the criterion to join fromcriterion- the criterionreturnables- The returnables to join toadditionalParameters- The additional parameters- Returns:
- the joined query
-
relationsWith
public Collection<Returnable> 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
-
-