Class PersistentAnnotation

java.lang.Object
io.goobi.viewer.model.annotation.PersistentAnnotation
Direct Known Subclasses:
Comment, CrowdsourcingAnnotation, GeneralAnnotation

@Entity public abstract class PersistentAnnotation extends Object
Author:
florian
  • Constructor Details

    • PersistentAnnotation

      protected PersistentAnnotation()
      empty constructor
    • PersistentAnnotation

      protected PersistentAnnotation(PersistentAnnotation source)
      Parameters:
      source -
    • PersistentAnnotation

      protected PersistentAnnotation(de.intranda.api.annotation.AbstractAnnotation source, Long id, String targetPI, Integer targetPage)
      creates a new PersistentAnnotation from a WebAnnotation
      Parameters:
      source - a WebAnnotation object.
      id -
      targetPI -
      targetPage -
  • Method Details

    • 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
    • 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
    • getDateModified

      public LocalDateTime getDateModified()

      Getter for the field dateModified.

      Returns:
      the dateModified
    • setDateModified

      public void setDateModified(LocalDateTime dateModified)

      Setter for the field dateModified.

      Parameters:
      dateModified - the dateModified to set
    • getCreator

      public User getCreator() throws DAOException

      getCreator.

      Returns:
      the creator
      Throws:
      DAOException - if any.
    • getCreatorIfPresent

      public Optional<User> getCreatorIfPresent()
    • setCreator

      public void setCreator(User creator)

      setCreator.

      Parameters:
      creator - the creator to set
    • getReviewer

      public User getReviewer() throws DAOException

      getReviewer.

      Returns:
      the reviewer
      Throws:
      DAOException - if any.
    • setReviewer

      public void setReviewer(User reviewer)

      setReviewer.

      Parameters:
      reviewer - the reviewer to set
    • getGenerator

      public Question getGenerator() throws DAOException

      getGenerator.

      Returns:
      the generator
      Throws:
      DAOException - if any.
    • setGenerator

      public void setGenerator(Question generator)

      setGenerator.

      Parameters:
      generator - the generator to set
    • getCreatorId

      public Long getCreatorId()

      Getter for the field creatorId.

      Returns:
      the creatorId
    • setCreatorId

      public void setCreatorId(Long creatorId)

      Setter for the field creatorId.

      Parameters:
      creatorId - the creatorId to set
    • getReviewerId

      public Long getReviewerId()

      Getter for the field reviewerId.

      Returns:
      the reviewerId
    • setReviewerId

      public void setReviewerId(Long reviewerId)

      Setter for the field reviewerId.

      Parameters:
      reviewerId - the reviewerId to set
    • getGeneratorId

      public Long getGeneratorId()

      Getter for the field generatorId.

      Returns:
      the generatorId
    • setGeneratorId

      public void setGeneratorId(Long generatorId)

      Setter for the field generatorId.

      Parameters:
      generatorId - the generatorId to set
    • getBody

      public String getBody()

      Getter for the field body.

      Returns:
      the body
    • setBody

      public void setBody(String body)

      Setter for the field body.

      Parameters:
      body - the body to set
    • getMotivation

      public String getMotivation()

      Getter for the field motivation.

      Returns:
      the motivation
    • setMotivation

      public void setMotivation(String motivation)

      Setter for the field motivation.

      Parameters:
      motivation - the motivation to set
    • getTarget

      public String getTarget()

      Getter for the field target.

      Returns:
      the target
    • getTargetPI

      public String getTargetPI()

      Getter for the field targetPI.

      Returns:
      the targetPI
    • getTargetPageOrder

      public Integer getTargetPageOrder()

      Getter for the field targetPageOrder.

      Returns:
      the targetPageOrder
    • setTargetPI

      public void setTargetPI(String targetPI)

      Setter for the field targetPI.

      Parameters:
      targetPI - the targetPI to set
    • setTargetPageOrder

      public void setTargetPageOrder(Integer targetPageOrder)

      Setter for the field targetPageOrder.

      Parameters:
      targetPageOrder - the targetPageOrder to set
    • setTarget

      public void setTarget(String target)

      Setter for the field target.

      Parameters:
      target - the target to set
    • deleteExportedTextFiles

      public int deleteExportedTextFiles() throws ViewerConfigurationException
      Deletes exported JSON annotations from a related record's data folder. Should be called when deleting this annotation.
      Returns:
      Number of deleted files
      Throws:
      ViewerConfigurationException - if any.
    • getContentString

      public String getContentString()

      getContentString.

      Returns:
      Just the string value of the body document
      Throws:
      com.fasterxml.jackson.core.JsonParseException - if any.
      com.fasterxml.jackson.databind.JsonMappingException - if any.
      IOException - if any.
      DAOException - if any.
    • getTargetLink

      public String getTargetLink()

      getTargetLink.

      Returns:
      URL string to the record view
    • getAccessCondition

      public String getAccessCondition()
      Returns:
      the accessCondition
    • setAccessCondition

      public void setAccessCondition(String accessCondition)
      Parameters:
      accessCondition - the accessCondition to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDisplayDate

      public String getDisplayDate(LocalDateTime date)
    • 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
    • getPublicationStatus

      public PublicationStatus getPublicationStatus()
      Returns:
      the publicationStatus
    • setPublicationStatus

      public void setPublicationStatus(PublicationStatus publicationStatus)
      Parameters:
      publicationStatus - the publicationStatus to set
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object