public class SuggestionServiceImpl extends DefaultComponent implements SuggestionService
Modifier and Type | Field and Description |
---|---|
protected SuggesterGroupRegistry |
suggesterGroups |
protected SuggesterRegistry |
suggesters |
lastModified
Constructor and Description |
---|
SuggestionServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
SuggesterGroupRegistry |
getSuggesterGroups()
Gets the suggester groups registry.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
List<Suggestion> |
suggest(String userInput,
SuggestionContext context)
Call the suggesters registered for the given suggestion point mentioned in the context and aggregate the results.
|
List<Suggestion> |
suggest(String input,
SuggestionContext context,
String suggesterName)
Call a single suggester registered under the provided name.
|
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtension
protected SuggesterGroupRegistry suggesterGroups
protected SuggesterRegistry suggesters
public SuggestionServiceImpl()
public List<Suggestion> suggest(String userInput, SuggestionContext context) throws SuggestionException
SuggestionService
suggest
in interface SuggestionService
userInput
- text typed by the usercontext
- user context (with suggestPoint name and more)SuggestionException
public List<Suggestion> suggest(String input, SuggestionContext context, String suggesterName) throws SuggestionException
SuggestionService
suggest
in interface SuggestionService
context
- user context (with suggestPoint name and more)suggesterName
- the registration name of the suggester to useSuggestionException
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public SuggesterGroupRegistry getSuggesterGroups()
Copyright © 2016 Nuxeo SA. All rights reserved.