Class GetProfileImageUriAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.plugins.userdirectory.action.GetProfileImageUriAction
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,Action
Get the internal uri of a user's avatar
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CurrentUserProviderThe current user providerprotected UserDirectoryHelperThe user directory helperFields inherited from class org.apache.cocoon.acting.ServiceableAction
managerFields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String_getDefaultImageUri(UserIdentity user, String lang, int cropSize, boolean download) Get the default image uri for a userprotected String_getProfileImageUri(UserIdentity user, String lang, int cropSize, boolean download) Get the profile image uriprotected UserIdentity_getUser(Parameters parameters) Get the user from parametersact(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) voidservice(ServiceManager smanager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_currentUserProvider
The current user provider -
_userDirectoryHelper
The user directory helper
-
-
Constructor Details
-
GetProfileImageUriAction
public GetProfileImageUriAction()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableAction- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception - Throws:
Exception
-
_getProfileImageUri
protected String _getProfileImageUri(UserIdentity user, String lang, int cropSize, boolean download) throws ResourceNotFoundException Get the profile image uri- Parameters:
user- the user identity. Can be null.lang- the languagecropSize- the image dimension. The image will be cropped.download- true if the uri is for download purposes.- Returns:
- the profile image uri
- Throws:
ResourceNotFoundException- if no image for user was found
-
_getDefaultImageUri
protected String _getDefaultImageUri(UserIdentity user, String lang, int cropSize, boolean download) Get the default image uri for a user- Parameters:
user- the user identitylang- the content languagecropSize- the image dimensiondownload- true if the uri is for download purposes.- Returns:
- the image uri
-
_getUser
Get the user from parameters- Parameters:
parameters- the sitemap parameters- Returns:
- the user identity
-