Class CmsUserIconHelper


  • public class CmsUserIconHelper
    extends java.lang.Object
    Generates user ident-icons.

    • Constructor Detail

    • Method Detail

      • hasUserImage

        public static boolean hasUserImage​(CmsUser user)
        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

        public void deleteUserImage​(CmsObject cms)
        Deletes the user image of the current user.

        Parameters:
        cms - the cms context
      • getBigIconPath

        public java.lang.String getBigIconPath​(CmsObject cms,
                                               CmsUser user)
        Returns the big ident-icon path for the given user.

        Parameters:
        cms - the cms context
        user - the user
        Returns:
        the icon path
      • getSmallIconPath

        public java.lang.String getSmallIconPath​(CmsObject cms,
                                                 CmsUser user)
        Returns the small ident-icon path for the given user.

        Parameters:
        cms - the cms context
        user - the user
        Returns:
        the icon path
      • getTinyIconPath

        public java.lang.String getTinyIconPath​(CmsObject cms,
                                                CmsUser user)
        Returns the tiny ident-icon path for the given user.

        Parameters:
        cms - the cms context
        user - the user
        Returns:
        the icon path
      • handleImageUpload

        public boolean handleImageUpload​(CmsObject cms,
                                         CmsUser user,
                                         java.lang.String uploadedFile)
        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 context
        user - the user
        uploadedFile - the uploaded file
        Returns:
        true in case the image was set successfully
      • handleImageUpload

        public boolean handleImageUpload​(CmsObject cms,
                                         java.util.List<java.lang.String> uploadedFiles)
        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 context
        uploadedFiles - the uploaded file paths
        Returns:
        true in case the image was set successfully
      • setUserImage

        public void setUserImage​(CmsObject cms,
                                 CmsUser user,
                                 java.lang.String rootPath)
                          throws CmsException
        Sets the user image for the given user.

        Parameters:
        cms - the cms context
        user - the user
        rootPath - the image root path
        Throws:
        CmsException - in case anything goes wrong