Class RichText

java.lang.Object
org.ametys.cms.data.Resource
org.ametys.cms.data.RichText

public class RichText extends Resource
CLass representing a rich text
  • Field Details

  • Constructor Details

    • RichText

      public RichText()
      Default constructor
    • RichText

      public RichText(RepositoryData richTextData, RepositoryData folderData)
      Constructor to use when reading the rich text from the repository
      Parameters:
      richTextData - the repository data containing the rich text's data
      folderData - the repository data containing the folder's data
  • Method Details

    • setMimeType

      public void setMimeType(String mimeType)
      Description copied from class: Resource
      Sets the mime type of the resource's data
      Overrides:
      setMimeType in class Resource
      Parameters:
      mimeType - the mime type to set
    • setEncoding

      public void setEncoding(String encoding)
      Description copied from class: Resource
      Sets the encoding of the resource's data
      Overrides:
      setEncoding in class Resource
      Parameters:
      encoding - the encoding to set
    • getAllAnnotations

      Retrieves the rich text's annotations
      Returns:
      the rich text's annotations
    • getAnnotations

      public List<String> getAnnotations(String name)
      Retrieves the rich text's annotations of the given name
      Parameters:
      name - the name of the annotations to retrieve
      Returns:
      the rich text's annotations of the given name
    • addAnnotations

      public void addAnnotations(String name, String... values)
      Add annotations to the rich text
      Parameters:
      name - the name of the annotations to add
      values - annotations to add
    • removeAllAnnotations

      public void removeAllAnnotations()
      Removes all rich text's annotations
    • removeAnnotations

      public void removeAnnotations(String name)
      Removes the rich text's annotations of the given name
      Parameters:
      name - the name of the annotations to remove
    • getAttachmentNames

      Retrieves the names of the rich text's attachments
      Returns:
      the names of the rich text's attachments
    • getAttachments

      Retrieves the rich text's attachments
      Returns:
      the rich text's attachments
    • getFetchedAttachments

      Retrieves the attachments that have already been fetched
      Returns:
      the fetched attachments
    • getRemovedAttachments

      Retrieves the names of the removed attachments of the rich text
      Returns:
      the names of the removed attachments
    • hasAttachment

      public boolean hasAttachment(String filename)
      Checks if the rich text has an attachment with the given name
      Parameters:
      filename - the name of the attachment
      Returns:
      true if the rich text has an attachment with the given name, false otherwise
    • getAttachment

      public NamedResource getAttachment(String filename)
      Retrieves the rich text's attachment with the given name, or null if there is no such attachment
      Parameters:
      filename - the name of the attachment to retrieve
      Returns:
      the rich text's attachment with the given name
    • addAttachment

      public void addAttachment(NamedResource attachment)
      Adds an attachment to the rich text
      Parameters:
      attachment - the attachment to add
    • removeAttachment

      public void removeAttachment(String filename)
      Remove an attachment from the rich text
      Parameters:
      filename - the name of the attachment to remove
    • removeAttachments

      public void removeAttachments()
      Remove all the attachments from the rich text