Class ThumbnailDetail
- java.lang.Object
-
- org.silverpeas.core.io.media.image.thumbnail.model.ThumbnailDetail
-
- All Implemented Interfaces:
Serializable
,Thumbnail
public class ThumbnailDetail extends Object implements Thumbnail
Representation of a thumbnail of an object.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
THUMBNAIL_OBJECTTYPE_PUBLICATION_VIGNETTE
-
Constructor Summary
Constructors Constructor Description ThumbnailDetail(String instanceId, int objectId, int objectType)
-
Method Summary
All Methods Instance Methods Concrete 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()
Returns the image file name of thumbnail by priority.String
getInstanceId()
String
getMimeType()
Gets the MIME type of the thumbnail.String
getNonCroppedURL()
Gets the URL of non cropped thumbnail in Silverpeas in order to be rendered in management features.int
getObjectId()
int
getObjectType()
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.Optional<Path>
getPath()
Gets the absolute path of this thumbnail in the file system.ThumbnailReference
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.int
getXLength()
int
getXStart()
int
getYLength()
int
getYStart()
boolean
isCropped()
Is this thumbnail has been cropped?void
setCropFileName(String cropFileName)
void
setInstanceId(String instanceId)
void
setMimeType(String mimeType)
void
setObjectId(int objectId)
void
setObjectType(int objectType)
void
setOriginalFileName(String originalFileName)
void
setXLength(int xLength)
void
setXStart(int xStart)
void
setYLength(int yLength)
void
setYStart(int yStart)
-
-
-
Field Detail
-
THUMBNAIL_OBJECTTYPE_PUBLICATION_VIGNETTE
public static final int THUMBNAIL_OBJECTTYPE_PUBLICATION_VIGNETTE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ThumbnailDetail
public ThumbnailDetail(String instanceId, int objectId, int objectType)
-
-
Method Detail
-
getReference
public ThumbnailReference getReference()
Description copied from interface:Thumbnail
Gets the resource or the contribution in Silverpeas to which this thumbnail is related.- Specified by:
getReference
in interfaceThumbnail
- Returns:
- a reference to the resource or to the contribution related by this image.
-
isCropped
public boolean isCropped()
Description copied from interface:Thumbnail
Is this thumbnail has been cropped?
-
getOriginalFileName
public String getOriginalFileName()
Description copied from interface:Thumbnail
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.- Specified by:
getOriginalFileName
in interfaceThumbnail
- Returns:
- the original file name of this image.
-
getCropFileName
public String getCropFileName()
Description copied from interface:Thumbnail
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 theThumbnail.isCropped()
method), null is returned.- Specified by:
getCropFileName
in interfaceThumbnail
- Returns:
- the file name of the cropped version of this image. Null if no cropped version exists.
-
getImageFileName
public String getImageFileName()
Returns the image file name of thumbnail by priority. If the crop file name exists it is returned, otherwise the original file name is returned.- Specified by:
getImageFileName
in interfaceThumbnail
- Returns:
- a file name as string.
-
getInstanceId
public String getInstanceId()
-
getXStart
public int getXStart()
-
getYStart
public int getYStart()
-
getXLength
public int getXLength()
-
getYLength
public int getYLength()
-
setObjectId
public void setObjectId(int objectId)
-
getObjectId
public int getObjectId()
-
getObjectType
public int getObjectType()
-
setObjectType
public void setObjectType(int objectType)
-
setInstanceId
public void setInstanceId(String instanceId)
-
setOriginalFileName
public void setOriginalFileName(String originalFileName)
-
setCropFileName
public void setCropFileName(String cropFileName)
-
setXStart
public void setXStart(int xStart)
-
setYStart
public void setYStart(int yStart)
-
setXLength
public void setXLength(int xLength)
-
setYLength
public void setYLength(int yLength)
-
setMimeType
public void setMimeType(String mimeType)
-
getMimeType
public String getMimeType()
Description copied from interface:Thumbnail
Gets the MIME type of the thumbnail. For example "image/jpeg" for a JPEG image.- Specified by:
getMimeType
in interfaceThumbnail
- Returns:
- the MIME type of the image.
-
canBeCropped
public boolean canBeCropped()
Description copied from interface:Thumbnail
Is this thumbnail can be cropped?- Specified by:
canBeCropped
in interfaceThumbnail
- Returns:
- true if the Silverpeas can crop this image. False otherwise.
-
getURL
public String getURL()
Description copied from interface:Thumbnail
Gets the URL of the thumbnail in Silverpeas in order to be rendered in the Web client.If
Thumbnail.isCropped()
returns true, then the URL returned is the one of cropped thumbnail.
-
getNonCroppedURL
public String getNonCroppedURL()
Description copied from interface:Thumbnail
Gets the URL of non cropped thumbnail in Silverpeas in order to be rendered in management features.- Specified by:
getNonCroppedURL
in interfaceThumbnail
- Returns:
- the URL of the non cropped thumbnail.
-
-