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
Returnables |
protected SearchableExtensionPoint |
_searchableEP
The extension point for
Searchables |
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 Returnables and Searchables |
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
SearchCriterionDefinitions available with the given Searchables and additional parameter values |
Map<String,FacetDefinition> |
getFacetDefinitions(Collection<Returnable> returnables,
AdditionalParameterValueMap additionalParameterValues)
Gets the
FacetDefinitions available with the given Returnables and additional parameter values |
List<Returnable> |
getReturnables(List<String> returnableIds)
Gets the
Returnables with the given ids |
Collection<Searchable> |
getSearchables(Collection<Returnable> returnables)
Gets the
Searchables linked with the given Returnables |
Map<String,SortDefinition> |
getSortDefinitions(Collection<Returnable> returnables,
AdditionalParameterValueMap additionalParameterValues)
Gets the
SortDefinitions available with the given Returnables and additional parameter values |
void |
initialize() |
Collection<String> |
selectedReturnables()
Gets the
Returnables 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, setLoggerprotected ServiceManager _manager
protected ReturnableExtensionPoint _returnableEP
Returnablesprotected SearchableExtensionPoint _searchableEP
Searchablesprotected ServiceExtensionPoint _serviceEP
protected ContentTypeExtensionPoint _cTypeEP
protected SystemPropertyExtensionPoint _systemPropertyEP
SystemPropertiesprotected 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 ServiceableServiceExceptionpublic void setPluginInfo(String pluginName, String featureName, String id)
PluginAwaresetPluginInfo in interface PluginAwarepluginName - 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 ContextualizableContextExceptionpublic void initialize() throws Exception
initialize in interface InitializableExceptionprotected void buildTree()
Returnable.relationsWith() and Searchable.relationsWith()
in order to build the data structure (in a map returnable -> Collection of searchables)
linking Returnables and Searchablesprotected void createEnumerators() throws Exception
SiteEnumerator, etc.)Exception - if an error occurspublic List<Returnable> getReturnables(List<String> returnableIds)
Returnables with the given idsreturnableIds - the ids of the ReturnablesReturnables with the given idspublic Collection<Searchable> getSearchables(Collection<Returnable> returnables)
Searchables linked with the given Returnablesreturnables - the ReturnablesSearchables linked with the given Returnableprivate Stream<Searchable> _getSearchables(Stream<Returnable> returnables)
public Map<String,SearchCriterionDefinition> getCriterionDefinitions(Collection<Searchable> searchables, AdditionalParameterValueMap additionalParameterValues)
SearchCriterionDefinitions available with the given Searchables and additional parameter valuessearchables - The SearchablesadditionalParameterValues - The additional parameter valuesSearchCriterionDefinitions available with the given Searchables and additional parameter valuespublic Map<String,FacetDefinition> getFacetDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues)
FacetDefinitions available with the given Returnables and additional parameter valuesreturnables - The ReturnablesadditionalParameterValues - The additional parameter valuesFacetDefinitions available with the given Returnables and additional parameter valuespublic Map<String,SortDefinition> getSortDefinitions(Collection<Returnable> returnables, AdditionalParameterValueMap additionalParameterValues)
SortDefinitions available with the given Returnables and additional parameter valuesreturnables - The ReturnablesadditionalParameterValues - The additional parameter valuesSortDefinitions available with the given Returnables and additional parameter valuespublic Collection<String> selectedReturnables()
Returnables that must be selected by defaultReturnables 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