Package org.opencms.ui
Class CmsUserIconHelper
java.lang.Object
org.opencms.ui.CmsUserIconHelper
Generates user ident-icons.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorThe color reserved for admin users.static final StringThe big icon suffix.static final StringThe target folder name.static final StringThe small icon suffix.static final StringThe temp folder name.static final StringThe tiny icon suffix.static final StringThe user image folder.static final StringThe user image additional info key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteUserImage(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.booleanhandleImageUpload(CmsObject cms, List<String> uploadedFiles) Handles a user image upload.booleanhandleImageUpload(CmsObject cms, CmsUser user, String uploadedFile) Handles a user image upload.static booleanhasUserImage(CmsUser user) Checks whether the given user has an individual user image.voidsetUserImage(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:
trueif 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:
truein 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:
truein 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
-