Package io.goobi.viewer.managedbeans
Class CommentBean
java.lang.Object
io.goobi.viewer.managedbeans.CommentBean
- All Implemented Interfaces:
Serializable
- Author:
- florian
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createComment
(String text, boolean restricted) void
void
deleteComment
(Comment annotation) void
void
editComment
(Comment original, String text, boolean restricted) getComments
(int startIndex, int numItems, String filter, User user, String sortField, boolean descending) 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
boolean
isUserCommentsEnabled.
-
Constructor Details
-
CommentBean
-
-
Method Details
-
createComment
- Parameters:
text
-restricted
-- Throws:
AjaxResponseException
-
editComment
- Throws:
PresentationException
-
editComment
public void editComment(Comment original, String text, boolean restricted) throws DAOException, PresentationException, IndexUnreachableException - Parameters:
original
-text
-restricted
-- Throws:
DAOException
PresentationException
IndexUnreachableException
-
deleteComment
-
deleteComment
public void deleteComment(Comment annotation) throws DAOException, PresentationException, IndexUnreachableException - Parameters:
annotation
-- Throws:
DAOException
PresentationException
IndexUnreachableException
-
getComments
public List<Comment> getComments(int startIndex, int numItems, String filter, User user, String sortField, boolean descending) - Parameters:
startIndex
-numItems
-filter
-user
-sortField
-descending
-- Returns:
- List of comments that match the search criteria
-
getCommentsForCurrentPage
- Returns:
- List of comments for the current page of the loaded record
- Throws:
IndexUnreachableException
-
isRestricted
- Parameters:
anno
-- 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
-