Class UserGroupBean

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

@Named @SessionScoped public class UserGroupBean extends Object implements Serializable
JSF backing bean for managing user groups and their members in the admin interface.
See Also:
  • Constructor Details

    • UserGroupBean

      public UserGroupBean()
      Empty constructor.
  • Method Details

    • init

      @PostConstruct public void init()
      init.
    • saveCurrentOwnUserGroupAction

      public void saveCurrentOwnUserGroupAction(ActionEvent actionEvent) throws DAOException
      Creates or updates (if already exists) currentOwnUserGroup.
      Parameters:
      actionEvent - JSF action event triggering the save
      Throws:
      DAOException - if any.
    • deleteCurrentUserGroupAction

      public void deleteCurrentUserGroupAction() throws DAOException
      Deletes currentUserGroup. TODO Some sort of confirmation dialog
      Throws:
      DAOException - if any.
    • leaveCurrentUserGroupAction

      public void leaveCurrentUserGroupAction() throws DAOException
      Revokes the current user's membership in currentOtherUserGroup. TODO Some sort of confirmation dialog
      Throws:
      DAOException - if any.
    • resetCurrentUserGroupAction

      public final void resetCurrentUserGroupAction()
      Sets currentUserGroup to a new object.
    • removeCurrentMemberAction

      public void removeCurrentMemberAction() throws DAOException
      Removes currentMember from the member list of currentUserGroup.
      Throws:
      DAOException - if any.
    • getRemainingUsers

      public List<SelectItem> getRemainingUsers() throws DAOException
      Returns the names all users that are not already members of the currently selected user group. TODO Filter some user groups, if required (e.g.

      admins)

      Returns:
      a list of select items representing users not yet members of the current user group
      Throws:
      DAOException - if any.
    • memberSelectedAction

      public void memberSelectedAction(ValueChangeEvent event)
      memberSelectedAction.
      Parameters:
      event - ValueChangeEvent
    • getAllRoles

      public List<Role> getAllRoles() throws DAOException
      Returns a list of all existing roles (minus superuser).
      Returns:
      a list of all roles in the database excluding the superuser role
      Throws:
      DAOException - if any.
    • getCurrentOtherUserGroup

      public UserGroup getCurrentOtherUserGroup()
      Getter for the field currentOtherUserGroup.
      Returns:
      the user group the current user may join or leave
    • setCurrentOtherUserGroup

      public void setCurrentOtherUserGroup(UserGroup currentOtherUserGroup)
      Setter for the field currentOtherUserGroup.
      Parameters:
      currentOtherUserGroup - user group the current user may join or leave
    • getCurrentOwnUserGroupId

      public int getCurrentOwnUserGroupId()
      Getter for the field currentOwnUserGroupId.
      Returns:
      the database ID of the user group owned by the current user that is currently selected
    • setCurrentOwnUserGroupId

      public void setCurrentOwnUserGroupId(int currentOwnUserGroupId)
      Setter for the field currentOwnUserGroupId.
      Parameters:
      currentOwnUserGroupId - database ID of the group to select
    • getCurrentOwnUserGroup

      public UserGroup getCurrentOwnUserGroup()
      Getter for the field currentOwnUserGroup.
      Returns:
      the user group owned by the current user that is currently selected for editing
    • setCurrentOwnUserGroup

      public void setCurrentOwnUserGroup(UserGroup currentOwnUserGroup)
      Setter for the field currentOwnUserGroup.
      Parameters:
      currentOwnUserGroup - user group owned by the current user to edit
    • setCurrentOwnUserGroup

      public void setCurrentOwnUserGroup() throws DAOException
      Setter for the field currentOwnUserGroup.
      Throws:
      DAOException - if any.
    • getCurrentMember

      public User getCurrentMember()
      Getter for the field currentMember.
      Returns:
      the group member currently selected for removal
    • setCurrentMember

      public void setCurrentMember(User currentMember)
      Setter for the field currentMember.
      Parameters:
      currentMember - group member selected for removal
    • getCurrentRole

      public Role getCurrentRole()
      Getter for the field currentRole.
      Returns:
      the role to assign to the selected group member
    • setCurrentRole

      public void setCurrentRole(Role currentRole)
      Setter for the field currentRole.
      Parameters:
      currentRole - role to assign to the selected member
    • getCurrentId

      public Long getCurrentId()
      Used for the 'add member' selectbox.
      Returns:
      always -1L, used as a sentinel value for the member selection UI
    • setCurrentId

      public void setCurrentId(Long id) throws DAOException
      Used for the 'add member' selectbox.
      Parameters:
      id - database ID of the user to add as member
      Throws:
      DAOException - if any.
    • isNewUserGroup

      public boolean isNewUserGroup()
      isNewUserGroup.
      Returns:
      true if the current user group has not yet been saved (i.e. has no name assigned), false otherwise