Interface Thumbnail

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    ThumbnailDetail

    public interface Thumbnail
    extends Serializable
    A thumbnail is an image summarizing a type of resource or the content of a contribution. Usually such objects should implement the WithThumbnail interface. The thumbnail is an image stored into a file on the filesystem and this image can be cropped either by the user or by Silverpeas itself to answer some requirements.
    Author:
    mmoquillon
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canBeCropped()
      Is this thumbnail can be cropped?
      String getCropFileName()
      Gets the name of the file in which is stored the cropped version of the image and that will be actually used as thumbnail.
      String getImageFileName()
      Gets the name of the file in which is stored the thumbnail by following the process: first it checks for a file with the cropped image of the thumbnail, if no such file is found, then it rollbacks to the original file of the thumbnail.
      String getMimeType()
      Gets the MIME type of the thumbnail.
      String getOriginalFileName()
      Gets the name of the file in which is stored the image that was uploaded to be used as a thumbnail of a resource in Silverpeas.
      ResourceReference getReference()
      Gets the resource or the contribution in Silverpeas to which this thumbnail is related.
      String getURL()
      Gets the URL of the thumbnail in Silverpeas in order to be rendered in the Web client.
      boolean isCropped()
      Is this thumbnail has been cropped?
    • Method Detail

      • getReference

        ResourceReference getReference()
        Gets the resource or the contribution in Silverpeas to which this thumbnail is related.
        Returns:
        a reference to the resource or to the contribution related by this image.
      • getMimeType

        String getMimeType()
        Gets the MIME type of the thumbnail. For example "image/jpeg" for a JPEG image.
        Returns:
        the MIME type of the image.
      • getImageFileName

        String getImageFileName()
        Gets the name of the file in which is stored the thumbnail by following the process: first it checks for a file with the cropped image of the thumbnail, if no such file is found, then it rollbacks to the original file of the thumbnail. If the crop file name exists it is returned, otherwise the original file name is returned.
        Returns:
        a file name as string.
      • getOriginalFileName

        String getOriginalFileName()
        Gets the name of the file in which is stored the image that was uploaded to be used as a thumbnail of a resource in Silverpeas.
        Returns:
        the original file name of this image.
      • getCropFileName

        String getCropFileName()
        Gets the name of the file in which is stored the cropped version of the image and that will be actually used as thumbnail. If no cropped version exists (checks with the isCropped() method), null is returned.
        Returns:
        the file name of the cropped version of this image. Null if no cropped version exists.
      • isCropped

        boolean isCropped()
        Is this thumbnail has been cropped?
        Returns:
        true if it exists a cropped version of this thumbnail. False otherwise.
      • canBeCropped

        boolean canBeCropped()
        Is this thumbnail can be cropped?
        Returns:
        true if the Silverpeas can crop this image. False otherwise.
      • getURL

        String getURL()
        Gets the URL of the thumbnail in Silverpeas in order to be rendered in the Web client.
        Returns:
        the URL of this thumbnail.