Interface ObjectHintPlugin


public interface ObjectHintPlugin
A hint about one object, from an add-on that holds data about objects of another add-on (for instance the values of a form attached to a file): a short line telling a reader of the object, such as the assistant given the object's text, that more is known about it and how to read it.

A host that shows an object to a reader asks io.meeds.social.hint.service.ObjectHintService#getHints and adds the lines it returns beside the object; it never calls a contributor itself. A hint names where the data is, never the data: the reader reads it with its own tools and rights.

A contributor is a Spring @Service with an explicit, unique bean name, non-final, looked up by type when a host asks; it carries no business logic and delegates to its add-on's service layer.

Since:
8.0
  • Method Summary

    Modifier and Type
    Method
    Description
    getHints(String objectId, org.exoplatform.services.security.Identity viewer, Locale locale)
    The hints about one object for one viewer.
    The type of the objects this contributor gives hints about, as the host names it, for instance document for a file.
  • Method Details

    • getObjectType

      String getObjectType()
      The type of the objects this contributor gives hints about, as the host names it, for instance document for a file.
      Returns:
      the object type, never null
    • getHints

      List<String> getHints(String objectId, org.exoplatform.services.security.Identity viewer, Locale locale)
      The hints about one object for one viewer. Called on the host's thread, once per object shown: the contributor answers only from what the viewer may see, quickly, and an empty list, never an exception, when it has nothing or its backend is unavailable. The service skips a contributor that throws a RuntimeException; an Error is not caught.
      Parameters:
      objectId - the object's id, as the host names it
      viewer - the identity of the user the object is shown to
      locale - the viewer's locale, null when the host has none
      Returns:
      the hint lines, never null