public class UsersPresenter extends AccountsPresenter<UsersPresenter.MyView,UsersPresenter.MyProxy> implements UsersUIHandlers
Modifier and Type | Class and Description |
---|---|
static interface |
UsersPresenter.MyProxy
Defines the proxy place for GWTP framework.
|
static interface |
UsersPresenter.MyView
This view interface that must be implemented by the concrete view according to GWTP
framework.
|
static class |
UsersPresenter.UsersViewStates
Defines user accounts view states.
|
Modifier and Type | Field and Description |
---|---|
private AdminServiceAsync |
adminService
Administration server interface
|
private FindUserAccount |
findUserAccountManager
The Find User Account manager
|
private com.google.inject.Provider<InputDialog> |
inputDialogProvider
The common input dialogs provider
|
private static boolean[] |
MASK_CENTER
mask definition - center
|
private static boolean[] |
MASK_EAST
mask definition - east
|
private static boolean[] |
MASK_WEST_CENTER
mask definition - west-center
|
static com.gwtplatform.mvp.client.presenter.slots.NestedSlot |
MODAL_CONTENT
The attachment point for modal dialogs on this view
|
private ModalDialogs |
modalDialogsManager
The common modal dialogs manager
|
private UserDef |
selectedUser
The currently selected user
|
private java.util.Set<UserDef> |
selectedUsers
The set of selected users
|
private Alarm |
serverAlarmsManager
The server alarms manager
|
private static boolean[] |
STATE_ALL_GROUPS
state definition - all groups list populated
|
private static boolean[] |
STATE_INITIAL_EMPTY
state definition - initial empty
|
private static boolean[] |
STATE_USER_ADD
state definition - group definition creation
|
private static boolean[] |
STATE_USER_EDIT
state definition - group definition editing
|
private static boolean[] |
STATE_USERS_MULTI
state definition - multiple selection in users list
|
private static boolean[] |
STATE_USERS_SINGLE
state definition - single selection in groups list
|
private static boolean[] |
STATE_USERS_SINGLE_GROUP_SELECTED |
private com.google.inject.Provider<UserAccountDefinition> |
uadProvider
The user account definition provider
|
FILTER, filterExp, logger
BLANK_FIELD_WARNING, CONFIRM_PASSWORD_WARNING, NEW_ACCOUNT_NAME_WARNING
Constructor and Description |
---|
UsersPresenter(com.google.web.bindery.event.shared.EventBus eventBus,
UsersPresenter.MyView view,
UsersPresenter.MyProxy proxy,
com.gwtplatform.mvp.client.proxy.PlaceManager placeManager,
ViewStateMachine viewStateMachine,
AdminServiceAsync adminService,
ModalDialogs modalDialogsManager,
Alarm serverAlarmsManager,
com.google.inject.Provider<UserAccountDefinition> uadProvider,
com.google.inject.Provider<InputDialog> inputDialogProvider,
AccountExtensionHolder acctExtensionHolder,
ACLPopupPresenter aclPopupPresenterProvider)
Defines the Users presenter.
|
Modifier and Type | Method and Description |
---|---|
void |
addUser(UserDef newUser,
java.io.Serializable ext)
Adds a new user.
|
void |
addUserInNewGroup(TaggedName user,
java.lang.String groupName)
Makes a given user account to be a member of a given group account.
|
void |
addUserToGroups(TaggedName user,
TaggedName[] groups)
Makes a given user account to be a member of given groups accounts.
|
void |
cancelAddUserAccountDialog()
Cancels the Add User Account Dialog and rolls back any related changes.
|
void |
cancelCloneUserAccountDialog()
Cancels the Clone User Account Dialog and rolls back any related changes.
|
void |
cancelDeletingUsersAlert()
Cancels the Deleting Users Alert and rolls back any related changes.
|
void |
cancelEditUserAccountDialog()
Cancels the Edit User Account Dialog and rolls back any related changes.
|
void |
cancelFindUserAccountDialog()
Cancels the Find User Account Dialog and rolls back any related changes.
|
void |
cancelRemovingGroupsAlert()
Cancels the Removing Groups Alert and rolls back any related changes.
|
void |
cloneUserAccount(java.lang.String nameFrom,
java.lang.String nameTo,
boolean acls)
Clones the target user account with its ACL if it is required preserving the same password
for a new created account.
|
void |
cloneUserAccount(java.lang.String nameFrom,
java.lang.String nameTo,
boolean acls,
java.lang.String newPassword)
Clones the target user account with its ACL if it is required and having new password.
|
void |
deleteSelectedUsers(TaggedName[] users)
Deletes the given selected users accounts.
|
void |
disableUserAccount(TaggedName user)
Disables the target user account.
|
void |
onGroupSelected(java.util.Set<TaggedName> selectedGroups)
Triggers the groups selection changed event.
|
void |
onRefresh()
Triggers an action to refresh the all users table.
|
protected void |
onReset()
Lifecycle method called on all visible presenters whenever a
presenter is revealed anywhere in the presenter hierarchy.
|
void |
onUserSelected(java.util.Set<TaggedName> users)
Triggers the users selection changed event.
|
void |
populateAndRefreshAllGroups()
Fills and/or updates the all groups accounts table.
|
void |
removeUserFromGroups(TaggedName user,
TaggedName[] groups)
Removes a given user account from given groups accounts.
|
void |
setGroupsFilter(java.lang.String value)
Displays only groups accounts that satisfy the given search criteria.
|
void |
setupCloneUserAccountDialog(TaggedName clonedUserAccount)
Setups the Clone User Account Dialog.
|
void |
setupDeletingUsersAlert(TaggedName[] users)
Setups the Deleting Users Alert.
|
void |
setupFindUserAccountDialog()
Setups the Find User Account Dialog.
|
void |
setupRemovingGroupsAlert(TaggedName user,
TaggedName[] groups)
Setups the Removing Groups Alert for deleting a given user account from selected
groups accounts.
|
void |
showAddUserAccountDialog()
Shows the Add User Account Dialog.
|
void |
showEditUserAccountDialog(TaggedName updatedUserAccount)
Shows the Edit User Account Dialog to edit the target user account.
|
private void |
updateAssignedGroups(TaggedName user)
Retrieves all assigned groups for a given user account and fills the user's group table
model.
|
void |
updateUser(UserDef user,
java.io.Serializable ext)
Updates a given user account.
|
private void |
updateUsersList()
Retrieves the user list and fills the all users table model.
|
private void |
updateUsersList(java.lang.Runnable callback)
Retrieves the user list and fills the all users table model and executes a given command on
getting the user list.
|
setCurrentState, switchToACLs
changeState, restoreState, setState
backTo, clearRequestParameter, getCurrentFilter, getCurrentParameter, getPlaceManager, getQueryParametersMap, getQueryString, getQueryString, setFilter, updateBrowserHistory
bind, forceReveal, getProxy, getRevealType, getSlot, prepareFromRequest, revealInParent, setRevealType, setSlot, unbind, useManualReveal
addHandler, addRegisteredHandler, addToPopupSlot, addToPopupSlot, addToSlot, addToSlot, addVisibleHandler, asWidget, clearSlot, clearSlot, equals, fireEvent, fireEvent, getChild, getChildren, getChildren, getEventBus, getView, hashCode, isVisible, onHide, onReveal, registerVisibleHandler, removeFromParentSlot, removeFromPopupSlot, removeFromSlot, removeFromSlot, setInSlot, setInSlot, setInSlot, setInSlot
isBound, onBind, onUnbind, registerHandler
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
setCurrentState, switchToACLs
private static final boolean[] STATE_INITIAL_EMPTY
private static final boolean[] STATE_USER_ADD
private static final boolean[] STATE_USER_EDIT
private static final boolean[] STATE_USERS_SINGLE
private static final boolean[] STATE_USERS_SINGLE_GROUP_SELECTED
private static final boolean[] STATE_USERS_MULTI
private static final boolean[] STATE_ALL_GROUPS
private static final boolean[] MASK_WEST_CENTER
private static final boolean[] MASK_CENTER
private static final boolean[] MASK_EAST
public static final com.gwtplatform.mvp.client.presenter.slots.NestedSlot MODAL_CONTENT
private final AdminServiceAsync adminService
private final ModalDialogs modalDialogsManager
private final Alarm serverAlarmsManager
private UserDef selectedUser
private final java.util.Set<UserDef> selectedUsers
private final com.google.inject.Provider<UserAccountDefinition> uadProvider
private final com.google.inject.Provider<InputDialog> inputDialogProvider
private final FindUserAccount findUserAccountManager
@Inject public UsersPresenter(com.google.web.bindery.event.shared.EventBus eventBus, UsersPresenter.MyView view, UsersPresenter.MyProxy proxy, com.gwtplatform.mvp.client.proxy.PlaceManager placeManager, @Named(value="UsersViewStateMachine") ViewStateMachine viewStateMachine, AdminServiceAsync adminService, ModalDialogs modalDialogsManager, Alarm serverAlarmsManager, com.google.inject.Provider<UserAccountDefinition> uadProvider, com.google.inject.Provider<InputDialog> inputDialogProvider, AccountExtensionHolder acctExtensionHolder, ACLPopupPresenter aclPopupPresenterProvider)
eventBus
- The event busview
- The associated viewproxy
- The proxy placeplaceManager
- The place managerviewStateMachine
- The view state machineadminService
- The administration servicemodalDialogsManager
- The common modal dialogs managerserverAlarmsManager
- The server alarmsuadProvider
- The user account definition providerinputDialogProvider
- InputDialog provideracctExtensionHolder
- The account extension holderaclPopupPresenterProvider
- The ACL popup presenter providerprotected void onReset()
Important: Make sure you call your superclass onReset()
if
you override. Also, do not call directly, fire a
ResetPresentersEvent
to perform a reset manually.
See PresenterWidget
for more details on lifecycle
methods.
This is one of the most frequently used lifecycle method. This is usually a good place to refresh any information displayed by your presenter.
Note that onReset()
is not called only when using
PresenterWidget.addToSlot(Object, PresenterWidget)
, PresenterWidget.addToPopupSlot(PresenterWidget)
or PresenterWidget.setInSlot(Object, PresenterWidget, boolean)
with false
as the third
parameter.
In a presenter hierarchy, this method is called top-down: first on the parent presenters, then on the children.
onReset
in class com.gwtplatform.mvp.client.PresenterWidget<UsersPresenter.MyView>
public void onRefresh()
onRefresh
in interface UsersUIHandlers
private void updateUsersList()
private void updateUsersList(java.lang.Runnable callback)
callback
- The given command to execute on getting the dataprivate void updateAssignedGroups(TaggedName user)
user
- The user account given by its tagged namepublic void populateAndRefreshAllGroups()
populateAndRefreshAllGroups
in interface UsersUIHandlers
public void showAddUserAccountDialog()
showAddUserAccountDialog
in interface UsersUIHandlers
public void setupDeletingUsersAlert(TaggedName[] users)
setupDeletingUsersAlert
in interface UsersUIHandlers
users
- The array of users accounts given by tagged namespublic void setupCloneUserAccountDialog(TaggedName clonedUserAccount)
setupCloneUserAccountDialog
in interface UsersUIHandlers
clonedUserAccount
- The cloned user account given by its tagged namepublic void showEditUserAccountDialog(TaggedName updatedUserAccount)
showEditUserAccountDialog
in interface UsersUIHandlers
updatedUserAccount
- The target user account given by its tagged namepublic void cancelAddUserAccountDialog()
cancelAddUserAccountDialog
in interface UsersUIHandlers
public void cancelDeletingUsersAlert()
cancelDeletingUsersAlert
in interface UsersUIHandlers
public void cancelCloneUserAccountDialog()
cancelCloneUserAccountDialog
in interface UsersUIHandlers
public void cancelEditUserAccountDialog()
cancelEditUserAccountDialog
in interface UsersUIHandlers
public void deleteSelectedUsers(TaggedName[] users)
deleteSelectedUsers
in interface UsersUIHandlers
users
- The array of users accounts given by tagged namespublic void setupRemovingGroupsAlert(TaggedName user, TaggedName[] groups)
setupRemovingGroupsAlert
in interface UsersUIHandlers
user
- The given user accountgroups
- The selected groups accounts from which the given user is about to be deletedpublic void cloneUserAccount(java.lang.String nameFrom, java.lang.String nameTo, boolean acls)
cloneUserAccount
in interface UsersUIHandlers
nameFrom
- The cloned user account namenameTo
- The new user account nameacls
- True indicates that the ACL of the cloned user will be copied too, otherwise
the ACL of the new created user account will be empty.public void cloneUserAccount(java.lang.String nameFrom, java.lang.String nameTo, boolean acls, java.lang.String newPassword)
cloneUserAccount
in interface UsersUIHandlers
nameFrom
- The cloned user account namenameTo
- The new user account nameacls
- True indicates that the ACL of the cloned user will be copied too, otherwise
the ACL of the new created user account will be empty.newPassword
- The password for the new created accountpublic void onUserSelected(java.util.Set<TaggedName> users)
onUserSelected
in interface UsersUIHandlers
users
- The selected users accountspublic void onGroupSelected(java.util.Set<TaggedName> selectedGroups)
onGroupSelected
in interface UsersUIHandlers
selectedGroups
- The selected groups accountspublic void cancelRemovingGroupsAlert()
cancelRemovingGroupsAlert
in interface UsersUIHandlers
public void addUserInNewGroup(TaggedName user, java.lang.String groupName)
addUserInNewGroup
in interface UsersUIHandlers
user
- The target user account given by its tagged namegroupName
- The target group account namepublic void setGroupsFilter(java.lang.String value)
setGroupsFilter
in interface UsersUIHandlers
value
- The given search criteriapublic void addUser(UserDef newUser, java.io.Serializable ext)
addUser
in interface UsersUIHandlers
newUser
- The new user definitionext
- The extended account data.public void updateUser(UserDef user, java.io.Serializable ext)
updateUser
in interface UsersUIHandlers
user
- The given user definitionext
- The given extended account datapublic void cancelFindUserAccountDialog()
cancelFindUserAccountDialog
in interface UsersUIHandlers
public void setupFindUserAccountDialog()
setupFindUserAccountDialog
in interface UsersUIHandlers
public void disableUserAccount(TaggedName user)
disableUserAccount
in interface UsersUIHandlers
user
- The target user account given by its tagged namepublic void removeUserFromGroups(TaggedName user, TaggedName[] groups)
removeUserFromGroups
in interface UsersUIHandlers
user
- The target user account given by its tagged namegroups
- The array of target groups accounts given by tagged namespublic void addUserToGroups(TaggedName user, TaggedName[] groups)
addUserToGroups
in interface UsersUIHandlers
user
- The target user account given by its tagged namegroups
- The array of target groups accounts given by tagged names