com.atlassian.confluence.user.service
Class DefaultUserProfileService

java.lang.Object
  extended by com.atlassian.confluence.user.service.DefaultUserProfileService
All Implemented Interfaces:
UserProfileService, org.springframework.web.context.ServletContextAware

public class DefaultUserProfileService
extends Object
implements UserProfileService, org.springframework.web.context.ServletContextAware


Constructor Summary
DefaultUserProfileService(PermissionManager permissionManager, UserAccessor userAccessor, AttachmentManager attachmentManager, PersonalInformationManager personalInformationManager, UserProfilePictureManager userProfilePictureManager)
           
 
Method Summary
 DeleteProfilePictureCommand newDeleteProfilePictureCommand(com.atlassian.user.User user, String imageFileName)
          Get a service command for deleting a user's profile picture.
 SetProfilePictureCommand newSetProfilePictureCommand(com.atlassian.user.User user, InputStream imageData, String imageFileName)
          Get a service command for setting a user's profile picture from an uploaded photo.
 SetProfilePictureCommand newSetProfilePictureCommand(com.atlassian.user.User user, InputStream imageData, String imageFileName, int topLeftX, int topLeftY, int width)
          Get a service command for setting a user's profile picture from an uploaded photo.
 SetProfilePictureCommand newSetProfilePictureCommand(com.atlassian.user.User user, String builtInImageFileName)
          Get a service command for setting a user's profile picture from an already existing attachment filename, or from one of the built-in icons.
 void setServletContext(javax.servlet.ServletContext servletContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUserProfileService

public DefaultUserProfileService(PermissionManager permissionManager,
                                 UserAccessor userAccessor,
                                 AttachmentManager attachmentManager,
                                 PersonalInformationManager personalInformationManager,
                                 UserProfilePictureManager userProfilePictureManager)
Method Detail

newSetProfilePictureCommand

public SetProfilePictureCommand newSetProfilePictureCommand(com.atlassian.user.User user,
                                                            InputStream imageData,
                                                            String imageFileName)
Description copied from interface: UserProfileService
Get a service command for setting a user's profile picture from an uploaded photo. The image will be cropped and resized to fit.

Specified by:
newSetProfilePictureCommand in interface UserProfileService
Parameters:
user - the user to set a profile picture for
imageData - the image to use as a profile picture
imageFileName - the name of the uploaded image
Returns:
the relevant command

newSetProfilePictureCommand

public SetProfilePictureCommand newSetProfilePictureCommand(com.atlassian.user.User user,
                                                            String builtInImageFileName)
Description copied from interface: UserProfileService
Get a service command for setting a user's profile picture from an already existing attachment filename, or from one of the built-in icons.

Specified by:
newSetProfilePictureCommand in interface UserProfileService
Parameters:
user - the user to set a profile picture for
builtInImageFileName - the filename of the image to use as a profile picture
Returns:
the relevant command

newSetProfilePictureCommand

public SetProfilePictureCommand newSetProfilePictureCommand(com.atlassian.user.User user,
                                                            InputStream imageData,
                                                            String imageFileName,
                                                            int topLeftX,
                                                            int topLeftY,
                                                            int width)
Description copied from interface: UserProfileService
Get a service command for setting a user's profile picture from an uploaded photo. The image will be cropped with the given parameters and then resized to fit the standard profile picture size.

Specified by:
newSetProfilePictureCommand in interface UserProfileService
Parameters:
user - the user to set a profile picture for
imageData - the image to use as a profile picture
imageFileName - the name of the uploaded image
topLeftX - the X offset of the top left of the cropping area
topLeftY - the Y offset of the top left of the cropping area
width - the width of the cropping area (will always be square)
Returns:
the relevant command

newDeleteProfilePictureCommand

public DeleteProfilePictureCommand newDeleteProfilePictureCommand(com.atlassian.user.User user,
                                                                  String imageFileName)
Description copied from interface: UserProfileService
Get a service command for deleting a user's profile picture.

Specified by:
newDeleteProfilePictureCommand in interface UserProfileService
Parameters:
user - the user to delete a profile picture for
imageFileName - the filename of the image to delete
Returns:
the relevant command

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware


Copyright © 2003-2012 Atlassian. All Rights Reserved.