Class PersistentAnnotation
- Direct Known Subclasses:
Comment,CrowdsourcingAnnotation,GeneralAnnotation
- Author:
- florian
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedempty constructorprotectedPersistentAnnotation(de.intranda.api.annotation.AbstractAnnotation source, Long id, String targetPI, Integer targetPage) creates a new PersistentAnnotation from a WebAnnotationprotected -
Method Summary
Modifier and TypeMethodDescriptionintDeletes exported JSON annotations from a related record's data folder.booleangetBody()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.inthashCode()booleanChecks whether the user with the given ID is allowed to edit this comment (i.e. the annotation belongs to this (proper) user.voidsetAccessCondition(String accessCondition) voidSetter for the fieldbody.voidsetCreator(User creator) setCreator.voidsetCreatorId(Long creatorId) Setter for the fieldcreatorId.voidsetDateCreated(LocalDateTime dateCreated) Setter for the fielddateCreated.voidsetDateModified(LocalDateTime dateModified) Setter for the fielddateModified.voidsetGenerator(Question generator) setGenerator.voidsetGeneratorId(Long generatorId) Setter for the fieldgeneratorId.voidSetter for the fieldid.voidsetMotivation(String motivation) Setter for the fieldmotivation.voidsetPublicationStatus(PublicationStatus publicationStatus) voidsetReviewer(User reviewer) setReviewer.voidsetReviewerId(Long reviewerId) Setter for the fieldreviewerId.voidSetter for the fieldtarget.voidsetTargetPageOrder(Integer targetPageOrder) Setter for the fieldtargetPageOrder.voidsetTargetPI(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- aWebAnnotationobject.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- aUserobject.- Returns:
- true if allowed; false otherwise
-
getPublicationStatus
- Returns:
- the publicationStatus
-
setPublicationStatus
- Parameters:
publicationStatus- the publicationStatus to set
-
hashCode
public int hashCode() -
equals
-