Class BookmarkBean

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

@Named @SessionScoped public class BookmarkBean extends Object implements Serializable

BookmarkBean class.

See Also:
  • Constructor Details

    • BookmarkBean

      public BookmarkBean()
      Empty Constructor.
  • Method Details

    • init

      @PostConstruct public void init()

      init.

    • cancelEditCurrentBookmarkListAction

      public String cancelEditCurrentBookmarkListAction()
      Resets the current bookmark list and returns to the overview of own bookmark lists.
      Returns:
      a String object.
    • saveCurrentBookmarkListAction

      public String saveCurrentBookmarkListAction()
      Updates the currently selected bookmark list if it already in the user's list of bookmark lists, adds it to the list otherwise. Saves DataManager in both cases.
      Returns:
      a String object.
    • deleteCurrentBookmarkListAction

      public String deleteCurrentBookmarkListAction()
      Deletes currentBookmarkList.
      Returns:
      a String object.
    • unshareCurrentBookmarkListAction

      public void unshareCurrentBookmarkListAction()
      Removes currentUserGroup from the shares list of currentBookmarkList.
    • resetCurrentBookmarkListAction

      public void resetCurrentBookmarkListAction()
      Sets currentBookmarkList to a new object.
    • prepareItemForBookmarkList

      public void prepareItemForBookmarkList() throws IndexUnreachableException

      prepareItemForBookmarkList.

      Throws:
      IndexUnreachableException - if any.
    • saveCurrentBookmarkAction

      public String saveCurrentBookmarkAction()
      Updates the currently selected Bookmark if it is already part of the current BookmarkList, otherwise adds a new Bookmark. Saves DataManager in both cases.
      Returns:
      a String object.
    • deleteCurrentItemAction

      public void deleteCurrentItemAction(Bookmark bookmark)
      Removes the currently selected Bookmark from the currently selected BookmarkList.
      Parameters:
      bookmark - a Bookmark object.
    • getRemainingUserGroupNames

      public List<String> getRemainingUserGroupNames() throws DAOException
      Returns the names all existing user groups (minus the ones currentBookmarkList is already shared with). TODO Filter some user groups, if required (e.g. admins)
      Returns:
      a List object.
      Throws:
      DAOException - if any.
    • getPublicBookmarkLists

      public List<BookmarkList> getPublicBookmarkLists() throws DAOException
      Returns a list of all existing bookmark list that are marked public.
      Returns:
      a List object.
      Throws:
      DAOException - if any.
    • getBookmarkListsSharedWithUser

      public static List<BookmarkList> getBookmarkListsSharedWithUser(User user) throws DAOException

      getBookmarkListsSharedWithUser.

      Parameters:
      user - a User object.
      Returns:
      a List object.
      Throws:
      DAOException - if any.
    • getBookmarkLists

      public List<BookmarkList> getBookmarkLists() throws DAOException
      Returns a list of all existing bookmark lists owned by current user
      Returns:
      a List object.
      Throws:
      DAOException - if any.
    • getBookmarkListsForUser

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

      getBookmarkListsForUser.

      Parameters:
      user - a User object.
      Returns:
      a List object.
      Throws:
      DAOException - if any.
    • selectBookmarkListAction

      public void selectBookmarkListAction(javax.faces.event.ValueChangeEvent event) throws DAOException

      selectBookmarkListAction.

      Parameters:
      event - a ValueChangeEvent object.
      Throws:
      DAOException - if any.
    • isNewBookmarkList

      public boolean isNewBookmarkList()

      isNewBookmarkList.

      Returns:
      a boolean.
    • createNewBookmarkListAction

      public String createNewBookmarkListAction()

      createNewBookmarkListAction.

      Returns:
      a String object.
    • userGroupSelectedAction

      public void userGroupSelectedAction(javax.faces.event.ValueChangeEvent event) throws DAOException

      userGroupSelectedAction.

      Parameters:
      event - ValueChangeEvent
      Throws:
      DAOException - if any.
    • validateName

      public void validateName(javax.faces.context.FacesContext context, javax.faces.component.UIComponent toValidate, Object value) throws javax.faces.validator.ValidatorException, DAOException

      validateName.

      Parameters:
      context - a FacesContext object.
      toValidate - a UIComponent object.
      value - a Object object.
      Throws:
      javax.faces.validator.ValidatorException - if any.
      DAOException - if any.
    • isCurrentBookmarkListMine

      public boolean isCurrentBookmarkListMine()

      isCurrentBookmarkListMine.

      Returns:
      a boolean.
    • getCurrentBookmarkList

      public BookmarkList getCurrentBookmarkList()

      Getter for the field currentBookmarkList.

      Returns:
      the currentBookmarkList
    • isCurrentBookmarkListShared

      public boolean isCurrentBookmarkListShared()

      isCurrentBookmarkListShared.

      Returns:
      true if currentBookmarkListSharedKey matches the shared key value of currentBookmarkList; false otherwise;
    • getCurrentBookmarkListNames

      public List<String> getCurrentBookmarkListNames() throws DAOException

      getCurrentBookmarkListNames.

      Returns:
      a List object.
      Throws:
      DAOException - if any.
    • setCurrentBookmarkList

      public void setCurrentBookmarkList(BookmarkList currentBookmarkList)

      Setter for the field currentBookmarkList.

      Parameters:
      currentBookmarkList - the currentBookmarkList to set
    • getCurrentBookmarkListId

      public String getCurrentBookmarkListId()

      getCurrentBookmarkListId.

      Returns:
      Identifier of currentBookmarkList; null if none loaded
    • setCurrentBookmarkListId

      public void setCurrentBookmarkListId(String bookmarkListId) throws PresentationException, DAOException

      setCurrentBookmarkListId.

      Parameters:
      bookmarkListId - a String object.
      Throws:
      PresentationException - if any.
      DAOException - if any.
    • viewBookmarkListAction

      public String viewBookmarkListAction(BookmarkList bookmarkList)

      viewBookmarkListAction.

      Parameters:
      bookmarkList - a BookmarkList object.
      Returns:
      a String object.
    • editBookmarkListAction

      public String editBookmarkListAction(BookmarkList bookmarkList)

      editBookmarkListAction.

      Parameters:
      bookmarkList - a BookmarkList object.
      Returns:
      a String object.
    • getCurrentBookmark

      public Bookmark getCurrentBookmark()

      Getter for the field currentBookmark.

      Returns:
      the currentBookmark
    • setCurrentBookmark

      public void setCurrentBookmark(Bookmark currentBookmark)

      Setter for the field currentBookmark.

      Parameters:
      currentBookmark - the currentBookmark to set
    • getCurrentUserGroup

      public UserGroup getCurrentUserGroup()

      Getter for the field currentUserGroup.

      Returns:
      the currentUserGroup
    • setCurrentUserGroup

      public void setCurrentUserGroup(UserGroup currentUserGroup)

      Setter for the field currentUserGroup.

      Parameters:
      currentUserGroup - the currentUserGroup to set
    • setSessionBookmarkListEmail

      public void setSessionBookmarkListEmail(String sessionBookmarkListEmail)

      Setter for the field sessionBookmarkListEmail.

      Parameters:
      sessionBookmarkListEmail - the sessionBookmarkListEmail to set
    • getSessionBookmarkListEmail

      public String getSessionBookmarkListEmail()

      Getter for the field sessionBookmarkListEmail.

      Returns:
      the sessionBookmarkListEmail
    • getCurrentBookmarkListKey

      public String getCurrentBookmarkListKey()
    • setCurrentBookmarkListKey

      public void setCurrentBookmarkListKey(String key) throws PresentationException, DAOException
      Throws:
      PresentationException
      DAOException
    • getShareLink

      public String getShareLink(BookmarkList bookmarkList)

      getShareLink.

      Parameters:
      bookmarkList - a BookmarkList object.
      Returns:
      Absolute share URLto the given bookmark list
    • resetShareLink

      public void resetShareLink(BookmarkList bookmarkList)
    • setPublic

      public void setPublic(BookmarkList bookmarkList, boolean isPublic)
    • getShareKey

      public String getShareKey()

      getShareKey.

      Returns:
      a String object.
    • setShareKey

      public void setShareKey(String key) throws DAOException

      setShareKey.

      Parameters:
      key - a String object.
      Throws:
      DAOException - if any.
    • sendSessionBookmarkListAsMail

      public void sendSessionBookmarkListAsMail()

      sendSessionBookmarkListAsMail.

    • countSessionBookmarkListItems

      public int countSessionBookmarkListItems()

      countSessionBookmarkListItems.

      Returns:
      Size of items in the session bookmark list
    • getNewBookmarkListName

      public String getNewBookmarkListName()
      Returns:
      the newBookmarkName
    • setNewBookmarkListName

      public void setNewBookmarkListName(String newBookmarkListName)
      Parameters:
      newBookmarkListName - the newBookmarkListName to set
    • addBookmarkList

      public void addBookmarkList()