public class SuggestionServiceImpl extends DefaultComponent implements SuggestionService
Modifier and Type | Field and Description |
---|---|
protected SuggesterGroupRegistry |
suggesterGroups |
protected SuggesterRegistry |
suggesters |
lastModified, name
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) |
deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
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 © 2019 Nuxeo. All rights reserved.