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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateComment(String text, boolean restricted) createComment.voiddeleteComment.voiddeleteComment(Comment annotation) deleteComment.voideditComment.voideditComment(Comment original, String text, boolean restricted) editComment.getComments(int startIndex, int numItems, String filter, User user, String sortField, boolean descending) getComments.getCommentsForCurrentPage.booleanChecks 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.booleanChecks 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.booleanisRestricted.booleanisUserCommentsEnabled.
-
Constructor Details
-
CommentBean
Constructor for CommentBean.
-
-
Method Details
-
createComment
createComment.
- Parameters:
text- aStringobjectrestricted- 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- aCommentobjecttext- aStringobjectrestricted- a boolean- Throws:
DAOExceptionPresentationExceptionIndexUnreachableException
-
deleteComment
deleteComment.
-
deleteComment
public void deleteComment(Comment annotation) throws DAOException, PresentationException, IndexUnreachableException deleteComment.
- Parameters:
annotation- aCommentobject- Throws:
DAOExceptionPresentationExceptionIndexUnreachableException
-
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- aCrowdsourcingAnnotationobject- 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:
DAOExceptionPresentationExceptionIndexUnreachableException
-
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:
DAOExceptionPresentationExceptionIndexUnreachableException
-