Class SuggestionServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.suggestbox.service.SuggestionServiceImpl
-
- All Implemented Interfaces:
SuggestionService
,Adaptable
,Component
,Extensible
,TimestampedService
public class SuggestionServiceImpl extends DefaultComponent implements SuggestionService
The Class SuggestionServiceImpl.
-
-
Field Summary
Fields Modifier and Type Field Description protected SuggesterGroupRegistry
suggesterGroups
protected SuggesterRegistry
suggesters
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description SuggestionServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
suggesterGroups
protected SuggesterGroupRegistry suggesterGroups
-
suggesters
protected SuggesterRegistry suggesters
-
-
Method Detail
-
suggest
public List<Suggestion> suggest(String userInput, SuggestionContext context) throws SuggestionException
Description copied from interface:SuggestionService
Call the suggesters registered for the given suggestion point mentioned in the context and aggregate the results.- Specified by:
suggest
in interfaceSuggestionService
- Parameters:
userInput
- text typed by the usercontext
- user context (with suggestPoint name and more)- Returns:
- generated suggestion for the given input and context
- Throws:
SuggestionException
-
suggest
public List<Suggestion> suggest(String input, SuggestionContext context, String suggesterName) throws SuggestionException
Description copied from interface:SuggestionService
Call a single suggester registered under the provided name.- Specified by:
suggest
in interfaceSuggestionService
- Parameters:
input
- text typed by the usercontext
- user context (with suggestPoint name and more)suggesterName
- the registration name of the suggester to use- Returns:
- generated suggestion for the given input and context
- Throws:
SuggestionException
-
activate
public void activate(ComponentContext context)
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
getSuggesterGroups
public SuggesterGroupRegistry getSuggesterGroups()
Gets the suggester groups registry. Only for test purpose.- Returns:
- the suggester groups
-
-