Clearspace API (2.0.15) Web Services Client Javadocs

com.jivesoftware.community.webservices
Interface AvatarService


public interface AvatarService


Method Summary
 WSAvatar createAvatar(long ownerID, java.lang.String name, java.lang.String contentType, byte[] data)
          Creates a new avatar for a user allowing the user to specify byte array for the image.
 void deleteAvatar(long avatarID)
          Deletes an avatar from the system.
 WSAvatar getActiveAvatar(long userID)
          Returns an avatar for a user, else the SystemDefaultAvatar if the user does not have an active avatar specified.
 WSAvatar getAvatar(long avatarID)
          Used to acquire an avatar by its id
 int getAvatarCount(long userID)
          Used to acquire a count of all the avatars for a specific user
 java.util.List<WSAvatar> getAvatars(long userID)
          Returns a collection of avatars for a user
 java.util.List<WSAvatar> 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.List<WSAvatar> 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(long userID, long avatarID)
          Used to make a user use a global avatar, to set no active avatar pass -1 for the avatar value.
 void setAllowImageResize(boolean isAllowImageResize)
          Used to set whether the system should attempt to resize images
 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

WSAvatar createAvatar(long ownerID,
                      java.lang.String name,
                      java.lang.String contentType,
                      byte[] data)
                      throws UserNotFoundException,
                             AvatarException
Creates a new avatar for a user allowing the user to specify byte array for the image.

Parameters:
ownerID - the user ID to create the avatar for
name - image name of the avatar
contentType - mime type of the image
data - byte array of the image
Returns:
newly created avatar
Throws:
UserNotFoundException - if the specified user does not exist
AvatarException - if there is problem creating the avatar
UnauthorizedException - if the user doesn't have permission to create avatars

setActiveAvatar

void setActiveAvatar(long userID,
                     long avatarID)
                     throws UnauthorizedException,
                            UserNotFoundException
Used to make a user use a global avatar, to set no active avatar pass -1 for the avatar value.

Parameters:
userID - the user ID to set an avatar for
avatarID - the avatar ID to make active
Throws:
UnauthorizedException - if the avatar does not belong to the user or it is not global
UserNotFoundException - if the specified user does not exist

getAvatar

WSAvatar getAvatar(long avatarID)
                   throws AttachmentNotFoundException
Used to acquire an avatar by its id

Parameters:
avatarID - unique id of the avatar
Returns:
avatar matching the id
Throws:
AttachmentNotFoundException - it there is a problem loading the avatar's image

getAvatars

java.util.List<WSAvatar> getAvatars(long userID)
                                    throws UserNotFoundException
Returns a collection of avatars for a user

Parameters:
userID - user ID to find an avatar for
Returns:
List of WSAvatar objects
Throws:
UserNotFoundException - if the specified user does not exist

getActiveAvatar

WSAvatar getActiveAvatar(long userID)
                         throws UserNotFoundException,
                                AttachmentNotFoundException
Returns an avatar for a user, else the SystemDefaultAvatar if the user does not have an active avatar specified.

Parameters:
userID - user ID to acquire an avatar for
Returns:
an avatar for a particular user
Throws:
UserNotFoundException - if the specified user does not exist
AttachmentNotFoundException - it there is a problem loading the avatar's image

getGlobalAvatars

java.util.List<WSAvatar> getGlobalAvatars()
Returns a collection of all of the global avatars

Returns:
a collection of all of the global avatars

deleteAvatar

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

Parameters:
avatarID - the avatar ID to delete
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(long userID)
                   throws UserNotFoundException
Used to acquire a count of all the avatars for a specific user

Parameters:
userID - user to count avatars for
Returns:
the number avatars the user has
Throws:
UserNotFoundException - if the specified user does not exist

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.List<WSAvatar> 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.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.