Interface ImageEntity


  • public interface ImageEntity
    An image entity represents an image stored in the JCR. It is used by the image entity management service to retrieve image entities from the JCR and to update them. Instances returned by the management service implement the ImageEntity interface.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String getId()
      Returns the identifier of the image entity (the UUID).
      Image getImage()
      Returns the image wrapper that holds the image.
      org.springframework.web.multipart.MultipartFile getImageFile()
      Returns the new image file that has been attached to this image entity.
      Integer getImageId()
      Returns the id of the image media item if this image is associated with an image media item from the content repository.
      int getImageMediaItemId()
      If the image is stored in the content repository, this method returns the identifier of that image media item.
      FileResource getImageResource()
      Returns the image wrapped as a FileResource object.
      Website getWebsite()
      Returns the website on which the component which uses the image entity runs.
      boolean isEmpty()
      Returns if an image (either from disk or the content repository) is associated with this image entity.
      boolean isStoredInContentRepository()
      Returns true if the image contained by this entity is stored in the content repository as image media item.
      void setImageResource​(FileResource fileResource)
      Sets the image as a FileResource.
    • Method Detail

      • getId

        String getId()
        Returns the identifier of the image entity (the UUID).
        Returns:
        the identifier of the image entity (the UUID)
      • getWebsite

        Website getWebsite()
        Returns the website on which the component which uses the image entity runs.
        Returns:
        the website on which the component which uses the image entity runs
      • isStoredInContentRepository

        boolean isStoredInContentRepository()
        Returns true if the image contained by this entity is stored in the content repository as image media item. An image entity can reference an image media item or be associated with an image file that has been uploaded manually.
        Returns:
        true if the image contained by this entity is stored in the content repository
      • getImageMediaItemId

        int getImageMediaItemId()
        If the image is stored in the content repository, this method returns the identifier of that image media item.
        Returns:
        the identifier of the image media item if the image is stored in the content repository, -1 otherwise
      • getImage

        Image getImage()
        Returns the image wrapper that holds the image. This can either be an image uploaded manually, of a reference to an image media item. All properties of the image itself like the url, width, height and focus points are contained by this wrapper.
        Returns:
        the image wrapper that holds the image
      • isEmpty

        boolean isEmpty()
        Returns if an image (either from disk or the content repository) is associated with this image entity.
        Returns:
        true if an image (either from disk or the content repository) is associated with this image entity, false otherwise
        Since:
        10.31.0
      • getImageFile

        org.springframework.web.multipart.MultipartFile getImageFile()
        Returns the new image file that has been attached to this image entity. This method only returns a not null value if a NEW image file has been attached. When it is invoked on an image entity that has been persisted before it will always return null, unless the image file is actually changed after retrieving it.
        Returns:
        new image file that has been attached to this image entity or null of no new image has been attached
      • getImageId

        Integer getImageId()
        Returns the id of the image media item if this image is associated with an image media item from the content repository. If the image is not associated with an image media item this value is null.
        Returns:
        the id of the image media item if this image is associated with an image media item from the content repository, null otherwise
      • getImageResource

        FileResource getImageResource()
        Returns the image wrapped as a FileResource object. File resources are used to render the image in a frontend presentation.
        Returns:
        the image wrapped as a FileResource object.
      • setImageResource

        void setImageResource​(FileResource fileResource)
        Sets the image as a FileResource. If null is passed, the attached image is removed (in both cases; when the image is locally attached and when it is selected from the content repository).
        Parameters:
        fileResource - the image wrapped as a FileResource object.