Class ApplicationPinStorage

java.lang.Object
io.meeds.appcenter.storage.ApplicationPinStorage

@Component public class ApplicationPinStorage extends Object
Stores the ordered list of applications a user pinned to the topbar as a JSON array of their ids, under Context.USER, APPLICATION:PinnedApplications, pins: the key of the existing pins, which are read as they are.
  • Field Details

    • PINS_SCOPE

      public static final org.exoplatform.commons.api.settings.data.Scope PINS_SCOPE
    • PINS_KEY

      public static final String PINS_KEY
      See Also:
    • MAX_PINNED_APPLICATIONS

      public static final int MAX_PINNED_APPLICATIONS
      Bound of the list, far above what the topbar and the launcher display: the value of the setting can also be written around this storage.
      See Also:
  • Constructor Details

    • ApplicationPinStorage

      public ApplicationPinStorage()
  • Method Details

    • getPinnedApplicationIds

      public List<Long> getPinnedApplicationIds(String username)
      Parameters:
      username - user login
      Returns:
      the first MAX_PINNED_APPLICATIONS stored application ids, in pin order, without duplicates, nulls or non-positive values. The stored value is read as the JSON array it starts with, bound to Long[] (ids stored as numeric strings included), and any text after that array is ignored. An empty list when nothing is stored, when the value does not start with an array, or when an entry cannot be bound
    • setPinnedApplicationIds

      public void setPinnedApplicationIds(String username, List<Long> applicationIds)