Package nl.gx.webmanager.cms.core
Interface Image
-
- All Known Subinterfaces:
InternalImage
@Indexable public interface Image
Image object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description String
getAbsoluteUrl()
Returns the absolute URL to the image file.String
getAlign()
Returns alignment.String
getAlternativeText()
Returns alt text for the HTML IMG tag.File
getFile()
Returns the physical file that holds the image.FileResource
getFileResource()
Returns the image as file resourcelong
getFileSize()
Returns the size in bytes of the file that holds the image.int
getFocusPointX()
Returns the focus point X value.int
getFocusPointY()
Returns the focus point Y value.int
getHeight()
Returns image height.String
getHtmlTag()
Deprecated.html tag is not xhtml strict compliant, create tag from presentation JSP.String
getRelativeUrl()
Returns the URL of this image, relatively to the www root directory.Image
getSizedImage(int width, int height)
Returns the cropped image for a particular size taking the focus point set into account.String
getUrl()
Returns the URL to the image file.Website
getWebsite()
Returns website which owns the image.int
getWidth()
Returns image width.boolean
isExists()
Returns whether image exists.
-
-
-
Method Detail
-
getUrl
@ReferField String getUrl()
Returns the URL to the image file. Generally this returns a relative URL, but in some cases (for example when the image is associated with a different website then the website of the active session) it may return an absolute URL. Use getRelativeUrl or getAbsoluteUrl if you want to ensure the type of URL you want. The returned URL cannot be null.- Returns:
- the URL to the image file (relative or absolute). Cannot be null.
-
getRelativeUrl
String getRelativeUrl()
Returns the URL of this image, relatively to the www root directory. Note that the www root directory is website independent. The upload and upload mm directories however are website specific, these directories are part of the relative URL returned by this method. The relative URL cannot be null.- Returns:
- The URL of this image, relatively to the www root directory. Cannot be null.
-
getAbsoluteUrl
String getAbsoluteUrl()
Returns the absolute URL to the image file. The absolute URL cannot be null.- Returns:
- the absolute URL to the image file. Cannot be null.
-
getHtmlTag
@Deprecated String getHtmlTag()
Deprecated.html tag is not xhtml strict compliant, create tag from presentation JSP.Returns html img tag for image.- Returns:
- html img tag for image.
-
getWidth
@ReferField int getWidth()
Returns image width.- Returns:
- image width.
-
getHeight
@ReferField int getHeight()
Returns image height.- Returns:
- image height.
-
getFile
File getFile()
Returns the physical file that holds the image.- Returns:
- the physical file that holds the image
-
getFileResource
FileResource getFileResource()
Returns the image as file resource- Returns:
- the image as file resource
- Since:
- 10.32.0
-
getFileSize
@ReferField(indexed=true) long getFileSize()
Returns the size in bytes of the file that holds the image. If no file is attached this method returns 0.- Returns:
- size in bytes of the image file or 0 if no file is attached
-
getAlign
String getAlign()
Returns alignment.- Returns:
- alignment.
-
getWebsite
Website getWebsite()
Returns website which owns the image.- Returns:
- website which owns the image.
-
isExists
boolean isExists()
Returns whether image exists. Useful when using >wm:image< tag for testing availability.- Returns:
true
if image exists,false
otherwise.
-
getAlternativeText
@ReferField(stored=false, body=true) String getAlternativeText()
Returns alt text for the HTML IMG tag.- Returns:
- alt text for the HTML IMG tag.
-
getSizedImage
Image getSizedImage(int width, int height)
Returns the cropped image for a particular size taking the focus point set into account.- Parameters:
width
- Resize the image to this width.height
- Resize the image to this height.- Returns:
- the cropped image for a particular size.
-
getFocusPointX
int getFocusPointX()
Returns the focus point X value.- Returns:
- The focus point X value or -1 when not set
-
getFocusPointY
int getFocusPointY()
Returns the focus point Y value.- Returns:
- The focus point Y value or -1 when not set
-
-