CCM NG: Some JavaDoc for the classees providing the admin UI for users, groups and roles.
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4020 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
87b46a531e
commit
19cdc820a8
|
|
@ -40,7 +40,14 @@ import java.util.ArrayList;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Root component of the administration UI for users, groups and roles.
|
||||
* This class creates the menu on the left side and connects the menu with the
|
||||
* specific UIs for users, groups and roles.
|
||||
*
|
||||
* @see UserAdmin
|
||||
* @see GroupAdmin
|
||||
* @see RoleAdmin
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class UsersGroupsRolesTab extends LayoutPanel {
|
||||
|
|
@ -63,15 +70,6 @@ public class UsersGroupsRolesTab extends LayoutPanel {
|
|||
});
|
||||
sections.setClassAttr("navbar");
|
||||
|
||||
// final BoxPanel usersPanel = new BoxPanel();
|
||||
// usersPanel.add(new Label("Users Panel"));
|
||||
|
||||
// final BoxPanel groupsPanel = new BoxPanel();
|
||||
// groupsPanel.add(new Label("Groups Panel"));
|
||||
|
||||
// final BoxPanel rolesPanel = new BoxPanel();
|
||||
// rolesPanel.add(new Label("Roles Panel"));
|
||||
|
||||
final BoxPanel body = new BoxPanel();
|
||||
addSection(
|
||||
new Label(new GlobalizedMessage(
|
||||
|
|
@ -96,6 +94,13 @@ public class UsersGroupsRolesTab extends LayoutPanel {
|
|||
setBody(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for adding a section
|
||||
*
|
||||
* @param label The label of the section.
|
||||
* @param component The component which provides the section.
|
||||
* @param panel The panel to which the component is added.
|
||||
*/
|
||||
private void addSection(final Label label,
|
||||
final Component component,
|
||||
final BoxPanel panel) {
|
||||
|
|
@ -105,17 +110,25 @@ public class UsersGroupsRolesTab extends LayoutPanel {
|
|||
panel.add(component);
|
||||
keys.add(label);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register the components in the page
|
||||
*
|
||||
* @param page The Admin UI page.
|
||||
*/
|
||||
@Override
|
||||
public void register(final Page page) {
|
||||
Assert.isUnlocked(this);
|
||||
|
||||
components.forEach(c -> page.setVisibleDefault(c, false));
|
||||
//page.setVisibleDefault(components.get(0), true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the current section.
|
||||
*
|
||||
* @param index The index of the section.
|
||||
* @param state The page state.
|
||||
*/
|
||||
public void setSection(final int index, final PageState state) {
|
||||
sections.setSelectedKey(state, String.valueOf(index));
|
||||
for(int i = 0; i < components.size(); i++) {
|
||||
|
|
@ -132,6 +145,9 @@ public class UsersGroupsRolesTab extends LayoutPanel {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Model Builder for the section list.
|
||||
*/
|
||||
private class SectionsListModelBuilder extends LockableImpl
|
||||
implements ListModelBuilder {
|
||||
|
||||
|
|
@ -142,12 +158,14 @@ public class UsersGroupsRolesTab extends LayoutPanel {
|
|||
sections.setSelectedKey(state, String.valueOf(0));
|
||||
}
|
||||
|
||||
//sections.setSelectedKey(state, String.valueOf(0));
|
||||
return new SectionsListModel(state);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Model for the section list.
|
||||
*/
|
||||
private class SectionsListModel implements ListModel {
|
||||
|
||||
private int index = -1;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package com.arsdigita.ui.admin.usersgroupsroles.groups;
|
||||
|
||||
import com.arsdigita.bebop.ActionLink;
|
||||
import com.arsdigita.bebop.BoxPanel;
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.ControlLink;
|
||||
import com.arsdigita.bebop.Form;
|
||||
|
|
@ -51,7 +52,12 @@ import java.util.List;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Form for adding a new member to group. The form contains a form for searching
|
||||
* members (uses the user name, the family name, the given name and the primary
|
||||
* email address). After a search term was send, a table with all matching users
|
||||
* is displayed. The table also contains an action link for adding a user to the
|
||||
* group which is currently selected..
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class GroupAddMemberForm extends Form {
|
||||
|
|
@ -72,16 +78,17 @@ class GroupAddMemberForm extends Form {
|
|||
|
||||
super("groupAddMemberForm");
|
||||
|
||||
final BoxPanel links = new BoxPanel(BoxPanel.VERTICAL);
|
||||
final ActionLink backToGroup = new ActionLink(new GlobalizedMessage(
|
||||
"ui.admin.group_details.add_member.back", ADMIN_BUNDLE));
|
||||
backToGroup.addActionListener(e -> {
|
||||
groupAdmin.hideGroupMemberAddForm(e.getPageState());
|
||||
});
|
||||
add(backToGroup);
|
||||
links.add(backToGroup);
|
||||
|
||||
final Label header = new Label();
|
||||
header.setClassAttr("heading");
|
||||
header.addPrintListener(e -> {
|
||||
final Label heading = new Label();
|
||||
heading.setClassAttr("heading");
|
||||
heading.addPrintListener(e -> {
|
||||
final PageState state = e.getPageState();
|
||||
final Label target = (Label) e.getTarget();
|
||||
|
||||
|
|
@ -96,7 +103,9 @@ class GroupAddMemberForm extends Form {
|
|||
new String[]{group.getName()}));
|
||||
|
||||
});
|
||||
add(header);
|
||||
links.add(heading);
|
||||
|
||||
add(links);
|
||||
|
||||
memberName = new TextField(MEMBER_NAME);
|
||||
memberName.setLabel(new GlobalizedMessage(
|
||||
|
|
|
|||
|
|
@ -33,24 +33,50 @@ import com.arsdigita.globalization.GlobalizedMessage;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
* UI for managing the groups (collections of users) in the system.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class GroupAdmin extends BoxPanel {
|
||||
|
||||
/**
|
||||
* Parameter for the currently selected group.
|
||||
*/
|
||||
private final StringParameter groupIdParameter;
|
||||
/**
|
||||
* Model for the current selected group.
|
||||
*/
|
||||
private final ParameterSingleSelectionModel<String> selectedGroupId;
|
||||
/**
|
||||
* Text field for the filter UI for filtering the groups table.
|
||||
*/
|
||||
private final TextField groupsTableFilter;
|
||||
/**
|
||||
* The panel containing the groups table and some supporting UI elements.
|
||||
*/
|
||||
private final BoxPanel groupsTablePanel;
|
||||
/**
|
||||
* The groups table itself.
|
||||
*/
|
||||
private final GroupsTable groupsTable;
|
||||
/**
|
||||
* The form for creating new groups and editing the properties of existing
|
||||
* groups.
|
||||
*/
|
||||
private final GroupForm groupForm;
|
||||
/**
|
||||
* The component which displays the details of a group.
|
||||
*/
|
||||
private final GroupDetails groupDetails;
|
||||
/**
|
||||
* The form for adding members to a group.
|
||||
*/
|
||||
private final GroupAddMemberForm groupAddMemberForm;
|
||||
|
||||
public GroupAdmin() {
|
||||
super(BoxPanel.VERTICAL);
|
||||
|
||||
setBasicProperties();
|
||||
setIdAttr("groupAdmin");
|
||||
|
||||
final Label heading = new Label(new GlobalizedMessage(
|
||||
"ui.admin.groups.heading", ADMIN_BUNDLE));
|
||||
|
|
@ -103,6 +129,12 @@ public class GroupAdmin extends BoxPanel {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the top level components of the UI in the page. Otherwise we
|
||||
* can't control their visibility.
|
||||
*
|
||||
* @param page
|
||||
*/
|
||||
@Override
|
||||
public void register(final Page page) {
|
||||
super.register(page);
|
||||
|
|
@ -115,11 +147,11 @@ public class GroupAdmin extends BoxPanel {
|
|||
page.setVisibleDefault(groupAddMemberForm, false);
|
||||
}
|
||||
|
||||
private void setBasicProperties() {
|
||||
setIdAttr("groupAdmin");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the groups details visible and all other components invisible.
|
||||
*
|
||||
* @param state The current {@link PageState}.
|
||||
*/
|
||||
protected void showGroupDetails(final PageState state) {
|
||||
groupsTablePanel.setVisible(state, false);
|
||||
groupForm.setVisible(state, false);
|
||||
|
|
@ -127,6 +159,12 @@ public class GroupAdmin extends BoxPanel {
|
|||
groupAddMemberForm.setVisible(state, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the groups details invisible and sets the groups table visible. Also
|
||||
* clears the {@link #selectedGroupId}.
|
||||
*
|
||||
* @param state The current {@link PageState}.
|
||||
*/
|
||||
protected void hideGroupDetails(final PageState state) {
|
||||
selectedGroupId.clearSelection(state);
|
||||
groupsTablePanel.setVisible(state, true);
|
||||
|
|
@ -135,6 +173,12 @@ public class GroupAdmin extends BoxPanel {
|
|||
groupAddMemberForm.setVisible(state, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the form for creating new groups or editing the properties of
|
||||
* existing groups.
|
||||
*
|
||||
* @param state The current {@link PageState}.
|
||||
*/
|
||||
protected void showGroupForm(final PageState state) {
|
||||
groupsTablePanel.setVisible(state, false);
|
||||
groupForm.setVisible(state, true);
|
||||
|
|
@ -142,6 +186,12 @@ public class GroupAdmin extends BoxPanel {
|
|||
groupAddMemberForm.setVisible(state, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the group form and shows the groups table or the groups details
|
||||
* depending of a group is selected or not.
|
||||
*
|
||||
* @param state The current {@link PageState}.
|
||||
*/
|
||||
protected void hideGroupForm(final PageState state) {
|
||||
//We want to show the groups table if no group is selected and the
|
||||
//group details if a group is selected.
|
||||
|
|
@ -153,6 +203,11 @@ public class GroupAdmin extends BoxPanel {
|
|||
groupAddMemberForm.setVisible(state, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the form for adding a member to a group. A group must be selected.
|
||||
*
|
||||
* @param state The current {@link PageState}.
|
||||
*/
|
||||
protected void showGroupMemberAddForm(final PageState state) {
|
||||
groupsTablePanel.setVisible(state, false);
|
||||
groupForm.setVisible(state, false);
|
||||
|
|
@ -160,6 +215,11 @@ public class GroupAdmin extends BoxPanel {
|
|||
groupAddMemberForm.setVisible(state, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the form for adding members to a group and shows the group details.
|
||||
*
|
||||
* @param state The current {@link PageState}.
|
||||
*/
|
||||
protected void hideGroupMemberAddForm(final PageState state) {
|
||||
groupsTablePanel.setVisible(state, false);
|
||||
groupForm.setVisible(state, false);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ import org.libreccm.security.GroupRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Panel which contains several components showing the properties of a group
|
||||
* including a table of the members of the group.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class GroupDetails extends BoxPanel {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,15 @@ import org.libreccm.security.GroupRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
* Form used for creating new groups and editing the properties of existing
|
||||
* groups.
|
||||
*
|
||||
* If a group is selected (the provided {@link ParameterSingleSelectionModel}
|
||||
* has a none null value) the group identified by that ID is loaded and the
|
||||
* values are put into the fields and the changes are written back to the group
|
||||
* when the form is submitted.
|
||||
*
|
||||
* If no group is selected a new group is created when the form is submitted.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -47,7 +56,7 @@ class GroupForm extends Form {
|
|||
public GroupForm(
|
||||
final GroupAdmin groupAdmin,
|
||||
final ParameterSingleSelectionModel<String> selectedGroupId) {
|
||||
|
||||
|
||||
super("groupform");
|
||||
|
||||
final Label heading = new Label(e -> {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ import java.util.List;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Table which all members of a group.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class GroupMembersTable extends Table {
|
||||
|
|
|
|||
|
|
@ -33,11 +33,22 @@ import java.util.TreeSet;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
* The model for the property sheet of a group. The {@link GroupProperty} enum
|
||||
* contains a list of all rows of the property sheet. The {@link #nextRow()}
|
||||
* method of this model uses an iterator to iterate over the values of the enum
|
||||
* and sets value of the {@link #currentProperty} field. Based on the value of
|
||||
* the {@link #currentProperty} field the {@link #getValue()} method decides
|
||||
* which information is shown.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class GroupPropertySheetModel implements PropertySheetModel {
|
||||
|
||||
/**
|
||||
* An enum which identifies the rows of the property sheet. The
|
||||
* {@link #nextRow()} method uses an iterator to iterate over all values the
|
||||
* property.
|
||||
*/
|
||||
private static enum GroupProperty {
|
||||
GROUP_NAME,
|
||||
ROLES
|
||||
|
|
@ -79,7 +90,7 @@ class GroupPropertySheetModel implements PropertySheetModel {
|
|||
private GlobalizedMessage generateGlobalizedLabel(
|
||||
final GroupProperty property) {
|
||||
|
||||
final String key = String.join("",
|
||||
final String key = String.join("",
|
||||
"ui.admin.group.property_sheet.",
|
||||
property.toString().toLowerCase());
|
||||
return new GlobalizedMessage(key, ADMIN_BUNDLE);
|
||||
|
|
@ -97,18 +108,27 @@ class GroupPropertySheetModel implements PropertySheetModel {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for retrieving all roles assigned to group. The roles are
|
||||
* retrieved from the selected group, their names are than put into a sorted
|
||||
* set which sorted alphabetically and the passed to a {@link StringJoiner}
|
||||
* which creates a string which all roles separated by a comma.
|
||||
*
|
||||
* @return A string containing the names of all roles assigned to the group
|
||||
* in alphabetical order separated by a comma.
|
||||
*/
|
||||
private String retrieveRoles() {
|
||||
final Set<RoleMembership> roleMemberships = selectedGroup
|
||||
.getRoleMemberships();
|
||||
|
||||
|
||||
final SortedSet<String> roles = new TreeSet<>((r1, r2) -> {
|
||||
return r1.compareTo(r2);
|
||||
});
|
||||
|
||||
|
||||
roleMemberships.forEach(m -> {
|
||||
roles.add(m.getRole().getName());
|
||||
});
|
||||
|
||||
|
||||
return String.join(", ", roles.toArray(new String[roles.size()]));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ import org.libreccm.security.Group;
|
|||
import org.libreccm.security.GroupRepository;
|
||||
|
||||
/**
|
||||
* Model builder for the group property sheet creating the
|
||||
* {@link GroupPropertySheetModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -58,4 +60,5 @@ class GroupPropertySheetModelBuilder
|
|||
|
||||
return new GroupPropertySheetModel(selectedGroup);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ import org.libreccm.security.GroupRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Table listing all groups.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class GroupsTable extends Table {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ import java.util.List;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Form for adding members (users or groups) to a role.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class RoleAddMemberForm extends Form {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ import com.arsdigita.globalization.GlobalizedMessage;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* UI for managing roles.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class RoleAdmin extends BoxPanel {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ import org.libreccm.security.RoleRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Shows the properties of a role including the members of the role.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class RoleDetails extends BoxPanel {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,11 @@ import org.libreccm.security.RoleRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Form for creating new roles and editing existing roles. If a role
|
||||
* is selected the form is populated with the values of an existing role. When
|
||||
* the form is submitted either a new role is created or an existing group
|
||||
* is updated.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class RoleForm extends Form {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ import java.util.List;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Table showing all members (users or groups) of a role.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class RoleMembersTable extends Table {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ import org.libreccm.security.RoleRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
* A basic form for add permissions to role. Usually the applications should
|
||||
* provide better and more comfortable forms for editing their specific
|
||||
* permissions. This form is provided to give the administrator the possibility
|
||||
* to manage permissions in a generic way.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ import java.util.List;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Table displaying all permissions granted to a role.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class RolePermissionsTable extends Table {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,12 @@ import java.util.Iterator;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* The model for the property sheet of a role. The {@link RoleProperty}
|
||||
* enum contains all properties which are shown in the property sheet. The
|
||||
* {@link #nextRow()} method iterates over these properties and sets the
|
||||
* value {@link #currentProperty} field. The {@link #getValue()} method
|
||||
* returns the value for the {@code currentProperty}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class RolePropertySheetModel implements PropertySheetModel {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ import org.libreccm.security.Role;
|
|||
import org.libreccm.security.RoleRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
* Model builder for the {@link RolePropertySheetModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class RolePropertySheetModelBuilder extends LockableImpl
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ import java.util.List;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Filterable table showing all roles.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class RolesTable extends Table {
|
||||
|
|
|
|||
|
|
@ -36,20 +36,22 @@ import javax.mail.MessagingException;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
* A panel contains several action links used in the {@link UserDetails}
|
||||
* component.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class ActionLinks extends BoxPanel {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(ActionLinks.class);
|
||||
|
||||
|
||||
public ActionLinks(final UserAdmin userAdmin,
|
||||
final ParameterSingleSelectionModel<String> selectedUserId) {
|
||||
|
||||
super(BoxPanel.HORIZONTAL);
|
||||
|
||||
setIdAttr("userDetailsActionLinks");
|
||||
|
||||
|
||||
final ActionLink editUserDetailsLink = new ActionLink(
|
||||
new GlobalizedMessage("ui.admin.user_details.edit", ADMIN_BUNDLE));
|
||||
editUserDetailsLink.addActionListener(e -> {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ import org.libreccm.security.UserRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Form for editing and adding email addresses to a user.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class EmailForm extends Form {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ import org.libreccm.security.UserRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Table showing the additional email addresses associated with a user.
|
||||
* Please note that the additional email addresses property will maybe removed.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class EmailTable extends Table {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ import java.util.List;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Model for the {@link EmailTable}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class EmailTableModel implements TableModel {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ import org.libreccm.security.User;
|
|||
import org.libreccm.security.UserRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
* Model builder for the {@link EmailTableModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class EmailTableModelBuilder extends LockableImpl
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ import java.util.stream.IntStream;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Form for editing the group memberships of a user.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class GroupMembershipsForm extends Form {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,12 @@ import com.arsdigita.bebop.table.TableColumn;
|
|||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
|
||||
/**
|
||||
*
|
||||
* Table showing the roles and groups of a user. The table has three rows. The
|
||||
* first one show the groups to which the user is assigned. The second row
|
||||
* shows all roles to which are <strong>directly</strong> assigned to a user.
|
||||
* The third row shows all roles which are assigned to the user, either directly
|
||||
* or via one of the groups the user is assigned to.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class GroupsRolesTable extends Table {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ import java.util.Set;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Model for the {@link GroupsRolesTable}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class GroupsRolesTableModel implements TableModel {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ import org.libreccm.security.User;
|
|||
import org.libreccm.security.UserRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
* Model builder for the {@link GroupsRolesTableModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class GroupsRolesTableModelBuilder extends LockableImpl
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ import com.arsdigita.bebop.form.Option;
|
|||
import com.arsdigita.bebop.form.Password;
|
||||
import com.arsdigita.bebop.form.RadioGroup;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringLengthValidationListener;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
|
|
@ -45,7 +43,8 @@ import javax.mail.MessagingException;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Form for creating new users.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class NewUserForm extends Form {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import com.arsdigita.bebop.PageState;
|
|||
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||
import com.arsdigita.bebop.SaveCancelSection;
|
||||
import com.arsdigita.bebop.form.Password;
|
||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
|
|
@ -36,7 +35,8 @@ import org.libreccm.security.UserRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Form for setting the password of a user.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class PasswordSetForm extends Form {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ import com.arsdigita.globalization.GlobalizedMessage;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Table showing the primary email of an user.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class PrimaryEmailTable extends Table {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ import org.libreccm.security.User;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Model for the {@link PrimaryEmailTable}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class PrimaryEmailTableModel implements TableModel {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ import org.libreccm.security.User;
|
|||
import org.libreccm.security.UserRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
* Model builder for the {@link PrimaryEmailTableModel}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class PrimaryEmailTableModelBuilder extends LockableImpl
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ import java.util.stream.IntStream;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Form for editing the role memberships of a user.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class RoleMembershipsForm extends Form {
|
||||
|
|
|
|||
|
|
@ -18,55 +18,15 @@
|
|||
*/
|
||||
package com.arsdigita.ui.admin.usersgroupsroles.users;
|
||||
|
||||
import com.arsdigita.bebop.ActionLink;
|
||||
import com.arsdigita.bebop.BoxPanel;
|
||||
import com.arsdigita.bebop.Form;
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||
import com.arsdigita.bebop.SaveCancelSection;
|
||||
import com.arsdigita.bebop.Text;
|
||||
import com.arsdigita.bebop.form.CheckboxGroup;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.Password;
|
||||
import com.arsdigita.bebop.form.RadioGroup;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringLengthValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
|
||||
import org.libreccm.cdi.utils.CdiUtil;
|
||||
import org.libreccm.core.EmailAddress;
|
||||
import org.libreccm.security.ChallengeManager;
|
||||
import org.libreccm.security.Group;
|
||||
import org.libreccm.security.GroupManager;
|
||||
import org.libreccm.security.GroupRepository;
|
||||
import org.libreccm.security.Role;
|
||||
import org.libreccm.security.RoleManager;
|
||||
import org.libreccm.security.RoleRepository;
|
||||
import org.libreccm.security.User;
|
||||
import org.libreccm.security.UserManager;
|
||||
import org.libreccm.security.UserRepository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TooManyListenersException;
|
||||
import java.util.TreeSet;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
|
||||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* UI for managing users.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class UserAdmin extends BoxPanel {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ import com.arsdigita.globalization.GlobalizedMessage;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Displays the properties of a user.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class UserDetails extends BoxPanel {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ import org.libreccm.security.UserRepository;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
* Form for editing the properties of a user. There separate forms for some
|
||||
* properties like the password, the group memberships or the role memberships.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ import org.libreccm.security.User;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
* Model for the user properties sheet in the {@link UserDetails}. the
|
||||
* {@link UserProperty} enum contains the properties the show. The
|
||||
* {@link #nextRow()} method iterators over this properties and sets the
|
||||
* {@link #currentProperty} field. The {@link #getValue()} returns the value for
|
||||
* the current property.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
|
|
@ -104,4 +109,5 @@ class UserPropertySheetModel implements PropertySheetModel {
|
|||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ import org.libreccm.security.User;
|
|||
import org.libreccm.security.UserRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
* Model builder for the {@link UserPropertySheetModelBuilder}.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class UserPropertySheetModelBuilder
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ import java.util.List;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* A filterable table showing all users.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class UsersTable extends Table {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ import com.arsdigita.globalization.GlobalizedMessage;
|
|||
import static com.arsdigita.ui.admin.AdminUiConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* Panel containing the {@link UsersTable} and the filter form for the table.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
class UsersTablePanel extends BoxPanel {
|
||||
|
|
|
|||
Loading…
Reference in New Issue