Package org.opencms.ui
Class CmsUserIconHelper
java.lang.Object
org.opencms.ui.CmsUserIconHelper
Generates user ident-icons.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Color
The color reserved for admin users.static final String
The big icon suffix.static final String
The target folder name.static final String
The small icon suffix.static final String
The temp folder name.static final String
The tiny icon suffix.static final String
The user image folder.static final String
The user image additional info key. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteUserImage
(CmsObject cms) Deletes the user image of the current user.getBigIconPath
(CmsObject cms, CmsUser user) Returns the big ident-icon path for the given user.getSmallIconPath
(CmsObject cms, CmsUser user) Returns the small ident-icon path for the given user.getTinyIconPath
(CmsObject cms, CmsUser user) Returns the tiny ident-icon path for the given user.boolean
handleImageUpload
(CmsObject cms, List<String> uploadedFiles) Handles a user image upload.boolean
handleImageUpload
(CmsObject cms, CmsUser user, String uploadedFile) Handles a user image upload.static boolean
hasUserImage
(CmsUser user) Checks whether the given user has an individual user image.void
setUserImage
(CmsObject cms, CmsUser user, String rootPath) Sets the user image for the given user.
-
Field Details
-
ADMIN_COLOR
The color reserved for admin users. -
BIG_ICON_SUFFIX
The big icon suffix.- See Also:
-
ICON_FOLDER
The target folder name.- See Also:
-
SMALL_ICON_SUFFIX
The small icon suffix.- See Also:
-
TEMP_FOLDER
The temp folder name.- See Also:
-
TINY_ICON_SUFFIX
The tiny icon suffix.- See Also:
-
USER_IMAGE_FOLDER
The user image folder.- See Also:
-
USER_IMAGE_INFO
The user image additional info key.- See Also:
-
-
Constructor Details
-
CmsUserIconHelper
Constructor.- Parameters:
adminCms
- the admin cms context
-
-
Method Details
-
hasUserImage
Checks whether the given user has an individual user image.- Parameters:
user
- the user- Returns:
true
if the given user has an individual user image
-
deleteUserImage
Deletes the user image of the current user.- Parameters:
cms
- the cms context
-
getBigIconPath
Returns the big ident-icon path for the given user.- Parameters:
cms
- the cms contextuser
- the user- Returns:
- the icon path
-
getSmallIconPath
Returns the small ident-icon path for the given user.- Parameters:
cms
- the cms contextuser
- the user- Returns:
- the icon path
-
getTinyIconPath
Returns the tiny ident-icon path for the given user.- Parameters:
cms
- the cms contextuser
- the user- Returns:
- the icon path
-
handleImageUpload
Handles a user image upload. The uploaded file will be scaled and save as a new file beneath /system/userimages/, the original file will be deleted.- Parameters:
cms
- the cms contextuser
- the useruploadedFile
- the uploaded file- Returns:
true
in case the image was set successfully
-
handleImageUpload
Handles a user image upload. The uploaded file will be scaled and save as a new file beneath /system/userimages/, the original file will be deleted.- Parameters:
cms
- the cms contextuploadedFiles
- the uploaded file paths- Returns:
true
in case the image was set successfully
-
setUserImage
Sets the user image for the given user.- Parameters:
cms
- the cms contextuser
- the userrootPath
- the image root path- Throws:
CmsException
- in case anything goes wrong
-