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
The Class SuggestionServiceImpl.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, SuggesterGroupDescriptor> protected static final Stringprotected static final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the suggester groups registry.voidstart(ComponentContext context) Start the component.voidstop(ComponentContext context) Stop the component.suggest(String userInput, SuggestionContext context) Call the suggesters registered for the given suggestion point mentioned in the context and aggregate the results.suggest(String input, SuggestionContext context, String suggesterName) Call a single suggester registered under the provided name.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
XP_SUGGESTERS
- See Also:
-
XP_SUGGESTER_GROUPS
- See Also:
-
suggesters
-
suggesterGroups
-
-
Constructor Details
-
SuggestionServiceImpl
public SuggestionServiceImpl()
-
-
Method Details
-
suggest
public List<Suggestion> suggest(String userInput, SuggestionContext context) throws SuggestionException Description copied from interface:SuggestionServiceCall the suggesters registered for the given suggestion point mentioned in the context and aggregate the results.- Specified by:
suggestin 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:SuggestionServiceCall a single suggester registered under the provided name.- Specified by:
suggestin 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
-
start
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent
-
getSuggesterGroups
Gets the suggester groups registry. Only for test purpose.- Returns:
- the suggester groups
-