Class HomeShortcutService
java.lang.Object
fr.paris.lutece.portal.service.admin.HomeShortcutService
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe site property that lets the users choose their own shortcuts; without it, everyone has the default onesstatic final intThe highest number of shortcuts, so that the buttons hold on one line -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetShortcuts(AdminUser user, List<FeatureGroup> listFeatureGroups) Returns the shortcuts of a user: their own list, or the default one, kept to the entries of their menubooleanhasOwnShortcuts(AdminUser user) Tells whether a user has a list of their ownbooleanTells whether the users may choose their own shortcuts (site property, on when it is not set)voidresetUserShortcuts(AdminUser user) Removes the list of a user, who gets the default list backvoidsaveDefaultShortcuts(List<String> listIds, List<FeatureGroup> listFeatureGroups) Saves the default list, kept to the entries of the menu of the administrator who saves it.voidsaveUserShortcuts(AdminUser user, List<String> listIds, List<FeatureGroup> listFeatureGroups) Saves the list of a user, kept to the entries of their menu
-
Field Details
-
MAX_SHORTCUTS
public static final int MAX_SHORTCUTSThe highest number of shortcuts, so that the buttons hold on one line- See Also:
-
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
Returns the shortcuts of a user: their own list, or the default one, kept to the entries of their menu- Parameters:
user- the userlistFeatureGroups- 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
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 userlistIds- the ids of the rights, in their orderlistFeatureGroups- the menu of the user
-
resetUserShortcuts
Removes the list of a user, who gets the default list back- Parameters:
user- the user
-
saveDefaultShortcuts
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 orderlistFeatureGroups- the menu of the administrator
-