Class CommentLegacy

java.lang.Object
io.goobi.viewer.model.annotation.comments.CommentLegacy
All Implemented Interfaces:
Comparable<CommentLegacy>

public class CommentLegacy extends Object implements Comparable<CommentLegacy>

Comment class.

  • Constructor Details

    • CommentLegacy

      public CommentLegacy()

      Constructor for Comment.

    • CommentLegacy

      public CommentLegacy(String pi, int page, User owner, String text, CommentLegacy parent)

      Constructor for Comment.

      Parameters:
      pi - a String object.
      page - a int.
      owner - a User object.
      text - a String object.
      parent - a Comment object.
  • Method Details

    • compareTo

      public int compareTo(CommentLegacy o)
      Specified by:
      compareTo in interface Comparable<CommentLegacy>
    • sendEmailNotifications

      public static boolean sendEmailNotifications(CommentLegacy comment, String oldText, Locale locale)
      Sends an email notification about a new or altered comment to the configured recipient addresses.
      Parameters:
      comment - a Comment object.
      oldText - a String object.
      locale - Language locale for the email text.
      Returns:
      a boolean.
    • mayEdit

      public boolean mayEdit(User user)
      Checks whether the user with the given ID is allowed to edit this comment (i.e. the annotation belongs to this (proper) user.
      Parameters:
      user - a User object.
      Returns:
      true if allowed; false otherwise
    • getDisplayDate

      public String getDisplayDate(LocalDateTime date)

      getDisplayDate.

      Parameters:
      date - a LocalDateTime object.
      Returns:
      a String object.
    • checkAndCleanScripts

      public void checkAndCleanScripts()
      Removes any script tags from the text value.
    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      the id
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - the id to set
    • getPi

      public String getPi()

      Getter for the field pi.

      Returns:
      the pi
    • setPi

      public void setPi(String pi)

      Setter for the field pi.

      Parameters:
      pi - the pi to set
    • getPage

      public Integer getPage()

      Getter for the field page.

      Returns:
      the page
    • setPage

      public void setPage(Integer page)

      Setter for the field page.

      Parameters:
      page - the page to set
    • getOwner

      public User getOwner()

      Getter for the field owner.

      Returns:
      the owner
    • setOwner

      public void setOwner(User owner)

      Setter for the field owner.

      Parameters:
      owner - the owner to set
    • setText

      public void setText(String text)

      Setter for the field text.

      Parameters:
      text - the text to set
    • getText

      public String getText()

      Getter for the field text.

      Returns:
      the text
    • getDisplayText

      public String getDisplayText()

      getDisplayText.

      Returns:
      a String object.
    • getOldText

      public String getOldText()

      Getter for the field oldText.

      Returns:
      the oldText
    • getDateCreated

      public LocalDateTime getDateCreated()

      Getter for the field dateCreated.

      Returns:
      the dateCreated
    • setDateCreated

      public void setDateCreated(LocalDateTime dateCreated)

      Setter for the field dateCreated.

      Parameters:
      dateCreated - the dateCreated to set
    • getDateUpdated

      public LocalDateTime getDateUpdated()

      Getter for the field dateUpdated.

      Returns:
      the dateUpdated
    • setDateUpdated

      public void setDateUpdated(LocalDateTime dateUpdated)

      Setter for the field dateUpdated.

      Parameters:
      dateUpdated - the dateUpdated to set
    • getLinkToRecord

      public String getLinkToRecord()