Package io.goobi.viewer.managedbeans
Class CommentBean
java.lang.Object
io.goobi.viewer.managedbeans.CommentBean
- All Implemented Interfaces:
Serializable
CommentBean class.
- Author:
- florian
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createComment
(String text, boolean restricted) createComment.void
deleteComment.void
deleteComment
(Comment annotation) deleteComment.void
editComment.void
editComment
(Comment original, String text, boolean restricted) editComment.getComments
(int startIndex, int numItems, String filter, User user, String sortField, boolean descending) getComments.getCommentsForCurrentPage.boolean
Checks whether the current user may delete comments for the given record identifier, based on their admin status or membership in any user group that has such permission via comment groups.boolean
Checks whether the current user may edit comments for the given record identifier, based on their admin status or membership in any user group that has such permission via comment groups.boolean
isRestricted.boolean
isUserCommentsEnabled.
-
Constructor Details
-
CommentBean
Constructor for CommentBean.
-
-
Method Details
-
createComment
createComment.
- Parameters:
text
- aString
objectrestricted
- a boolean- Throws:
AjaxResponseException
-
editComment
editComment.
- Throws:
PresentationException
-
editComment
public void editComment(Comment original, String text, boolean restricted) throws DAOException, PresentationException, IndexUnreachableException editComment.
- Parameters:
original
- aComment
objecttext
- aString
objectrestricted
- a boolean- Throws:
DAOException
PresentationException
IndexUnreachableException
-
deleteComment
deleteComment.
-
deleteComment
public void deleteComment(Comment annotation) throws DAOException, PresentationException, IndexUnreachableException deleteComment.
- Parameters:
annotation
- aComment
object- Throws:
DAOException
PresentationException
IndexUnreachableException
-
getComments
public List<Comment> getComments(int startIndex, int numItems, String filter, User user, String sortField, boolean descending) getComments.
-
getCommentsForCurrentPage
getCommentsForCurrentPage.
- Returns:
- List of comments for the current page of the loaded record
- Throws:
IndexUnreachableException
-
isRestricted
isRestricted.
- Parameters:
anno
- aCrowdsourcingAnnotation
object- Returns:
- true if given annotation requires special privileges for commenting; false otherwise
-
isUserCommentsEnabled
isUserCommentsEnabled.
- Returns:
- a boolean.
- Throws:
DAOException
-
isMayEditCommentsForRecord
public boolean isMayEditCommentsForRecord(String pi) throws DAOException, PresentationException, IndexUnreachableException Checks whether the current user may edit comments for the given record identifier, based on their admin status or membership in any user group that has such permission via comment groups.- Parameters:
pi
- Record identifier- Returns:
- true if logged in user may edit comments for record with given PI; false otherwise
- Throws:
DAOException
PresentationException
IndexUnreachableException
-
isMayDeleteCommentsForRecord
public boolean isMayDeleteCommentsForRecord(String pi) throws DAOException, PresentationException, IndexUnreachableException Checks whether the current user may delete comments for the given record identifier, based on their admin status or membership in any user group that has such permission via comment groups.- Parameters:
pi
- Record identifier- Returns:
- true if logged in user may delete comments for record with given PI; false otherwise
- Throws:
DAOException
PresentationException
IndexUnreachableException
-