Class SearchServiceCreationHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.frontoffice.search.metamodel.SearchServiceCreationHelper
- All Implemented Interfaces:
LogEnabled,PluginAware,Disposable,Initializable,Component,Contextualizable,Serviceable
public class SearchServiceCreationHelper
extends AbstractLogEnabled
implements Component, Serviceable, Initializable, Disposable, PluginAware, Contextualizable
Helper component for drawing search service creation/edition dialog box.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextThe contextprotected ContentTypeExtensionPointThe extension point for content typesprotected ThreadSafeComponentManager<Enumerator> The enumerator managerprotected ServiceManagerThe service managerprotected StringThe plugin nameprotected ReturnableExtensionPointThe extension point forReturnablesprotected SearchableExtensionPointThe extension point forSearchablesprotected Map<Returnable, Collection<Searchable>> The map returnable -> Collection of searchablesprotected ServiceExtensionPointThe extension point for servicesprotected SiteEnumeratorTheSiteenumeratorprotected SystemPropertyExtensionPointThe extension point forSystemPropertiesstatic final StringAvalon Role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidMethod called at the start of the application based onReturnable.relationsWith()andSearchable.relationsWith()in order to build the data structure (in a map returnable -> Collection of searchables) linkingReturnables andSearchablesvoidcontextualize(Context context) protected voidCreates and initializes enumerators (SiteEnumerator, etc.)voiddispose()Gets the configurations of the additional parameters to display in display groupGets the configurations of the additional parameters to display in general groupGets the additional parameters to displaygetAdditionalParameterValues(Collection<AdditionalSearchServiceParameter> additionalParameters, Map<String, Object> clientSideValues) Gets the values of the additional parameters from a client formgetAdditionalParameterValues(Collection<AdditionalSearchServiceParameter> additionalParameters, ModelAwareDataHolder serviceParameters) Gets the values of the additional parametersgetCriterionDefinitions(Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameterValues) Gets theSearchServiceCriterionDefinitions available with the givenSearchables and additional parameter valuesgetFacetDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theSearchServiceFacetDefinitions available with the givenReturnables and additional parameter valuesgetReturnables(List<String> returnableIds) Gets theReturnables with the given idsgetSearchables(Collection<Returnable> returnables) Gets theSearchables linked with the givenReturnablesgetSortDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theSearchServiceSortDefinitions available with the givenReturnables and additional parameter valuesvoidbooleanisReady()Is this creation helper ready ?Gets theReturnables that must be selected by defaultvoidservice(ServiceManager manager) voidsetAdditionalParameters(Collection<AdditionalSearchServiceParameter> additionalSearchServiceParameters) Sets the additional parameters to displayvoidsetPluginInfo(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
-
Field Details
-
ROLE
Avalon Role -
_manager
The service manager -
_returnableEP
The extension point forReturnables -
_searchableEP
The extension point forSearchables -
_serviceEP
The extension point for services -
_cTypeEP
The extension point for content types -
_systemPropertyEP
The extension point forSystemProperties -
_enumeratorManager
The enumerator manager -
_siteEnumerator
TheSiteenumerator -
_pluginName
The plugin name -
_context
The context -
_searchablesByReturnable
The map returnable -> Collection of searchables
-
-
Constructor Details
-
SearchServiceCreationHelper
public SearchServiceCreationHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
setPluginInfo
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
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
dispose
- Specified by:
disposein interfaceDisposable
-
isReady
Is this creation helper ready ?- Returns:
trueif this creation helper is ready
-
buildTree
Method called at the start of the application based onReturnable.relationsWith()andSearchable.relationsWith()in order to build the data structure (in a map returnable -> Collection of searchables) linkingReturnables andSearchables -
createEnumerators
Creates and initializes enumerators (SiteEnumerator, etc.)- Throws:
Exception- if an error occurs
-
getReturnables
Gets theReturnables with the given ids- Parameters:
returnableIds- the ids of theReturnables- Returns:
- the
Returnables with the given ids
-
getSearchables
Gets theSearchables linked with the givenReturnables- Parameters:
returnables- theReturnables- Returns:
- the
Searchables linked with the givenReturnable
-
getCriterionDefinitions
public Map<String,SearchServiceCriterionDefinition> getCriterionDefinitions(Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameterValues) Gets theSearchServiceCriterionDefinitions available with the givenSearchables and additional parameter values- Parameters:
searchables- TheSearchablesadditionalParameterValues- The additional parameter values- Returns:
- the
SearchServiceCriterionDefinitions available with the givenSearchables and additional parameter values
-
getFacetDefinitions
public Map<String,SearchServiceFacetDefinition> getFacetDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theSearchServiceFacetDefinitions available with the givenReturnables and additional parameter values- Parameters:
returnables- TheReturnablesadditionalParameterValues- The additional parameter values- Returns:
- the
SearchServiceFacetDefinitions available with the givenReturnables and additional parameter values
-
getSortDefinitions
public Map<String,SearchServiceSortDefinition> getSortDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theSearchServiceSortDefinitions available with the givenReturnables and additional parameter values- Parameters:
returnables- TheReturnablesadditionalParameterValues- The additional parameter values- Returns:
- the
SearchServiceSortDefinitions available with the givenReturnables and additional parameter values
-
selectedReturnables
Gets theReturnables that must be selected by default- Returns:
- the
Returnables that must be selected by default
-
getAdditionalParameterConfigurationsForGeneral
Gets the configurations of the additional parameters to display in general group- Returns:
- the configurations of the additional parameters to display
-
getAdditionalParameterConfigurationsForDisplay
Gets the configurations of the additional parameters to display in display group- Returns:
- the configurations of the additional parameters to display
-
setAdditionalParameters
public void setAdditionalParameters(Collection<AdditionalSearchServiceParameter> additionalSearchServiceParameters) Sets the additional parameters to display- Parameters:
additionalSearchServiceParameters- the additional parameters to display
-
getAdditionalParameters
Gets the additional parameters to display- Returns:
- the additional parameters to display
-
getAdditionalParameterValues
public AdditionalParameterValueMap getAdditionalParameterValues(Collection<AdditionalSearchServiceParameter> additionalParameters, ModelAwareDataHolder serviceParameters) Gets the values of the additional parameters- Parameters:
additionalParameters- the additional parametersserviceParameters- the storage of the service parameters- Returns:
- the values of the additional parameters
-
getAdditionalParameterValues
public AdditionalParameterValueMap getAdditionalParameterValues(Collection<AdditionalSearchServiceParameter> additionalParameters, Map<String, Object> clientSideValues) Gets the values of the additional parameters from a client form- Parameters:
additionalParameters- the additional parametersclientSideValues- the values of the client form- Returns:
- the values of the additional parameters from the client form
-