Package io.goobi.viewer.managedbeans
Class UserGroupBean
- java.lang.Object
-
- io.goobi.viewer.managedbeans.UserGroupBean
-
- All Implemented Interfaces:
Serializable
@Named @SessionScoped public class UserGroupBean extends Object implements Serializable
UserGroupBean class.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UserGroupBean()
Empty constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
deleteCurrentUserGroupAction()
Deletes currentUserGroup.List<Role>
getAllRoles()
Returns a list of all existing roles (minus superuser).Long
getCurrentId()
Used for the 'add member' selectbox.User
getCurrentMember()
Getter for the fieldcurrentMember
.UserGroup
getCurrentOtherUserGroup()
Getter for the fieldcurrentOtherUserGroup
.UserGroup
getCurrentOwnUserGroup()
Getter for the fieldcurrentOwnUserGroup
.int
getCurrentOwnUserGroupId()
Getter for the fieldcurrentOwnUserGroupId
.Role
getCurrentRole()
Getter for the fieldcurrentRole
.List<javax.faces.model.SelectItem>
getRemainingUsers()
Returns the names all users that are not already members of the currently selected user group.void
init()
init.boolean
isNewUserGroup()
isNewUserGroup.void
leaveCurrentUserGroupAction()
Revokes the current user's membership in currentOtherUserGroup.void
memberSelectedAction(javax.faces.event.ValueChangeEvent event)
memberSelectedAction.void
removeCurrentMemberAction()
Removes currentMember from the member list of currentUserGroup.void
resetCurrentUserGroupAction()
Sets currentUserGroup to a new object.void
saveCurrentOwnUserGroupAction(javax.faces.event.ActionEvent actionEvent)
Creates or updates (if already exists) currentOwnUserGroup.void
saveMembershipAction()
Deprecated.void
setCurrentId(Long id)
Used for the 'add member' selectbox.void
setCurrentMember(User currentMember)
Setter for the fieldcurrentMember
.void
setCurrentOtherUserGroup(UserGroup currentOtherUserGroup)
Setter for the fieldcurrentOtherUserGroup
.void
setCurrentOwnUserGroup()
Setter for the fieldcurrentOwnUserGroup
.void
setCurrentOwnUserGroup(UserGroup currentOwnUserGroup)
Setter for the fieldcurrentOwnUserGroup
.void
setCurrentOwnUserGroupId(int currentOwnUserGroupId)
Setter for the fieldcurrentOwnUserGroupId
.void
setCurrentRole(Role currentRole)
Setter for the fieldcurrentRole
.
-
-
-
Method Detail
-
init
@PostConstruct public void init()
init.
-
saveCurrentOwnUserGroupAction
public void saveCurrentOwnUserGroupAction(javax.faces.event.ActionEvent actionEvent) throws DAOException
Creates or updates (if already exists) currentOwnUserGroup.- Parameters:
actionEvent
- aActionEvent
object.- 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.
-
saveMembershipAction
@Deprecated public void saveMembershipAction() throws DAOException
Deprecated.Add currentMember to the member list of currentOwnUserGroup.- Throws:
DAOException
- if any.
-
removeCurrentMemberAction
public void removeCurrentMemberAction() throws DAOException
Removes currentMember from the member list of currentUserGroup.- Throws:
DAOException
- if any.
-
getRemainingUsers
public List<javax.faces.model.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
object. - Throws:
DAOException
- if any.
-
memberSelectedAction
public void memberSelectedAction(javax.faces.event.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
object. - Throws:
DAOException
- if any.
-
getCurrentOtherUserGroup
public UserGroup getCurrentOtherUserGroup()
Getter for the field
currentOtherUserGroup
.- Returns:
- the currentOtherUserGroup
-
setCurrentOtherUserGroup
public void setCurrentOtherUserGroup(UserGroup currentOtherUserGroup)
Setter for the field
currentOtherUserGroup
.- Parameters:
currentOtherUserGroup
- the currentOtherUserGroup to set
-
getCurrentOwnUserGroupId
public int getCurrentOwnUserGroupId()
Getter for the field
currentOwnUserGroupId
.- Returns:
- the currentOwnUserGroupId
-
setCurrentOwnUserGroupId
public void setCurrentOwnUserGroupId(int currentOwnUserGroupId)
Setter for the field
currentOwnUserGroupId
.- Parameters:
currentOwnUserGroupId
- the currentOwnUserGroupId to set
-
getCurrentOwnUserGroup
public UserGroup getCurrentOwnUserGroup()
Getter for the field
currentOwnUserGroup
.- Returns:
- the currentOwnUserGroup
-
setCurrentOwnUserGroup
public void setCurrentOwnUserGroup(UserGroup currentOwnUserGroup)
Setter for the field
currentOwnUserGroup
.- Parameters:
currentOwnUserGroup
- the currentOwnUserGroup to set
-
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 currentMember
-
setCurrentMember
public void setCurrentMember(User currentMember)
Setter for the field
currentMember
.- Parameters:
currentMember
- the currentMember to set
-
getCurrentRole
public Role getCurrentRole()
Getter for the field
currentRole
.- Returns:
- the currentRole
-
setCurrentRole
public void setCurrentRole(Role currentRole)
Setter for the field
currentRole
.- Parameters:
currentRole
- the currentRole to set
-
getCurrentId
public Long getCurrentId()
Used for the 'add member' selectbox.- Returns:
- a
Long
object.
-
setCurrentId
public void setCurrentId(Long id) throws DAOException
Used for the 'add member' selectbox.- Parameters:
id
- aLong
object.- Throws:
DAOException
- if any.
-
isNewUserGroup
public boolean isNewUserGroup()
isNewUserGroup.
- Returns:
- a boolean.
-
-