Class ObjectHintService
java.lang.Object
io.meeds.social.hint.service.ObjectHintService
Collects the hints the
ObjectHintPlugin contributors give about one
object, once, for every host: a host calls
getHints(String, String, Identity, Locale) and adds the lines it
returns beside the object. Without a contributor for the object's type, it
answers an empty list and the host shows the object as before.- Since:
- 8.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe length a hint line is cut at.static final intThe number of hint lines an object keeps, all contributors merged. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MAX_HINTS
public static final int MAX_HINTSThe number of hint lines an object keeps, all contributors merged.- See Also:
-
MAX_HINT_LENGTH
public static final int MAX_HINT_LENGTHThe length a hint line is cut at.- See Also:
-
-
Constructor Details
-
ObjectHintService
public ObjectHintService()
-
-
Method Details
-
getHints
public List<String> getHints(String objectType, String objectId, org.exoplatform.services.security.Identity viewer, Locale locale) Asks every contributor of an object type once for its hints about one object, for one viewer.The contributors are looked up by type at each call, kept when their
ObjectHintPlugin.getObjectType()is the given type, and called in the order of their implementation's fully qualified class name, asio.meeds.social.search.service.SearchMatchServicedoes. Each line is stripped, kept once, cut at 300 characters, and at most 5 lines are kept; a blank line is dropped. A contributor that throws is logged and skipped.- Parameters:
objectType- the object's type, as the host names itobjectId- the object's idviewer- the identity of the user the object is shown tolocale- the viewer's locale- Returns:
- the hint lines, empty when there is none, never null
-