Class Suggestion
java.lang.Object
org.nuxeo.ecm.platform.suggestbox.service.Suggestion
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DocumentSuggestion
,GroupSuggestion
,UserSuggestion
Base class for building data transfer objects for results of requests to the SuggestionService.
- Author:
- ogrisel
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondisable()
Get the map of highlights associated to the suggested result.Relative URL path to download an icon (can represent the type of suggestion or the specific instance such as the mimetype icon of a document suggestion or the avatar icon of a user profile suggestion).getId()
The id of the object associated to the suggestion.boolean
Disabled suggestions can be useful to display suggestions that might have been relevant if the context was slightly different (e.g. if the user was logged in instead of anonymous): the UI should not make them selectable but the description should give information to the user on how to make that suggestion enabled (e.g. by logging in).getLabel()
The i18n label to display to the user for this suggestion.abstract String
getType()
A string marker to give the type (i.e. category) of the suggested user action / intent.toString()
withDescription
(String description) withHighlights
(Map<String, List<String>> highlights) withThumbnailURL
(String thumbnailURL)
-
Field Details
-
DATE_FORMAT_PATTERN
- See Also:
-
id
-
type
-
label
-
iconURL
-
thumbnailURL
-
description
-
highlights
-
disabled
protected boolean disabled
-
-
Constructor Details
-
Method Details
-
getId
The id of the object associated to the suggestion.- Since:
- 6.0
-
getType
A string marker to give the type (i.e. category) of the suggested user action / intent. The type is used to broadcast the selected suggestion to the correct handler. -
getLabel
The i18n label to display to the user for this suggestion. -
getIconURL
Relative URL path to download an icon (can represent the type of suggestion or the specific instance such as the mimetype icon of a document suggestion or the avatar icon of a user profile suggestion). -
getDescription
-
withDescription
-
getIsDisabled
public boolean getIsDisabled()Disabled suggestions can be useful to display suggestions that might have been relevant if the context was slightly different (e.g. if the user was logged in instead of anonymous): the UI should not make them selectable but the description should give information to the user on how to make that suggestion enabled (e.g. by logging in). The SuggestionService will throw an exception if the user selects a disabled suggestion. -
getThumbnailURL
- Since:
- 8.4
-
withHighlights
- Since:
- 9.2
-
withThumbnailURL
- Since:
- 8.4
-
disable
-
getObjectUrl
- Returns:
- the url to access to the object. It used by the navigation in the select2.
- Since:
- 6.0
-
toString
-
getHighlights
Get the map of highlights associated to the suggested result. The key of a map entry item represents the highlighted field, the value is the list of segment.- Since:
- 9.2
-