Class FavoritesHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.project.favorites.FavoritesHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
About setting a project as a favorite project for a user
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected JSONUtils
The JSON utilsprotected ProjectManager
The project managerprotected UserPreferencesExtensionPoint
The user preferences extension pointprotected UserPreferencesManager
The user preferences managerstatic final String
The avalon rolestatic final String
the id of the user prefs for favorites preferences -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFavorites
(UserIdentity userIdentity) Get the favorites projects of a uservoid
service
(ServiceManager manager) boolean
setFavoriteProject
(String projectName, boolean favorite) The current user change a favorite status for a given projectMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
USERPREFS_ID
the id of the user prefs for favorites preferences- See Also:
-
ROLE
The avalon role -
_jsonUtils
The JSON utils -
_userPrefManager
The user preferences manager -
_userPrefEP
The user preferences extension point -
_projectManager
The project manager -
_currentUserProvider
The current user provider
-
-
Constructor Details
-
FavoritesHelper
public FavoritesHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getFavorites
Get the favorites projects of a user- Parameters:
userIdentity
- The user to consider- Returns:
- The non null list of favorite projects names
-
setFavoriteProject
The current user change a favorite status for a given project- Parameters:
projectName
- The name of the projectfavorite
- The new favorite status- Returns:
- true if successful
-