Class AdminCommentBean

java.lang.Object
io.goobi.viewer.managedbeans.AdminCommentBean
All Implemented Interfaces:
Serializable

@Named @SessionScoped public class AdminCommentBean extends Object implements Serializable
JSF backing bean for admin comment management, providing CRUD operations for user comments in the admin interface.
See Also:
  • Constructor Details

    • AdminCommentBean

      public AdminCommentBean()
  • Method Details

    • init

      @PostConstruct public void init()

      init.

    • isUserCommentsEnabled

      public boolean isUserCommentsEnabled()

      isUserCommentsEnabled.

      Returns:
      true if comments enabled; false otherwise
    • setUserBean

      public void setUserBean(UserBean userBean)

      Setter for the field userBean.

      Parameters:
      userBean - injected user session bean
    • getUserBean

      public UserBean getUserBean()

      Getter for the field userBean.

      Returns:
      the injected UserBean
    • setUserCommentsEnabled

      public void setUserCommentsEnabled(boolean userCommentsEnabled) throws DAOException

      setUserCommentsEnabled.

      Parameters:
      userCommentsEnabled - true to enable comments; false to disable
      Throws:
      DAOException
    • getAllCommentGroups

      public List<CommentGroup> getAllCommentGroups() throws DAOException

      getAllCommentGroups.

      Returns:
      All comment groups in the database
      Throws:
      DAOException
    • getCommentGroupsForUser

      public List<CommentGroup> getCommentGroupsForUser(User user) throws DAOException

      getCommentGroupsForUser.

      Parameters:
      user - Current user
      Returns:
      Filtered list of available CommentGroups to the given user
      Throws:
      DAOException
    • resetCurrentCommentGroupAction

      public void resetCurrentCommentGroupAction()

      resetCurrentCommentGroupAction.

    • newCurrentCommentGroupAction

      public void newCurrentCommentGroupAction()

      newCurrentCommentGroupAction.

    • saveCurentCommentGroupAction

      public String saveCurentCommentGroupAction() throws DAOException

      saveCurentCommentGroupAction.

      Returns:
      Navigation outcome
      Throws:
      DAOException
    • saveCommentGroupAction

      public String saveCommentGroupAction(CommentGroup commentGroup) throws DAOException
      saveCommentGroupAction.
      Parameters:
      commentGroup - comment group to persist or update
      Returns:
      Navigation outcome
      Throws:
      DAOException - if any.
    • deleteCommentGroupAction

      public String deleteCommentGroupAction(CommentGroup commentGroup) throws DAOException
      deleteCommentGroupAction.
      Parameters:
      commentGroup - comment group to delete from the database
      Returns:
      Navigation outcome
      Throws:
      DAOException - if any.
    • resetCurrentCommentAction

      public void resetCurrentCommentAction()

      resetCurrentCommentAction.

    • saveCommentAction

      public void saveCommentAction(Comment comment) throws DAOException
      saveCommentAction.
      Parameters:
      comment - comment to persist or update
      Throws:
      DAOException - if any.
    • deleteCommentAction

      public String deleteCommentAction(Comment comment) throws DAOException
      deleteCommentAction.
      Parameters:
      comment - comment to delete from the database
      Returns:
      empty navigation outcome string
      Throws:
      DAOException - if any.
    • getLazyModelComments

      public TableDataProvider<Comment> getLazyModelComments()
      Getter for the field lazyModelComments.
      Returns:
      the TableDataProvider used for paginated comment listing in the admin interface
    • getPageComments

      public List<Comment> getPageComments()
      getPageComments.
      Returns:
      a list of comments for the current page in the paginated comment list
    • getCurrentCommentGroup

      public CommentGroup getCurrentCommentGroup()

      Getter for the field currentCommentGroup.

      Returns:
      the CommentGroup currently active in the admin interface, or null if none selected
    • setCurrentCommentGroup

      public void setCurrentCommentGroup(CommentGroup currentCommentGroup)

      Setter for the field currentCommentGroup.

      Parameters:
      currentCommentGroup - comment group to set as active and reload the table for
    • getCurrentCommentGroupId

      public Long getCurrentCommentGroupId()
      Returns the ID of currentCommentGroup.
      Returns:
      currentCommentGroup.id
    • setCurrentCommentGroupId

      public void setCurrentCommentGroupId(Long id) throws DAOException
      Sets currentCommentGroup by loading it from the DB via the given ID.
      Parameters:
      id - database ID of the comment group to load
      Throws:
      DAOException
    • getSelectedComment

      public Comment getSelectedComment()
      Getter for the field selectedComment.
      Returns:
      the Comment currently selected for editing or deletion, or null if none selected
    • setSelectedComment

      public void setSelectedComment(Comment selectedComment)
      Setter for the field selectedComment.
      Parameters:
      selectedComment - comment selected for editing or deletion