Class UserDataBean

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

@Named @ViewScoped public class UserDataBean extends Object implements Serializable
JSF backing bean providing user profile management and account settings for authenticated users.
See Also:
  • Constructor Details

    • UserDataBean

      public UserDataBean()
  • Method Details

    • setBreadcrumbBean

      public void setBreadcrumbBean(UserBean userBean)
      Required setter for ManagedProperty injection.
      Parameters:
      userBean - the UserBean instance to inject for testing
    • init

      @PostConstruct public void init() throws DAOException
      Initializes all campaigns as lazily loaded list.
      Throws:
      DAOException
    • getSearches

      public List<Search> getSearches(User user, Integer numEntries) throws DAOException
      Returns saved searches for the logged in user.
      Parameters:
      user - owner of the saved searches to retrieve
      numEntries - maximum number of results; null means no limit
      Returns:
      a list of saved searches for the given user, sorted by last update date descending
      Throws:
      DAOException - if any.
    • getAnnotations

      public List<CrowdsourcingAnnotation> getAnnotations() throws DAOException

      getAnnotations.

      Returns:
      List of annotations for the logged in user
      Throws:
      DAOException
    • deleteSearchAction

      public String deleteSearchAction(Search search) throws DAOException
      Deletes the given persistent user search.
      Parameters:
      search - saved search query to delete
      Returns:
      empty navigation outcome string
      Throws:
      DAOException - if any.
    • getLazyModelAnnotations

      public TableDataProvider<PersistentAnnotation> getLazyModelAnnotations()
      Getter for the field lazyModelAnnotations.
      Returns:
      the lazy-loading table data provider for the current user's annotations
    • getLazyModelComments

      public TableDataProvider<PersistentAnnotation> getLazyModelComments()

      Getter for the field lazyModelComments.

      Returns:
      the TableDataProvider for the user's comment history
    • getNumBookmarkLists

      public long getNumBookmarkLists(User user) throws DAOException

      getNumBookmarkLists.

      Parameters:
      user - owner whose bookmark lists are counted
      Returns:
      the total number of bookmark lists owned by the given user
      Throws:
      DAOException - if any.
    • getNumSearches

      public long getNumSearches(User user) throws DAOException

      getNumSearches.

      Parameters:
      user - owner whose saved searches are counted
      Returns:
      the total number of saved searches belonging to the given user
      Throws:
      DAOException - if any.
    • getNumComments

      public long getNumComments(User user) throws DAOException

      getNumComments.

      Parameters:
      user - owner whose comments are counted
      Returns:
      Number of comments in the DB for the given user
      Throws:
      DAOException
    • getNumAnnotations

      public long getNumAnnotations(User user) throws DAOException

      getNumAnnotations.

      Parameters:
      user - creator whose crowdsourcing annotations are counted
      Returns:
      the total number of crowdsourcing annotations created by the given user
      Throws:
      DAOException - if any.
    • getNumRecordsWithComments

      public Long getNumRecordsWithComments(User user) throws DAOException

      getNumRecordsWithComments.

      Parameters:
      user - owner whose commented records are counted
      Returns:
      the number of distinct records with comments for the given user
      Throws:
      DAOException - if any.
    • getAnnotationCount

      public long getAnnotationCount() throws DAOException

      getAnnotationCount.

      Returns:
      the total number of annotations created by the currently logged-in user, or 0 if no user is logged in
      Throws:
      DAOException - if any.
    • getCommentCount

      public long getCommentCount() throws DAOException

      Getter for the field commentCount.

      Returns:
      the total number of comments created by the currently logged-in user
      Throws:
      DAOException - if any.
    • getLatestComments

      public List<Comment> getLatestComments(User user, int numEntries) throws DAOException

      getLatestComments.

      Parameters:
      user - owner whose comments to retrieve
      numEntries - maximum number of comments to return
      Returns:
      List of comments for the given user
      Throws:
      DAOException
    • getBookmarkListsForUser

      public List<BookmarkList> getBookmarkListsForUser(User user, int numEntries) throws DAOException

      getBookmarkListsForUser.

      Parameters:
      user - owner whose bookmark lists are retrieved
      numEntries - maximum number of lists to return
      Returns:
      a list of bookmark lists owned by the given user, sorted and limited to the specified count
      Throws:
      DAOException - if any.
    • getLatestActivity

      public List<UserActivity> getLatestActivity(User user, int numEntries) throws DAOException

      getLatestActivity.

      Parameters:
      user - user whose recent activity is retrieved
      numEntries - maximum number of activity entries to return
      Returns:
      a list of recent user activity entries (searches, bookmarks, comments) for the given user
      Throws:
      DAOException - if any.