Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community
Interface ImageManager

All Superinterfaces:
JiveManager

public interface ImageManager
extends JiveManager

Manages image settings. There are three main properties that can administered with respect to images:

See Also:
Image

Method Summary
 void addAllowedType(java.lang.String contentType)
          Adds a content type to the list of explicitly allowed types.
 void addDisallowedType(java.lang.String contentType)
          Adds a content type to the list of explicitly disallowed types.
 java.util.List<java.lang.String> getAllowedTypes()
          Returns a list of explicitly allowed types.
 java.util.List<java.lang.String> getDisallowedTypes()
          Returns a list of explicitly disallowed types.
 Image getImage(long imageID)
          Returns an image given the image id.
 int getImageMaxHeight()
          Returns the max height of images that will be displayed.
 int getImageMaxWidth()
          Returns the max width of images that will be displayed.
 int getImagePreviewMaxSize()
          Returns the max dimension of generated thumbnails (ie, the max value for the width or height).
 int getMaxImageSize()
          Returns the maximum size of an individual image in kilobytes.
 int getMaxImagesPerObject()
          Returns the maximum number of images per document.
 boolean isAllowAllByDefault()
          Returns true if in the "allow all content types by default" mode.
 boolean isForceThumbnailsEnabled()
          Returns true if forcing thumbnails for any images over the maximum image width/height is enabled.
 boolean isImagesEnabled()
          Returns true if images are enabled, false otherwise.
 boolean isValidType(java.lang.String contentType)
          Returns true if the content type is valid based on the current settings of the allowAllByDefault flag and the allowed and disallowed types list.
 void removeAllowedType(java.lang.String contentType)
          Removes a content type from the list of explicitly allowed types.
 void removeDisallowedType(java.lang.String contentType)
          Removes a content type from the list of explicitly disallowed types.
 void setAllowAllByDefault(boolean allowAllByDefault)
          Sets the default allowed content types mode.
 void setForceThumbnailsEnabled(boolean forceThumbnailsEnabled)
          Sets the forcing of thumbnails for any images over a maximum image width/height.
 void setImageMaxHeight(int maxHeight)
          Sets the max height of images that will be displayed.
 void setImageMaxWidth(int maxWidth)
          Sets the max width of images that will be displayed.
 void setImagePreviewMaxSize(int imagePreviewMaxSize)
          Sets the max dimension of generated thumbnails (ie, the max value for the width or height).
 void setImagesEnabled(boolean enabled)
          Set to true if images should be enabled, false otherwise.
 void setMaxImageSize(int maxImageSize)
          Sets the maximum size of an individual image in kilobytes.
 void setMaxImagesPerObject(int maxImagesPerDocument)
          Sets the maximum number of images per document.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy, initialize
 

Method Detail

isImagesEnabled

boolean isImagesEnabled()
Returns true if images are enabled, false otherwise.

Returns:
true if images are enabled, false otherwise.

setImagesEnabled

void setImagesEnabled(boolean enabled)
                      throws UnauthorizedException
Set to true if images should be enabled, false otherwise. Default is true.

Parameters:
enabled - true if images should be enabled, false otherwise
Throws:
UnauthorizedException - if not an administrator.

getImage

Image getImage(long imageID)
               throws NotFoundException
Returns an image given the image id.

Parameters:
imageID - the id of the image to return.
Returns:
a Image with the given id.
Throws:
NotFoundException - if no image with the given id exists.

getMaxImageSize

int getMaxImageSize()
Returns the maximum size of an individual image in kilobytes. Trying to create an a image larger than the max size will fail with an exception. The default maximum image size is 2Mb.

Returns:
the max size in kilobytes of any single image.

setMaxImageSize

void setMaxImageSize(int maxImageSize)
                     throws UnauthorizedException
Sets the maximum size of an individual image in kilobytes. Trying to create an image larger than the max size will fail with an exception. The default maximum image size is 256 K.

Parameters:
maxImageSize - the max size in kilobytes of any single image.
Throws:
UnauthorizedException - if not an administrator.

getImagePreviewMaxSize

int getImagePreviewMaxSize()
Returns the max dimension of generated thumbnails (ie, the max value for the width or height). The default value is 250.

Returns:
the max dimension of a thumbnail.

setImagePreviewMaxSize

void setImagePreviewMaxSize(int imagePreviewMaxSize)
                            throws UnauthorizedException
Sets the max dimension of generated thumbnails (ie, the max value for the width or height). The default value is 250.

Parameters:
imagePreviewMaxSize - the max dimension of a thumbnail.
Throws:
UnauthorizedException - if not a system administrator.

isForceThumbnailsEnabled

boolean isForceThumbnailsEnabled()
Returns true if forcing thumbnails for any images over the maximum image width/height is enabled. The default is false.

Returns:
true if forcing thumbnails for any images over the maximum image width/height is enabled

setForceThumbnailsEnabled

void setForceThumbnailsEnabled(boolean forceThumbnailsEnabled)
                               throws UnauthorizedException
Sets the forcing of thumbnails for any images over a maximum image width/height. The default is false.

Parameters:
forceThumbnailsEnabled - true to force thumbnails for images over a set size, false otherwise.
Throws:
UnauthorizedException - if not a system administrator.

getImageMaxWidth

int getImageMaxWidth()
Returns the max width of images that will be displayed. Any images over this size will automatically be converted into a clickable thumbnail image by the render system if isForceThumbnailsEnabled() is true. The default value is 450.

Returns:
the max width of images that will be displayed

setImageMaxWidth

void setImageMaxWidth(int maxWidth)
                      throws UnauthorizedException
Sets the max width of images that will be displayed. Any images over this size will automatically be converted into a clickable thumbnail image by the render system if isForceThumbnailsEnabled() is true. The default value is 450.

Parameters:
maxWidth - the max width of an image
Throws:
UnauthorizedException - if not a system administrator.

getImageMaxHeight

int getImageMaxHeight()
Returns the max height of images that will be displayed. Any images over this size will automatically be converted into a clickable thumbnail image by the render system if isForceThumbnailsEnabled() is true. The default value is 600.

Returns:
the max height of images that will be displayed

setImageMaxHeight

void setImageMaxHeight(int maxHeight)
                       throws UnauthorizedException
Sets the max height of images that will be displayed. Any images over this size will automatically be converted into a clickable thumbnail image by the render system if isForceThumbnailsEnabled() is true. The default value is 600.

Parameters:
maxHeight - the max height of an image
Throws:
UnauthorizedException - if not a system administrator.

getMaxImagesPerObject

int getMaxImagesPerObject()
Returns the maximum number of images per document. The default is 5 images.

Returns:
the max number of images allowed per document.

setMaxImagesPerObject

void setMaxImagesPerObject(int maxImagesPerDocument)
                           throws UnauthorizedException
Sets the maximum number of images per document. The default is 5 images.

Parameters:
maxImagesPerDocument - the max number of images allowed per document.
Throws:
UnauthorizedException - if not an administrator.

isValidType

boolean isValidType(java.lang.String contentType)
Returns true if the content type is valid based on the current settings of the allowAllByDefault flag and the allowed and disallowed types list.

Parameters:
contentType - the content type to test.
Returns:
true if the content type is valid.

addAllowedType

void addAllowedType(java.lang.String contentType)
                    throws UnauthorizedException
Adds a content type to the list of explicitly allowed types.

Parameters:
contentType - a content type to add to the explicitly allowed types list.
Throws:
UnauthorizedException - if not an administrator.

removeAllowedType

void removeAllowedType(java.lang.String contentType)
                       throws UnauthorizedException
Removes a content type from the list of explicitly allowed types. If the given content type does not exist in the list, this method does nothing.

Parameters:
contentType - a content type to remove from the explicitly allowed types list.
Throws:
UnauthorizedException - if not an administrator.

getAllowedTypes

java.util.List<java.lang.String> getAllowedTypes()
Returns a list of explicitly allowed types.

Returns:
a list of all explicitly allowed types.

addDisallowedType

void addDisallowedType(java.lang.String contentType)
                       throws UnauthorizedException
Adds a content type to the list of explicitly disallowed types.

Parameters:
contentType - a content type to add to the explicitly disallowed types list.
Throws:
UnauthorizedException - if not an administrator.

removeDisallowedType

void removeDisallowedType(java.lang.String contentType)
                          throws UnauthorizedException
Removes a content type from the list of explicitly disallowed types.

Parameters:
contentType - a content type to remove from the explicitly disallowed types list.
Throws:
UnauthorizedException - if not an administrator.

getDisallowedTypes

java.util.List<java.lang.String> getDisallowedTypes()
Returns a list of explicitly disallowed types.

Returns:
a list of all explicitly disallowed types.

isAllowAllByDefault

boolean isAllowAllByDefault()
Returns true if in the "allow all content types by default" mode. The alternative is that all content types are disallowed unless they're on the "allowed" list.

Returns:
true if all content types are allowed by default.

setAllowAllByDefault

void setAllowAllByDefault(boolean allowAllByDefault)
                          throws UnauthorizedException
Sets the default allowed content types mode. The value true means that all content types will be allowed unless they're on the "disallowed list". If false, no content types will be allowed unless on the "allowed list".

Parameters:
allowAllByDefault - true if all content types should be allowed by default.
Throws:
UnauthorizedException - if not an administrator

Clearspace Project Page

Copyright © 1999-2007 Jive Software.