Jive Forums API (5.5.20.2-oracle) Core Javadocs

com.jivesoftware.forum
Interface AvatarManager


public interface AvatarManager

Manages the avatar feature. Avatars give a user the ability to specify an image that will be displayed alongside their username throughout the application.


Method Summary
 Avatar createAvatar(User owner, java.lang.String name, java.lang.String contentType, java.io.InputStream in)
          Creates a new avatar for a user allowing the user to specify an inputstream for the image.
 void deleteAvatar(Avatar avatar)
          Deletes an avatar from the system.
 Avatar getActiveAvatar(User user)
          Returns an avatar for a user, else null if no avatar exists for this user
 Avatar getAvatar(long id)
          Used to acquire an avatar by its id
 int getAvatarCount(User user)
          Used to acquire a count of all the avatars for a specific user
 java.util.Iterator getAvatars(User user)
          Returns a collection of avatars for a user
 java.util.Iterator getGlobalAvatars()
          Returns a collection of all of the global avatars
 int getMaxAllowableHeight()
          Returns the maximum allowable height for an avatar image
 int getMaxAllowableWidth()
          Returns the maximum allowable width for an avatar image
 int getMaxUserAvatars()
          Returns the maximum amount of avatars a user is allowed to have, -1 for limitless
 int getModerationAvatarCount()
          Used to acquire a count of all the avatars that require moderation.
 java.util.Iterator getModerationAvatars()
          Returns a collection of all of the avatars that require moderation.
 boolean isAllowImageResize()
          Returns true if the system should attempt to resize images
 boolean isAvatarsEnabled()
          Returns true if the avatars feature is enabled, else false
 boolean isModerateUserAvatars()
          Returns whether or not user avatars will be moderated.
 boolean isUserAvatarsEnabled()
          Returns true if users can create their own avatars, false otherwise.
 void setActiveAvatar(User user, Avatar avatar)
          Used to make a user use a global avatar, to set no active avatar pass null for the avatar value.
 void setAllowImageResize(boolean isAllowImageResize)
          Used to set whether the system should attempt to resize images
 void setAvatarsEnabled(boolean enabled)
          Used to disable or enable the avatars feature
 void setMaxAllowableHeight(int height)
          Sets the maximum allowable height for an avatar image
 void setMaxAllowableWidth(int width)
          Sets the maximum allowable width for an avatar image
 void setMaxUserAvatars(int max)
          Sets the maximum number of avatars a user can have
 void setModerateUserAvatars(boolean moderateUserAvatars)
          Sets whether or not user avatars will be moderated.
 void setUserAvatarsEnabled(boolean enableCustomAvatars)
          Sets whether or not users can create their own custom avatars.
 

Method Detail

createAvatar

Avatar createAvatar(User owner,
                    java.lang.String name,
                    java.lang.String contentType,
                    java.io.InputStream in)
                    throws UnauthorizedException,
                           AvatarException
Creates a new avatar for a user allowing the user to specify an inputstream for the image.

Parameters:
owner - user to create the avatar for
name - image name of the avatar
contentType - mime type of the image
in - input stream of the image
Returns:
newly created avatar
Throws:
UnauthorizedException
AvatarException

setActiveAvatar

void setActiveAvatar(User user,
                     Avatar avatar)
                     throws UnauthorizedException
Used to make a user use a global avatar, to set no active avatar pass null for the avatar value.

Parameters:
user - user to set an avatar for
avatar - avatar to make active
Throws:
UnauthorizedException - if the avatar does not belong to the user or it is not global

getAvatar

Avatar getAvatar(long id)
                 throws AvatarNotFoundException
Used to acquire an avatar by its id

Parameters:
id - unique id of the avatar
Returns:
avatar matching the id
Throws:
AvatarNotFoundException - thrown if the avatar does not exist

getAvatars

java.util.Iterator getAvatars(User user)
Returns a collection of avatars for a user

Parameters:
user - user to find an avatar for
Returns:
Collection of Avatar objects

getActiveAvatar

Avatar getActiveAvatar(User user)
Returns an avatar for a user, else null if no avatar exists for this user

Parameters:
user - user to acquire an avatar for
Returns:
an avatar for a particular user

getGlobalAvatars

java.util.Iterator getGlobalAvatars()
Returns a collection of all of the global avatars

Returns:
a collection of all of the global avatars

deleteAvatar

void deleteAvatar(Avatar avatar)
                  throws UnauthorizedException
Deletes an avatar from the system.

Parameters:
avatar - the avatar for the user
Throws:
UnauthorizedException

setAvatarsEnabled

void setAvatarsEnabled(boolean enabled)
                       throws UnauthorizedException
Used to disable or enable the avatars feature

Parameters:
enabled - true to enable, false to disable
Throws:
UnauthorizedException

isAvatarsEnabled

boolean isAvatarsEnabled()
Returns true if the avatars feature is enabled, else false

Returns:
true if the avatars feature is enabled, else false

getMaxAllowableHeight

int getMaxAllowableHeight()
Returns the maximum allowable height for an avatar image

Returns:
the maximum allowable height for an avatar image

setMaxAllowableHeight

void setMaxAllowableHeight(int height)
                           throws UnauthorizedException
Sets the maximum allowable height for an avatar image

Parameters:
height - the maximum allowable height for an avatar image
Throws:
UnauthorizedException - thrown if not system admin

getMaxAllowableWidth

int getMaxAllowableWidth()
Returns the maximum allowable width for an avatar image

Returns:
the maximum allowable width for an avatar image

setMaxAllowableWidth

void setMaxAllowableWidth(int width)
                          throws UnauthorizedException
Sets the maximum allowable width for an avatar image

Parameters:
width - the maximum allowable width for an avatar image
Throws:
UnauthorizedException - thrown if not system admin

isAllowImageResize

boolean isAllowImageResize()
Returns true if the system should attempt to resize images

Returns:
true if the system should attempt to resize images

setAllowImageResize

void setAllowImageResize(boolean isAllowImageResize)
                         throws UnauthorizedException
Used to set whether the system should attempt to resize images

Parameters:
isAllowImageResize - whether the system should attempt to resize images
Throws:
UnauthorizedException - thrown if not system admin

isUserAvatarsEnabled

boolean isUserAvatarsEnabled()
Returns true if users can create their own avatars, false otherwise. If custom user avatars are enabled, the number of custom avatars allowed per user and whether or not custom avatars should be moderated can be set using setMaxUserAvatars(int max); and setModerateUserAvatars(boolean moderateUserAvatars); respecitvely.

Returns:
true if custom user avatars are enabled, false otherwise

setUserAvatarsEnabled

void setUserAvatarsEnabled(boolean enableCustomAvatars)
Sets whether or not users can create their own custom avatars. If custom user avatars are enabled, the number of custom avatars allowed per user and whether or not custom avatars should be moderated can be set using setMaxUserAvatars(int max); and setModerateUserAvatars(boolean moderateUserAvatars); respecitvely.

Parameters:
enableCustomAvatars - true if custom user avatars are enabled, false otherwise

getMaxUserAvatars

int getMaxUserAvatars()
Returns the maximum amount of avatars a user is allowed to have, -1 for limitless

Returns:
the maximum amount of avatars a user is allowed to have

setMaxUserAvatars

void setMaxUserAvatars(int max)
                       throws UnauthorizedException
Sets the maximum number of avatars a user can have

Parameters:
max - the maximum number of avatars a user can have
Throws:
UnauthorizedException - if not system admin

getAvatarCount

int getAvatarCount(User user)
Used to acquire a count of all the avatars for a specific user

Parameters:
user - user to count avatars for
Returns:
the number avatars the user has

isModerateUserAvatars

boolean isModerateUserAvatars()
Returns whether or not user avatars will be moderated. The default value is true.

Returns:
true if user avatars will be moderated, false otherwise.

setModerateUserAvatars

void setModerateUserAvatars(boolean moderateUserAvatars)
                            throws UnauthorizedException
Sets whether or not user avatars will be moderated. The default value is true.

Parameters:
moderateUserAvatars - whether or not user avatars will be moderated
Throws:
UnauthorizedException - if not system admin

getModerationAvatars

java.util.Iterator getModerationAvatars()
                                        throws UnauthorizedException
Returns a collection of all of the avatars that require moderation.

Returns:
a collection of all of the avatars that require moderation.
Throws:
UnauthorizedException - if not admin or moderator

getModerationAvatarCount

int getModerationAvatarCount()
Used to acquire a count of all the avatars that require moderation.

Returns:
the number avatars that require moderation.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.