public class GroupsPresenter extends AccountsPresenter<GroupsPresenter.MyView,GroupsPresenter.MyProxy> implements GroupsUIHandlers
Modifier and Type | Class and Description |
---|---|
static class |
GroupsPresenter.GroupsViewStates
Defines the Group Accounts View states
|
static interface |
GroupsPresenter.MyProxy
Defines the proxy place for GWTP framework.
|
static interface |
GroupsPresenter.MyView
This view interface that must be implemented by the concrete view according to GWTP
framework.
|
Modifier and Type | Field and Description |
---|---|
private AdminServiceAsync |
adminService
Administration server interface
|
private static boolean[] |
MASK_CENTER
mask definition - center
|
private static boolean[] |
MASK_CENTER_TOP
mask definition - center top
|
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 GroupDef |
selectedGroup
The currently selected group
|
private java.util.Set<GroupDef> |
selectedGroups
The set of selected groups definitions
|
private Alarm |
serverAlarmsManager
The server alarms manager
|
private static boolean[] |
STATE_ALL_USERS
state definition - all users list populated
|
private static boolean[] |
STATE_GROUP_ADD
state definition - group definition creation
|
private static boolean[] |
STATE_GROUP_EDIT
state definition - group definition editing
|
private static boolean[] |
STATE_GROUPS_MULTI
state definition - multiple selection in groups list
|
private static boolean[] |
STATE_GROUPS_SINGLE
state definition - single selection in groups list
|
private static boolean[] |
STATE_GROUPS_SINGLE_USER_SELECTED
A single user selected state
|
private static boolean[] |
STATE_INITIAL_EMPTY
state definition - initial empty
|
FILTER, filterExp, logger
BLANK_FIELD_WARNING, CONFIRM_PASSWORD_WARNING, NEW_ACCOUNT_NAME_WARNING
Constructor and Description |
---|
GroupsPresenter(com.google.web.bindery.event.shared.EventBus eventBus,
GroupsPresenter.MyView view,
GroupsPresenter.MyProxy proxy,
com.gwtplatform.mvp.client.proxy.PlaceManager placeManager,
ViewStateMachine viewStateMachine,
AdminServiceAsync adminService,
ModalDialogs modalDialogsManager,
Alarm serverAlarmsManager,
ACLPopupPresenter aclPopupPresenter)
Defines the Groups presenter.
|
Modifier and Type | Method and Description |
---|---|
void |
addGroup(GroupDef newGroup)
Adds new group to the group accounts represented by the all groups table.
|
void |
addUsersToGroup(TaggedName group,
java.util.Set<TaggedName> selectedUsers)
Adds the selected users to the given group.
|
void |
addUserToGroup(TaggedName group,
java.lang.String user)
Adds a user to the given group.
|
void |
cancelAddGroupDialog()
Cancels the Add Group Dialog.
|
void |
cancelCloneGroupDialog()
Cancels the Clone Group Dialog.
|
void |
cancelDeletingGroupsAlert()
Cancels the Deleting Groups Alert dialog.
|
void |
cancelEditGroupDialog()
Cancels the Edit Group Dialog.
|
void |
cancelUnassigningUsersAlert()
Defines the method that is invoked if the Unassigning Users Alert has been cancelled.
|
void |
cloneGroup(java.lang.String nameFrom,
java.lang.String nameTo,
boolean acls)
Clones the given group by creating the new one.
|
void |
deleteSelectedGroups(TaggedName[] groups)
Delete selected groups given by the array of group tagged names
|
void |
onGroupSelected(java.util.Set<TaggedName> groups)
Triggers the groups selection changed.
|
void |
onRefresh()
Performs the user action to refresh the all groups table.
|
void |
onUserSelected(java.util.Set<TaggedName> selectedUsers)
Triggers the users selection changed.
|
void |
populateAndRefreshAllUsers()
Populates the all users table if it has been empty or updates its rows with the current data.
|
void |
prepareFromRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest request)
Loads the data before the associated view will be displayed.
|
void |
setupAddGroupDialog()
Setups the Add Group Dialog.
|
void |
setupCloneGroupDialog(TaggedName clonedGroup)
Setups the Clone Group Dialog.
|
void |
setupDeletingGroupsAlert(TaggedName[] groups)
Setups the Deleting Groups Alert dialog.
|
void |
setupEditGroupDialog(TaggedName updatedGroup)
Setups the Edit Group Dialog.
|
void |
setupUnassigningUsersAlert(TaggedName group,
TaggedName[] users)
Setups the Unassigning Users Alert dialog.
|
void |
setUsersFilter(java.lang.String value)
Sets the target user search template.
|
void |
unassignSelectedUsers(TaggedName group,
TaggedName[] users)
Removes the selected users from the given group.
|
void |
updateCustomAuthPlugins()
Retrieves the custom authentication plugins data and fills the custom authentication plugins
combobox.
|
void |
updateGroup(GroupDef updatedGroup)
Commits changes in the target group definition.
|
private void |
updateGroupsList(java.lang.Runnable command)
Requests the groups from the server asynchronously and then updates the All Groups grid with
actual values and executes the given command after getting the server response.
|
private void |
updateUsersInGroup(TaggedName group)
Requests the users that belongs to the given group asynchronously and then updates the
Group Users grid with actual values after getting the server response.
|
setCurrentState, switchToACLs
changeState, restoreState, setState
backTo, clearRequestParameter, getCurrentFilter, getCurrentParameter, getPlaceManager, getQueryParametersMap, getQueryString, getQueryString, setFilter, updateBrowserHistory
bind, forceReveal, getProxy, getRevealType, getSlot, 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, onReset, 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_GROUP_ADD
private static final boolean[] STATE_GROUP_EDIT
private static final boolean[] STATE_GROUPS_SINGLE
private static final boolean[] STATE_GROUPS_SINGLE_USER_SELECTED
private static final boolean[] STATE_GROUPS_MULTI
private static final boolean[] STATE_ALL_USERS
private static final boolean[] MASK_WEST_CENTER
private static final boolean[] MASK_CENTER
private static final boolean[] MASK_CENTER_TOP
private static final boolean[] MASK_EAST
public static final com.gwtplatform.mvp.client.presenter.slots.NestedSlot MODAL_CONTENT
private final AdminServiceAsync adminService
private final java.util.Set<GroupDef> selectedGroups
private GroupDef selectedGroup
private final ModalDialogs modalDialogsManager
private final Alarm serverAlarmsManager
@Inject public GroupsPresenter(com.google.web.bindery.event.shared.EventBus eventBus, GroupsPresenter.MyView view, GroupsPresenter.MyProxy proxy, com.gwtplatform.mvp.client.proxy.PlaceManager placeManager, @Named(value="GroupsViewStateMachine") ViewStateMachine viewStateMachine, AdminServiceAsync adminService, ModalDialogs modalDialogsManager, Alarm serverAlarmsManager, ACLPopupPresenter aclPopupPresenter)
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 alarmspublic void prepareFromRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest request)
prepareFromRequest
in class com.gwtplatform.mvp.client.Presenter<GroupsPresenter.MyView,GroupsPresenter.MyProxy>
request
- The current requestpublic void onRefresh()
onRefresh
in interface GroupsUIHandlers
private void updateGroupsList(java.lang.Runnable command)
command
- The given command to executeprivate void updateUsersInGroup(TaggedName group)
group
- The group given by its tagged namepublic void populateAndRefreshAllUsers()
populateAndRefreshAllUsers
in interface GroupsUIHandlers
public void updateCustomAuthPlugins()
updateCustomAuthPlugins
in interface GroupsUIHandlers
public void setupAddGroupDialog()
setupAddGroupDialog
in interface GroupsUIHandlers
public void setupDeletingGroupsAlert(TaggedName[] groups)
setupDeletingGroupsAlert
in interface GroupsUIHandlers
groups
- The array of the selected groups to deletepublic void setupCloneGroupDialog(TaggedName clonedGroup)
setupCloneGroupDialog
in interface GroupsUIHandlers
clonedGroup
- The target group to clonepublic void setupEditGroupDialog(TaggedName updatedGroup)
setupEditGroupDialog
in interface GroupsUIHandlers
updatedGroup
- The group definition to editpublic void cancelAddGroupDialog()
cancelAddGroupDialog
in interface GroupsUIHandlers
public void cancelDeletingGroupsAlert()
cancelDeletingGroupsAlert
in interface GroupsUIHandlers
public void cancelCloneGroupDialog()
cancelCloneGroupDialog
in interface GroupsUIHandlers
public void cancelEditGroupDialog()
cancelEditGroupDialog
in interface GroupsUIHandlers
public void addGroup(GroupDef newGroup)
addGroup
in interface GroupsUIHandlers
newGroup
- The new group definition object representing the new adding grouppublic void deleteSelectedGroups(TaggedName[] groups)
deleteSelectedGroups
in interface GroupsUIHandlers
groups
- The array of groups to deletepublic void unassignSelectedUsers(TaggedName group, TaggedName[] users)
unassignSelectedUsers
in interface GroupsUIHandlers
group
- The group tagged nameusers
- The array of selected users given by their tagged namespublic void setupUnassigningUsersAlert(TaggedName group, TaggedName[] users)
setupUnassigningUsersAlert
in interface GroupsUIHandlers
group
- The group tagged nameusers
- The array of selected users given by their tagged namespublic void cloneGroup(java.lang.String nameFrom, java.lang.String nameTo, boolean acls)
cloneGroup
in interface GroupsUIHandlers
nameFrom
- The name of the group to clonenameTo
- The name for the new cloned groupacls
- True indicates that the ACL of target group will be cloned too, otherwise
the ACL of the new created group will be empty.public void updateGroup(GroupDef updatedGroup)
updateGroup
in interface GroupsUIHandlers
updatedGroup
- The group definition to commit its changespublic void onGroupSelected(java.util.Set<TaggedName> groups)
onGroupSelected
in interface GroupsUIHandlers
groups
- The new set of selected groupspublic void onUserSelected(java.util.Set<TaggedName> selectedUsers)
onUserSelected
in interface GroupsUIHandlers
selectedUsers
- The new set of selected userspublic void cancelUnassigningUsersAlert()
cancelUnassigningUsersAlert
in interface GroupsUIHandlers
public void addUserToGroup(TaggedName group, java.lang.String user)
addUserToGroup
in interface GroupsUIHandlers
group
- The group tagged nameuser
- The user account namepublic void setUsersFilter(java.lang.String value)
setUsersFilter
in interface GroupsUIHandlers
value
- The target search templatepublic void addUsersToGroup(TaggedName group, java.util.Set<TaggedName> selectedUsers)
addUsersToGroup
in interface GroupsUIHandlers
group
- The group tagged nameselectedUsers
- The array of selected users given by their tagged names