Class PersistentAnnotation

    • Constructor Detail

      • PersistentAnnotation

        public PersistentAnnotation()
        empty constructor
      • PersistentAnnotation

        public PersistentAnnotation​(de.intranda.api.annotation.wa.WebAnnotation source,
                                    Long id,
                                    String targetPI,
                                    Integer targetPage)
        creates a new PersistentAnnotation from a WebAnnotation
        Parameters:
        source - a WebAnnotation object.
    • Method Detail

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

        public Optional<User> getCreatorIfPresent()
      • setCreator

        public void setCreator​(User creator)

        setCreator.

        Parameters:
        creator - the creator to set
      • setReviewer

        public void setReviewer​(User reviewer)

        setReviewer.

        Parameters:
        reviewer - the reviewer to set
      • 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
      • 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