Package io.meeds.appcenter.storage
Class ApplicationPinStorage
java.lang.Object
io.meeds.appcenter.storage.ApplicationPinStorage
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intBound of the list, far above what the topbar and the launcher display: the value of the setting can also be written around this storage.static final Stringstatic final org.exoplatform.commons.api.settings.data.Scope -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPinnedApplicationIds(String username) voidsetPinnedApplicationIds(String username, List<Long> applicationIds)
-
Field Details
-
PINS_SCOPE
public static final org.exoplatform.commons.api.settings.data.Scope PINS_SCOPE -
PINS_KEY
- See Also:
-
MAX_PINNED_APPLICATIONS
public static final int MAX_PINNED_APPLICATIONSBound 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
- Parameters:
username- user login- Returns:
- the first
MAX_PINNED_APPLICATIONSstored 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 toLong[](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
-