Package org.ametys.plugins.core.ui.user
Class SetUserProfileAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.core.util.cocoon.AbstractCurrentUserProviderServiceableAction
org.ametys.plugins.core.userpref.SetUserPreferencesAction
org.ametys.plugins.core.ui.user.SetUserProfileAction
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,ThreadSafe
,Action
Action which saves the user profile in user preferences
-
Field Summary
Modifier and TypeFieldDescriptionprotected JSONUtils
JSON Utilsprotected DefaultProfileImageProvider
User profile image providerprotected UploadManager
Upload managerFields inherited from class org.ametys.plugins.core.userpref.SetUserPreferencesAction
_INPUT_DATE_FORMATS, _userPrefEP, _userPrefManager
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
_convertFile
(String filename, InputStream is) Convert the uploaded file to base64._getValues
(Request request, Map<String, String> contextVars, UserIdentity user, Collection<String> preferenceIds, UserPreferencesErrors errors) Get the preferences values from the request.void
service
(ServiceManager smanager) Methods inherited from class org.ametys.plugins.core.userpref.SetUserPreferencesAction
_parseDate, act, getContextVars, getPreferenceIds, getStorageContext, getUser, setUserPreferences, setUserPreferences
Methods inherited from class org.ametys.core.util.cocoon.AbstractCurrentUserProviderServiceableAction
_getCurrentUser
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_jsonUtils
JSON Utils -
_profileImageProvider
User profile image provider -
_uploadManager
Upload manager
-
-
Constructor Details
-
SetUserProfileAction
public SetUserProfileAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classSetUserPreferencesAction
- Throws:
ServiceException
-
_getValues
protected Map<String,String> _getValues(Request request, Map<String, String> contextVars, UserIdentity user, Collection<String> preferenceIds, UserPreferencesErrors errors) Description copied from class:SetUserPreferencesAction
Get the preferences values from the request.- Overrides:
_getValues
in classSetUserPreferencesAction
- Parameters:
request
- the request.contextVars
- The context varsuser
- the user.preferenceIds
- a collection of the IDs of preferences to set.errors
- the errors object to fill in.- Returns:
- the user preferences values as a Map.
-
_convertFile
Convert the uploaded file to base64. Also automatically crop the image to 64x64 pixels.- Parameters:
filename
- The file nameis
- The input stream of the uploaded file- Returns:
- The base64 string
- Throws:
IOException
- If an exception occurs while manipulating streams
-