public class SearchServiceCreationHelper extends AbstractLogEnabled implements Component, Serviceable, Initializable, PluginAware, Contextualizable
Modifier and Type | Field and Description |
---|---|
private Collection<AdditionalSearchServiceParameter> |
_additionalSearchServiceParameters |
protected Context |
_context
The context
|
protected ContentTypeExtensionPoint |
_cTypeEP
The extension point for content types
|
protected ThreadSafeComponentManager<Enumerator> |
_enumeratorManager
The enumerator manager
|
protected ServiceManager |
_manager
The service manager
|
protected String |
_pluginName
The plugin name
|
protected ReturnableExtensionPoint |
_returnableEP
The extension point for
Returnable s |
protected SearchableExtensionPoint |
_searchableEP
The extension point for
Searchable s |
protected Map<Returnable,Collection<Searchable>> |
_searchablesByReturnable
The map returnable -> Collection of searchables
|
protected ServiceExtensionPoint |
_serviceEP
The extension point for services
|
protected SiteEnumerator |
_siteEnumerator
The
Site enumerator |
protected SiteQueryHelper |
_siteQueryHelper
The helper for site query
|
protected SystemPropertyExtensionPoint |
_systemPropertyEP
The extension point for
SystemProperties |
static String |
ROLE
Avalon Role
|
Constructor and Description |
---|
SearchServiceCreationHelper() |
Modifier and Type | Method and Description |
---|---|
private Collection<Configuration> |
_getAdditionalParameterConfigurationsOfReturnables() |
private Collection<Configuration> |
_getAdditionalParameterConfigurationsOfSearchables() |
private <T> Object |
_getAdditionalParameterValue(ModelAwareDataHolder serviceParameters,
ServiceParameter<T> parameter) |
private Stream<Searchable> |
_getSearchables(Stream<Returnable> returnables) |
protected void |
buildTree()
Method called at the start of the application based on
Returnable.relationsWith() and Searchable.relationsWith()
in order to build the data structure (in a map returnable -> Collection of searchables)
linking Returnable s and Searchable s |
void |
contextualize(Context context) |
protected void |
createEnumerators()
Creates and initializes enumerators (
SiteEnumerator , etc.) |
Collection<Configuration> |
getAdditionalParameterConfigurationsForDisplay()
Gets the configurations of the additional parameters to display in display group
|
Collection<Configuration> |
getAdditionalParameterConfigurationsForGeneral()
Gets the configurations of the additional parameters to display in general group
|
Collection<AdditionalSearchServiceParameter> |
getAdditionalParameters()
Gets the additional parameters to display
|
AdditionalParameterValueMap |
getAdditionalParameterValues(Collection<AdditionalSearchServiceParameter> additionalParameters,
Map<String,Object> clientSideValues)
Gets the values of the additional parameters from a client form
|
AdditionalParameterValueMap |
getAdditionalParameterValues(Collection<AdditionalSearchServiceParameter> additionalParameters,
ModelAwareDataHolder serviceParameters)
Gets the values of the additional parameters
|
Map<String,SearchCriterionDefinition> |
getCriterionDefinitions(Collection<Searchable> searchables,
AdditionalParameterValueMap additionalParameterValues)
Gets the
SearchCriterionDefinition s available with the given Searchable s and additional parameter values |
Map<String,FacetDefinition> |
getFacetDefinitions(Collection<Returnable> returnables,
AdditionalParameterValueMap additionalParameterValues)
Gets the
FacetDefinition s available with the given Returnable s and additional parameter values |
List<Returnable> |
getReturnables(List<String> returnableIds)
Gets the
Returnable s with the given ids |
Collection<Searchable> |
getSearchables(Collection<Returnable> returnables)
Gets the
Searchable s linked with the given Returnable s |
Map<String,SortDefinition> |
getSortDefinitions(Collection<Returnable> returnables,
AdditionalParameterValueMap additionalParameterValues)
Gets the
SortDefinition s available with the given Returnable s and additional parameter values |
void |
initialize() |
Collection<String> |
selectedReturnables()
Gets the
Returnable s that must be selected by default |
void |
service(ServiceManager manager) |
void |
setAdditionalParameters(Collection<AdditionalSearchServiceParameter> additionalSearchServiceParameters)
Sets the additional parameters to display
|
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. |
getLogger, setLogger
protected ServiceManager _manager
protected ReturnableExtensionPoint _returnableEP
Returnable
sprotected SearchableExtensionPoint _searchableEP
Searchable
sprotected ServiceExtensionPoint _serviceEP
protected ContentTypeExtensionPoint _cTypeEP
protected SystemPropertyExtensionPoint _systemPropertyEP
SystemProperties
protected SiteQueryHelper _siteQueryHelper
protected ThreadSafeComponentManager<Enumerator> _enumeratorManager
protected SiteEnumerator _siteEnumerator
Site
enumeratorprotected String _pluginName
protected Map<Returnable,Collection<Searchable>> _searchablesByReturnable
private Collection<AdditionalSearchServiceParameter> _additionalSearchServiceParameters
public SearchServiceCreationHelper()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
protected void buildTree()
Returnable.relationsWith()
and Searchable.relationsWith()
in order to build the data structure (in a map returnable -> Collection of searchables)
linking Returnable
s and Searchable
sprotected void createEnumerators() throws Exception
SiteEnumerator
, etc.)Exception
- if an error occurspublic List<Returnable> getReturnables(List<String> returnableIds)
Returnable
s with the given idsreturnableIds
- the ids of the Returnable
sReturnable
s with the given idspublic Collection<Searchable> getSearchables(Collection<Returnable> returnables)
Searchable
s linked with the given Returnable
sreturnables
- the Returnable
sSearchable
s linked with the given Returnable
private Stream<Searchable> _getSearchables(Stream<Returnable> returnables)
public Map<String,SearchCriterionDefinition> getCriterionDefinitions(Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameterValues)
SearchCriterionDefinition
s available with the given Searchable
s and additional parameter valuessearchables
- The Searchable
sadditionalParameterValues
- The additional parameter valuesSearchCriterionDefinition
s available with the given Searchable
s and additional parameter valuespublic Map<String,FacetDefinition> getFacetDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues)
FacetDefinition
s available with the given Returnable
s and additional parameter valuesreturnables
- The Returnable
sadditionalParameterValues
- The additional parameter valuesFacetDefinition
s available with the given Returnable
s and additional parameter valuespublic Map<String,SortDefinition> getSortDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues)
SortDefinition
s available with the given Returnable
s and additional parameter valuesreturnables
- The Returnable
sadditionalParameterValues
- The additional parameter valuesSortDefinition
s available with the given Returnable
s and additional parameter valuespublic Collection<String> selectedReturnables()
Returnable
s that must be selected by defaultReturnable
s that must be selected by defaultpublic Collection<Configuration> getAdditionalParameterConfigurationsForGeneral()
private Collection<Configuration> _getAdditionalParameterConfigurationsOfSearchables()
public Collection<Configuration> getAdditionalParameterConfigurationsForDisplay()
private Collection<Configuration> _getAdditionalParameterConfigurationsOfReturnables()
public void setAdditionalParameters(Collection<AdditionalSearchServiceParameter> additionalSearchServiceParameters)
additionalSearchServiceParameters
- the additional parameters to displaypublic Collection<AdditionalSearchServiceParameter> getAdditionalParameters()
public AdditionalParameterValueMap getAdditionalParameterValues(Collection<AdditionalSearchServiceParameter> additionalParameters, ModelAwareDataHolder serviceParameters)
additionalParameters
- the additional parametersserviceParameters
- the storage of the service parametersprivate <T> Object _getAdditionalParameterValue(ModelAwareDataHolder serviceParameters, ServiceParameter<T> parameter)
public AdditionalParameterValueMap getAdditionalParameterValues(Collection<AdditionalSearchServiceParameter> additionalParameters, Map<String,Object> clientSideValues)
additionalParameters
- the additional parametersclientSideValues
- the values of the client form