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
public class SetUserProfileAction extends SetUserPreferencesAction
Action which saves the user profile in user preferences
-
-
Field Summary
Fields Modifier and Type Field Description protected JSONUtils
_jsonUtils
JSON Utilsprotected DefaultProfileImageProvider
_profileImageProvider
User profile image providerprotected UploadManager
_uploadManager
Upload manager-
Fields 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
Constructors Constructor Description SetUserProfileAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
_convertFile(String filename, InputStream is)
Convert the uploaded file to base64.protected Map<String,String>
_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 Detail
-
_jsonUtils
protected JSONUtils _jsonUtils
JSON Utils
-
_profileImageProvider
protected DefaultProfileImageProvider _profileImageProvider
User profile image provider
-
_uploadManager
protected UploadManager _uploadManager
Upload manager
-
-
Constructor Detail
-
SetUserProfileAction
public SetUserProfileAction()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- 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
protected String _convertFile(String filename, InputStream is) throws IOException
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
-
-