Class HomeShortcutService

java.lang.Object
fr.paris.lutece.portal.service.admin.HomeShortcutService

@ApplicationScoped public class HomeShortcutService extends Object
The shortcuts of the Back Office home page: the buttons of its header, each one a menu entry. An administrator sets the default list, each user may replace it with a list of their own. A list is the ids of the rights in their order, separated by commas.
  • Field Details

    • MAX_SHORTCUTS

      public static final int MAX_SHORTCUTS
      The highest number of shortcuts, so that the buttons hold on one line
      See Also:
    • DATASTORE_KEY_USER_SHORTCUTS_ENABLED

      public static final String DATASTORE_KEY_USER_SHORTCUTS_ENABLED
      The site property that lets the users choose their own shortcuts; without it, everyone has the default ones
      See Also:
  • Constructor Details

    • HomeShortcutService

      public HomeShortcutService()
  • Method Details

    • getShortcuts

      public List<Right> getShortcuts(AdminUser user, List<FeatureGroup> listFeatureGroups)
      Returns the shortcuts of a user: their own list, or the default one, kept to the entries of their menu
      Parameters:
      user - the user
      listFeatureGroups - the menu of the user: its groups and their entries, the rights the user has and that have a URL
      Returns:
      the rights of the shortcuts, in their order
    • isUserShortcutsEnabled

      public boolean isUserShortcutsEnabled()
      Tells whether the users may choose their own shortcuts (site property, on when it is not set)
      Returns:
      true when the users may choose their own shortcuts, false when everyone has the default ones
    • hasOwnShortcuts

      public boolean hasOwnShortcuts(AdminUser user)
      Tells whether a user has a list of their own
      Parameters:
      user - the user
      Returns:
      true when the user saved a list and may use it, false when they have the default one
    • saveUserShortcuts

      public void saveUserShortcuts(AdminUser user, List<String> listIds, List<FeatureGroup> listFeatureGroups)
      Saves the list of a user, kept to the entries of their menu
      Parameters:
      user - the user
      listIds - the ids of the rights, in their order
      listFeatureGroups - the menu of the user
    • resetUserShortcuts

      public void resetUserShortcuts(AdminUser user)
      Removes the list of a user, who gets the default list back
      Parameters:
      user - the user
    • saveDefaultShortcuts

      public void saveDefaultShortcuts(List<String> listIds, List<FeatureGroup> listFeatureGroups)
      Saves the default list, kept to the entries of the menu of the administrator who saves it. The users who saved a list of their own keep it.
      Parameters:
      listIds - the ids of the rights, in their order
      listFeatureGroups - the menu of the administrator