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
Modifier and TypeFieldDescriptionprotected Context
The contextprotected ContentTypeExtensionPoint
The extension point for content typesprotected ThreadSafeComponentManager<Enumerator>
The enumerator managerprotected ServiceManager
The service managerprotected String
The plugin nameprotected ReturnableExtensionPoint
The extension point forReturnable
sprotected SearchableExtensionPoint
The extension point forSearchable
sprotected Map<Returnable,
Collection<Searchable>> The map returnable -> Collection of searchablesprotected ServiceExtensionPoint
The extension point for servicesprotected SiteEnumerator
TheSite
enumeratorprotected SiteQueryHelper
The helper for site queryprotected SystemPropertyExtensionPoint
The extension point forSystemProperties
static final String
Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
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) linkingReturnable
s andSearchable
svoid
contextualize
(Context context) protected void
Creates and initializes enumerators (SiteEnumerator
, etc.)void
dispose()
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 theSearchCriterionDefinition
s available with the givenSearchable
s and additional parameter valuesgetFacetDefinitions
(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theFacetDefinition
s available with the givenReturnable
s and additional parameter valuesgetReturnables
(List<String> returnableIds) Gets theReturnable
s with the given idsgetSearchables
(Collection<Returnable> returnables) Gets theSearchable
s linked with the givenReturnable
sgetSortDefinitions
(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theSortDefinition
s available with the givenReturnable
s and additional parameter valuesvoid
boolean
isReady()
Is this creation helper ready ?Gets theReturnable
s that must be selected by defaultvoid
service
(ServiceManager manager) void
setAdditionalParameters
(Collection<AdditionalSearchServiceParameter> additionalSearchServiceParameters) Sets the additional parameters to displayvoid
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
-
Field Details
-
ROLE
Avalon Role -
_manager
The service manager -
_returnableEP
The extension point forReturnable
s -
_searchableEP
The extension point forSearchable
s -
_serviceEP
The extension point for services -
_cTypeEP
The extension point for content types -
_systemPropertyEP
The extension point forSystemProperties
-
_siteQueryHelper
The helper for site query -
_enumeratorManager
The enumerator manager -
_siteEnumerator
TheSite
enumerator -
_pluginName
The plugin name -
_context
The context -
_searchablesByReturnable
The map returnable -> Collection of searchables
-
-
Constructor Details
-
SearchServiceCreationHelper
public SearchServiceCreationHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
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
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
- Specified by:
dispose
in interfaceDisposable
-
isReady
Is this creation helper ready ?- Returns:
true
if 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) linkingReturnable
s andSearchable
s -
createEnumerators
Creates and initializes enumerators (SiteEnumerator
, etc.)- Throws:
Exception
- if an error occurs
-
getReturnables
Gets theReturnable
s with the given ids- Parameters:
returnableIds
- the ids of theReturnable
s- Returns:
- the
Returnable
s with the given ids
-
getSearchables
Gets theSearchable
s linked with the givenReturnable
s- Parameters:
returnables
- theReturnable
s- Returns:
- the
Searchable
s linked with the givenReturnable
-
getCriterionDefinitions
public Map<String,SearchCriterionDefinition> getCriterionDefinitions(Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameterValues) Gets theSearchCriterionDefinition
s available with the givenSearchable
s and additional parameter values- Parameters:
searchables
- TheSearchable
sadditionalParameterValues
- The additional parameter values- Returns:
- the
SearchCriterionDefinition
s available with the givenSearchable
s and additional parameter values
-
getFacetDefinitions
public Map<String,FacetDefinition> getFacetDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theFacetDefinition
s available with the givenReturnable
s and additional parameter values- Parameters:
returnables
- TheReturnable
sadditionalParameterValues
- The additional parameter values- Returns:
- the
FacetDefinition
s available with the givenReturnable
s and additional parameter values
-
getSortDefinitions
public Map<String,SortDefinition> getSortDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues) Gets theSortDefinition
s available with the givenReturnable
s and additional parameter values- Parameters:
returnables
- TheReturnable
sadditionalParameterValues
- The additional parameter values- Returns:
- the
SortDefinition
s available with the givenReturnable
s and additional parameter values
-
selectedReturnables
Gets theReturnable
s that must be selected by default- Returns:
- the
Returnable
s 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
-