Class CalendarCategoriesHelper
java.lang.Object
org.ametys.plugins.calendar.helpers.CalendarCategoriesHelper
- All Implemented Interfaces:
Component
,Serviceable
helper to manage calendar categories
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected JSONUtils
Json utilsprotected UserPreferencesManager
The user preferencesstatic final String
The component role.protected static final String
user pref id where the categories should be storedprotected static final String
Parameter name for the zone item id -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetUserCategories
(String siteName, String zoneItemId) Get the user preferences for this calendargetUserCategories
(UserIdentity identity, String siteName, String zoneItemId) Get the user preferences for this calendargetUserCategories
(Request request) Get the user preferences for this calendarvoid
service
(ServiceManager manager) boolean
setUserCategories
(String siteName, String zoneItemId, List<String> categories) Set the user preferences for this calendarboolean
setUserCategories
(UserIdentity identity, String siteName, String zoneItemId, List<String> categories) Set the user preferences for this calendarboolean
setUserCategories
(Request request) Set the user preferences for this calendar
-
Field Details
-
ROLE
The component role. -
ZONEITEMID
Parameter name for the zone item id- See Also:
-
USER_PREF_ID
user pref id where the categories should be stored- See Also:
-
_currentUserProvider
The current user provider -
_userPref
The user preferences -
_jsonUtils
Json utils
-
-
Constructor Details
-
CalendarCategoriesHelper
public CalendarCategoriesHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setUserCategories
Set the user preferences for this calendar- Parameters:
request
- the request from the service- Returns:
- true if the preference was set
- Throws:
UserPreferencesException
- impossible to set the preference
-
setUserCategories
public boolean setUserCategories(String siteName, String zoneItemId, List<String> categories) throws UserPreferencesException Set the user preferences for this calendar- Parameters:
siteName
- Site namezoneItemId
- Zone Item Id where the service is putcategories
- categories to set- Returns:
- true if the preference was set
- Throws:
UserPreferencesException
- impossible to set the preference
-
setUserCategories
public boolean setUserCategories(UserIdentity identity, String siteName, String zoneItemId, List<String> categories) throws UserPreferencesException Set the user preferences for this calendar- Parameters:
identity
- UsersiteName
- Site namezoneItemId
- Zone Item Id where the service is putcategories
- categories to set- Returns:
- true if the preference was set
- Throws:
UserPreferencesException
- impossible to set the preference
-
getUserCategories
Get the user preferences for this calendar- Parameters:
request
- the request from the service- Returns:
- a List of categories
- Throws:
UserPreferencesException
- impossible to get the preference
-
getUserCategories
public List<String> getUserCategories(String siteName, String zoneItemId) throws UserPreferencesException Get the user preferences for this calendar- Parameters:
siteName
- Site namezoneItemId
- Zone Item Id where the service is put- Returns:
- a List of categories
- Throws:
UserPreferencesException
- impossible to get the preference
-
getUserCategories
public List<String> getUserCategories(UserIdentity identity, String siteName, String zoneItemId) throws UserPreferencesException Get the user preferences for this calendar- Parameters:
identity
- UsersiteName
- Site namezoneItemId
- Zone Item Id where the service is put- Returns:
- a List of categories
- Throws:
UserPreferencesException
- impossible to set the preference
-