Package nl.gx.webmanager.cms.element
Interface ImageElement
-
- All Superinterfaces:
DelegatedControllerAware
,Element
,Presentable
,Wrapper
- All Known Subinterfaces:
ImageMapElement
@Indexable public interface ImageElement extends Element
Image element.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ImageElement.Alignment
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ImageElement.Alignment
getAlignment()
Gets the alignment for the image.String
getAlternativeText()
Returns the alt text for the image.String
getCode()
Returns the internal link code needed to place an internal link tag around the image.Image
getImage()
Returns the representation of the actual image.Image
getImageFile()
Returns the representation of the actual image.MediaItem
getMediaItem()
Returns the media item representation of the actual image.String
getSubText()
Returns the subtext of the image.boolean
hasCaption()
Returns if the alternative text needs to be used as caption.void
setAlignment(ImageElement.Alignment alternativeText)
Sets the alignment for the image.void
setAlternativeText(String alternativeText)
Sets the alt text for the image.void
setCaption(boolean isCaption)
Sets if the alternative text needs to be used as caption.void
setCode(String code)
Sets the internal link code needed to place an internal link tag around the image.void
setImageFile(File file, String originalFileName, String mimeType)
Sets the representation of the actual image.void
setImageFile(FileResource image)
Sets the representation of the actual image.void
setImageFile(org.springframework.web.multipart.MultipartFile imageMultiPartFile)
Sets the representation of the actual image.void
setMediaItem(MediaItem mediaItem)
Sets the image media item representation of the actual image.-
Methods inherited from interface nl.gx.webmanager.springmvc.DelegatedControllerAware
getDelegatedController, setDelegatedController
-
Methods inherited from interface nl.gx.webmanager.cms.element.Element
cleanup, copy, getAnchorElement, getEditElementHeader, getElementHolder, getHeader, getIcon, getId, getIdentity, getLastModifiedDate, getMediaItemVersion, getPageModel, getPageModelElement, getPageVersion, getPersonalizationAttributes, getPersonalizationItems, getPersonalizationOperator, getReferencedContentItems, getTitle, getTypeIdentifier, getWebsite, isAuthorized, setAuthorized, setDefaultPresentation, setEditElementHeader, setHeader, setIcon, setIdentity, setLastModifiedDate, setPersonalizationAttributes, setPersonalizationItems, setPersonalizationOperator, setTitle
-
Methods inherited from interface nl.gx.webmanager.cms.core.Presentable
getPresentation, getPresentationVariant, render, render, setPresentation, setPresentationVariant
-
-
-
-
Method Detail
-
getCode
String getCode()
Returns the internal link code needed to place an internal link tag around the image.- Returns:
- the internal link code needed to place an internal link tag around the image.
-
setCode
void setCode(String code)
Sets the internal link code needed to place an internal link tag around the image.- Parameters:
code
- the internal link code needed to place an internal link tag around the image.
-
getSubText
String getSubText()
Returns the subtext of the image.- Returns:
- the subtext of the image.
-
hasCaption
boolean hasCaption()
Returns if the alternative text needs to be used as caption. If hasCaption is true, the method getSubText() returns the alternative text, if hasCaption is false, the method getSubText() returns an empty string.- Returns:
- true if the alternative text needs to be used as caption
-
setCaption
void setCaption(boolean isCaption)
Sets if the alternative text needs to be used as caption.- Parameters:
isCaption
-
-
getImageFile
Image getImageFile()
Returns the representation of the actual image.- Returns:
- the representation of the actual image.
-
getImage
@ReferDocument Image getImage()
Returns the representation of the actual image.- Returns:
- the representation of the actual image.
-
setImageFile
void setImageFile(FileResource image)
Sets the representation of the actual image.- Parameters:
image
- the representation of the actual image.
-
setImageFile
void setImageFile(org.springframework.web.multipart.MultipartFile imageMultiPartFile)
Sets the representation of the actual image.- Parameters:
imageMultiPartFile
- the representation of the actual image.
-
setImageFile
void setImageFile(File file, String originalFileName, String mimeType)
Sets the representation of the actual image.- Parameters:
file
- the representation of the actual imageoriginalFileName
- the original name of the imagemimeType
- the mimeType of the image
-
getAlternativeText
@ReferField(stored=false, body=true) String getAlternativeText()
Returns the alt text for the image.- Returns:
- the alt text for the image.
-
setAlternativeText
void setAlternativeText(String alternativeText)
Sets the alt text for the image.- Parameters:
alternativeText
- the alt text for the image.
-
getAlignment
ImageElement.Alignment getAlignment()
Gets the alignment for the image.- Returns:
- the alignment for the image.
-
setAlignment
void setAlignment(ImageElement.Alignment alternativeText)
Sets the alignment for the image.- Parameters:
alternativeText
- the alignment for the image.
-
getMediaItem
@ReferField(stored=false, indexed=true, adapter=ContentReferenceFieldAdapter.class) MediaItem getMediaItem()
Returns the media item representation of the actual image. Returnsnull
if the assigned image is not selected from the Object Manager.- Returns:
- The media item representation of the assigned image, or
null
if not originating from the Object Manager.
-
setMediaItem
void setMediaItem(MediaItem mediaItem)
Sets the image media item representation of the actual image.- Parameters:
mediaItem
- the media item representation of the assigned image from the Object Manager. When the media item isnull
, the assignment of the image is removed.
-
-