Class PersistentAnnotation
- Direct Known Subclasses:
Comment
,CrowdsourcingAnnotation
,GeneralAnnotation
- Author:
- florian
-
Constructor Summary
ModifierConstructorDescriptionprotected
empty constructorprotected
PersistentAnnotation
(de.intranda.api.annotation.AbstractAnnotation source, Long id, String targetPI, Integer targetPage) creates a new PersistentAnnotation from a WebAnnotationprotected
-
Method Summary
Modifier and TypeMethodDescriptionint
Deletes exported JSON annotations from a related record's data folder.boolean
getBody()
Getter for the fieldbody
.getContentString.getCreator.Getter for the fieldcreatorId
.Getter for the fielddateCreated
.Getter for the fielddateModified
.getDisplayDate
(LocalDateTime date) getGenerator.Getter for the fieldgeneratorId
.getId()
Getter for the fieldid
.Getter for the fieldmotivation
.getReviewer.Getter for the fieldreviewerId
.Getter for the fieldtarget
.getTargetLink.Getter for the fieldtargetPageOrder
.Getter for the fieldtargetPI
.int
hashCode()
boolean
Checks whether the user with the given ID is allowed to edit this comment (i.e. the annotation belongs to this (proper) user.void
setAccessCondition
(String accessCondition) void
Setter for the fieldbody
.void
setCreator
(User creator) setCreator.void
setCreatorId
(Long creatorId) Setter for the fieldcreatorId
.void
setDateCreated
(LocalDateTime dateCreated) Setter for the fielddateCreated
.void
setDateModified
(LocalDateTime dateModified) Setter for the fielddateModified
.void
setGenerator
(Question generator) setGenerator.void
setGeneratorId
(Long generatorId) Setter for the fieldgeneratorId
.void
Setter for the fieldid
.void
setMotivation
(String motivation) Setter for the fieldmotivation
.void
setPublicationStatus
(PublicationStatus publicationStatus) void
setReviewer
(User reviewer) setReviewer.void
setReviewerId
(Long reviewerId) Setter for the fieldreviewerId
.void
Setter for the fieldtarget
.void
setTargetPageOrder
(Integer targetPageOrder) Setter for the fieldtargetPageOrder
.void
setTargetPI
(String targetPI) Setter for the fieldtargetPI
.toString()
-
Constructor Details
-
PersistentAnnotation
protected PersistentAnnotation()empty constructor -
PersistentAnnotation
- 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
- aWebAnnotation
object.id
-targetPI
-targetPage
-
-
-
Method Details
-
getId
Getter for the field
id
.- Returns:
- the id
-
setId
Setter for the field
id
.- Parameters:
id
- the id to set
-
getDateCreated
Getter for the field
dateCreated
.- Returns:
- the dateCreated
-
setDateCreated
Setter for the field
dateCreated
.- Parameters:
dateCreated
- the dateCreated to set
-
getDateModified
Getter for the field
dateModified
.- Returns:
- the dateModified
-
setDateModified
Setter for the field
dateModified
.- Parameters:
dateModified
- the dateModified to set
-
getCreator
getCreator.
- Returns:
- the creator
- Throws:
DAOException
- if any.
-
getCreatorIfPresent
-
setCreator
setCreator.
- Parameters:
creator
- the creator to set
-
getReviewer
getReviewer.
- Returns:
- the reviewer
- Throws:
DAOException
- if any.
-
setReviewer
setReviewer.
- Parameters:
reviewer
- the reviewer to set
-
getGenerator
getGenerator.
- Returns:
- the generator
- Throws:
DAOException
- if any.
-
setGenerator
setGenerator.
- Parameters:
generator
- the generator to set
-
getCreatorId
Getter for the field
creatorId
.- Returns:
- the creatorId
-
setCreatorId
Setter for the field
creatorId
.- Parameters:
creatorId
- the creatorId to set
-
getReviewerId
Getter for the field
reviewerId
.- Returns:
- the reviewerId
-
setReviewerId
Setter for the field
reviewerId
.- Parameters:
reviewerId
- the reviewerId to set
-
getGeneratorId
Getter for the field
generatorId
.- Returns:
- the generatorId
-
setGeneratorId
Setter for the field
generatorId
.- Parameters:
generatorId
- the generatorId to set
-
getBody
Getter for the field
body
.- Returns:
- the body
-
setBody
Setter for the field
body
.- Parameters:
body
- the body to set
-
getMotivation
Getter for the field
motivation
.- Returns:
- the motivation
-
setMotivation
Setter for the field
motivation
.- Parameters:
motivation
- the motivation to set
-
getTarget
Getter for the field
target
.- Returns:
- the target
-
getTargetPI
Getter for the field
targetPI
.- Returns:
- the targetPI
-
getTargetPageOrder
Getter for the field
targetPageOrder
.- Returns:
- the targetPageOrder
-
setTargetPI
Setter for the field
targetPI
.- Parameters:
targetPI
- the targetPI to set
-
setTargetPageOrder
Setter for the field
targetPageOrder
.- Parameters:
targetPageOrder
- the targetPageOrder to set
-
setTarget
Setter for the field
target
.- Parameters:
target
- the target to set
-
deleteExportedTextFiles
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
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
getTargetLink.
- Returns:
- URL string to the record view
-
getAccessCondition
- Returns:
- the accessCondition
-
setAccessCondition
- Parameters:
accessCondition
- the accessCondition to set
-
toString
-
getDisplayDate
-
mayEdit
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
- aUser
object.- Returns:
- true if allowed; false otherwise
-
getPublicationStatus
- Returns:
- the publicationStatus
-
setPublicationStatus
- Parameters:
publicationStatus
- the publicationStatus to set
-
hashCode
public int hashCode() -
equals
-