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-94f89814c4df
pull/2/head
jensp 2016-04-20 15:48:31 +00:00
parent 87b46a531e
commit 19cdc820a8
41 changed files with 242 additions and 109 deletions

View File

@ -40,6 +40,13 @@ import java.util.ArrayList;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
@ -63,15 +70,6 @@ public class UsersGroupsRolesTab extends LayoutPanel {
}); });
sections.setClassAttr("navbar"); 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(); final BoxPanel body = new BoxPanel();
addSection( addSection(
new Label(new GlobalizedMessage( new Label(new GlobalizedMessage(
@ -96,6 +94,13 @@ public class UsersGroupsRolesTab extends LayoutPanel {
setBody(body); 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, private void addSection(final Label label,
final Component component, final Component component,
final BoxPanel panel) { final BoxPanel panel) {
@ -106,16 +111,24 @@ public class UsersGroupsRolesTab extends LayoutPanel {
keys.add(label); keys.add(label);
} }
/**
* Register the components in the page
*
* @param page The Admin UI page.
*/
@Override @Override
public void register(final Page page) { public void register(final Page page) {
Assert.isUnlocked(this); Assert.isUnlocked(this);
components.forEach(c -> page.setVisibleDefault(c, false)); 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) { public void setSection(final int index, final PageState state) {
sections.setSelectedKey(state, String.valueOf(index)); sections.setSelectedKey(state, String.valueOf(index));
for(int i = 0; i < components.size(); i++) { 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 private class SectionsListModelBuilder extends LockableImpl
implements ListModelBuilder { implements ListModelBuilder {
@ -142,12 +158,14 @@ public class UsersGroupsRolesTab extends LayoutPanel {
sections.setSelectedKey(state, String.valueOf(0)); sections.setSelectedKey(state, String.valueOf(0));
} }
//sections.setSelectedKey(state, String.valueOf(0));
return new SectionsListModel(state); return new SectionsListModel(state);
} }
} }
/**
* Model for the section list.
*/
private class SectionsListModel implements ListModel { private class SectionsListModel implements ListModel {
private int index = -1; private int index = -1;

View File

@ -19,6 +19,7 @@
package com.arsdigita.ui.admin.usersgroupsroles.groups; package com.arsdigita.ui.admin.usersgroupsroles.groups;
import com.arsdigita.bebop.ActionLink; import com.arsdigita.bebop.ActionLink;
import com.arsdigita.bebop.BoxPanel;
import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Component;
import com.arsdigita.bebop.ControlLink; import com.arsdigita.bebop.ControlLink;
import com.arsdigita.bebop.Form; import com.arsdigita.bebop.Form;
@ -51,6 +52,11 @@ import java.util.List;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
@ -72,16 +78,17 @@ class GroupAddMemberForm extends Form {
super("groupAddMemberForm"); super("groupAddMemberForm");
final BoxPanel links = new BoxPanel(BoxPanel.VERTICAL);
final ActionLink backToGroup = new ActionLink(new GlobalizedMessage( final ActionLink backToGroup = new ActionLink(new GlobalizedMessage(
"ui.admin.group_details.add_member.back", ADMIN_BUNDLE)); "ui.admin.group_details.add_member.back", ADMIN_BUNDLE));
backToGroup.addActionListener(e -> { backToGroup.addActionListener(e -> {
groupAdmin.hideGroupMemberAddForm(e.getPageState()); groupAdmin.hideGroupMemberAddForm(e.getPageState());
}); });
add(backToGroup); links.add(backToGroup);
final Label header = new Label(); final Label heading = new Label();
header.setClassAttr("heading"); heading.setClassAttr("heading");
header.addPrintListener(e -> { heading.addPrintListener(e -> {
final PageState state = e.getPageState(); final PageState state = e.getPageState();
final Label target = (Label) e.getTarget(); final Label target = (Label) e.getTarget();
@ -96,7 +103,9 @@ class GroupAddMemberForm extends Form {
new String[]{group.getName()})); new String[]{group.getName()}));
}); });
add(header); links.add(heading);
add(links);
memberName = new TextField(MEMBER_NAME); memberName = new TextField(MEMBER_NAME);
memberName.setLabel(new GlobalizedMessage( memberName.setLabel(new GlobalizedMessage(

View File

@ -33,24 +33,50 @@ import com.arsdigita.globalization.GlobalizedMessage;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
public class GroupAdmin extends BoxPanel { public class GroupAdmin extends BoxPanel {
/**
* Parameter for the currently selected group.
*/
private final StringParameter groupIdParameter; private final StringParameter groupIdParameter;
/**
* Model for the current selected group.
*/
private final ParameterSingleSelectionModel<String> selectedGroupId; private final ParameterSingleSelectionModel<String> selectedGroupId;
/**
* Text field for the filter UI for filtering the groups table.
*/
private final TextField groupsTableFilter; private final TextField groupsTableFilter;
/**
* The panel containing the groups table and some supporting UI elements.
*/
private final BoxPanel groupsTablePanel; private final BoxPanel groupsTablePanel;
/**
* The groups table itself.
*/
private final GroupsTable groupsTable; private final GroupsTable groupsTable;
/**
* The form for creating new groups and editing the properties of existing
* groups.
*/
private final GroupForm groupForm; private final GroupForm groupForm;
/**
* The component which displays the details of a group.
*/
private final GroupDetails groupDetails; private final GroupDetails groupDetails;
/**
* The form for adding members to a group.
*/
private final GroupAddMemberForm groupAddMemberForm; private final GroupAddMemberForm groupAddMemberForm;
public GroupAdmin() { public GroupAdmin() {
super(BoxPanel.VERTICAL); super(BoxPanel.VERTICAL);
setBasicProperties(); setIdAttr("groupAdmin");
final Label heading = new Label(new GlobalizedMessage( final Label heading = new Label(new GlobalizedMessage(
"ui.admin.groups.heading", ADMIN_BUNDLE)); "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 @Override
public void register(final Page page) { public void register(final Page page) {
super.register(page); super.register(page);
@ -115,11 +147,11 @@ public class GroupAdmin extends BoxPanel {
page.setVisibleDefault(groupAddMemberForm, false); 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) { protected void showGroupDetails(final PageState state) {
groupsTablePanel.setVisible(state, false); groupsTablePanel.setVisible(state, false);
groupForm.setVisible(state, false); groupForm.setVisible(state, false);
@ -127,6 +159,12 @@ public class GroupAdmin extends BoxPanel {
groupAddMemberForm.setVisible(state, false); 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) { protected void hideGroupDetails(final PageState state) {
selectedGroupId.clearSelection(state); selectedGroupId.clearSelection(state);
groupsTablePanel.setVisible(state, true); groupsTablePanel.setVisible(state, true);
@ -135,6 +173,12 @@ public class GroupAdmin extends BoxPanel {
groupAddMemberForm.setVisible(state, false); 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) { protected void showGroupForm(final PageState state) {
groupsTablePanel.setVisible(state, false); groupsTablePanel.setVisible(state, false);
groupForm.setVisible(state, true); groupForm.setVisible(state, true);
@ -142,6 +186,12 @@ public class GroupAdmin extends BoxPanel {
groupAddMemberForm.setVisible(state, false); 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) { protected void hideGroupForm(final PageState state) {
//We want to show the groups table if no group is selected and the //We want to show the groups table if no group is selected and the
//group details if a group is selected. //group details if a group is selected.
@ -153,6 +203,11 @@ public class GroupAdmin extends BoxPanel {
groupAddMemberForm.setVisible(state, false); 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) { protected void showGroupMemberAddForm(final PageState state) {
groupsTablePanel.setVisible(state, false); groupsTablePanel.setVisible(state, false);
groupForm.setVisible(state, false); groupForm.setVisible(state, false);
@ -160,6 +215,11 @@ public class GroupAdmin extends BoxPanel {
groupAddMemberForm.setVisible(state, true); 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) { protected void hideGroupMemberAddForm(final PageState state) {
groupsTablePanel.setVisible(state, false); groupsTablePanel.setVisible(state, false);
groupForm.setVisible(state, false); groupForm.setVisible(state, false);

View File

@ -33,6 +33,8 @@ import org.libreccm.security.GroupRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -34,6 +34,15 @@ import org.libreccm.security.GroupRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -47,6 +47,7 @@ import java.util.List;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -33,11 +33,22 @@ import java.util.TreeSet;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
class GroupPropertySheetModel implements PropertySheetModel { 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 { private static enum GroupProperty {
GROUP_NAME, GROUP_NAME,
ROLES ROLES
@ -97,6 +108,15 @@ 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() { private String retrieveRoles() {
final Set<RoleMembership> roleMemberships = selectedGroup final Set<RoleMembership> roleMemberships = selectedGroup
.getRoleMemberships(); .getRoleMemberships();

View File

@ -30,6 +30,8 @@ import org.libreccm.security.Group;
import org.libreccm.security.GroupRepository; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
@ -58,4 +60,5 @@ class GroupPropertySheetModelBuilder
return new GroupPropertySheetModel(selectedGroup); return new GroupPropertySheetModel(selectedGroup);
} }
} }

View File

@ -44,6 +44,7 @@ import org.libreccm.security.GroupRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**
* Table listing all groups.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -53,6 +53,7 @@ import java.util.List;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -33,6 +33,7 @@ import com.arsdigita.globalization.GlobalizedMessage;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**
* UI for managing roles.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -33,6 +33,7 @@ import org.libreccm.security.RoleRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -34,6 +34,10 @@ import org.libreccm.security.RoleRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -49,6 +49,7 @@ import java.util.List;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -38,6 +38,10 @@ import org.libreccm.security.RoleRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -47,6 +47,7 @@ import java.util.List;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -29,6 +29,11 @@ import java.util.Iterator;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -30,6 +30,7 @@ import org.libreccm.security.Role;
import org.libreccm.security.RoleRepository; import org.libreccm.security.RoleRepository;
/** /**
* Model builder for the {@link RolePropertySheetModel}.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -44,6 +44,7 @@ import java.util.List;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**
* Filterable table showing all roles.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -36,6 +36,8 @@ import javax.mail.MessagingException;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -38,6 +38,7 @@ import org.libreccm.security.UserRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -39,6 +39,8 @@ import org.libreccm.security.UserRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -30,6 +30,7 @@ import java.util.List;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**
* Model for the {@link EmailTable}.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -30,6 +30,7 @@ import org.libreccm.security.User;
import org.libreccm.security.UserRepository; import org.libreccm.security.UserRepository;
/** /**
* Model builder for the {@link EmailTableModel}.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -50,6 +50,7 @@ import java.util.stream.IntStream;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -31,6 +31,11 @@ import com.arsdigita.bebop.table.TableColumn;
import com.arsdigita.bebop.table.TableColumnModel; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -32,6 +32,7 @@ import java.util.Set;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**
* Model for the {@link GroupsRolesTable}.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -30,6 +30,7 @@ import org.libreccm.security.User;
import org.libreccm.security.UserRepository; import org.libreccm.security.UserRepository;
/** /**
* Model builder for the {@link GroupsRolesTableModel}.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -29,8 +29,6 @@ import com.arsdigita.bebop.form.Option;
import com.arsdigita.bebop.form.Password; import com.arsdigita.bebop.form.Password;
import com.arsdigita.bebop.form.RadioGroup; import com.arsdigita.bebop.form.RadioGroup;
import com.arsdigita.bebop.form.TextField; import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
import com.arsdigita.bebop.parameters.StringLengthValidationListener;
import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.globalization.GlobalizedMessage;
import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.Strings;
@ -45,6 +43,7 @@ import javax.mail.MessagingException;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**
* Form for creating new users.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -24,7 +24,6 @@ import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.ParameterSingleSelectionModel; import com.arsdigita.bebop.ParameterSingleSelectionModel;
import com.arsdigita.bebop.SaveCancelSection; import com.arsdigita.bebop.SaveCancelSection;
import com.arsdigita.bebop.form.Password; import com.arsdigita.bebop.form.Password;
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.globalization.GlobalizedMessage;
import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.Strings;
@ -36,6 +35,7 @@ import org.libreccm.security.UserRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -34,6 +34,7 @@ import com.arsdigita.globalization.GlobalizedMessage;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -27,6 +27,7 @@ import org.libreccm.security.User;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**
* Model for the {@link PrimaryEmailTable}.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -30,6 +30,7 @@ import org.libreccm.security.User;
import org.libreccm.security.UserRepository; import org.libreccm.security.UserRepository;
/** /**
* Model builder for the {@link PrimaryEmailTableModel}.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -50,6 +50,7 @@ import java.util.stream.IntStream;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -18,54 +18,14 @@
*/ */
package com.arsdigita.ui.admin.usersgroupsroles.users; package com.arsdigita.ui.admin.usersgroupsroles.users;
import com.arsdigita.bebop.ActionLink;
import com.arsdigita.bebop.BoxPanel; 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.Page;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.ParameterSingleSelectionModel; 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.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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -27,6 +27,7 @@ import com.arsdigita.globalization.GlobalizedMessage;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**
* Displays the properties of a user.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -37,6 +37,8 @@ import org.libreccm.security.UserRepository;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -29,6 +29,11 @@ import org.libreccm.security.User;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */
@ -104,4 +109,5 @@ class UserPropertySheetModel implements PropertySheetModel {
return ""; return "";
} }
} }
} }

View File

@ -29,6 +29,7 @@ import org.libreccm.security.User;
import org.libreccm.security.UserRepository; import org.libreccm.security.UserRepository;
/** /**
* Model builder for the {@link UserPropertySheetModelBuilder}.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -46,6 +46,7 @@ import java.util.List;
import static com.arsdigita.ui.admin.AdminUiConstants.*; import static com.arsdigita.ui.admin.AdminUiConstants.*;
/** /**
* A filterable table showing all users.
* *
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */

View File

@ -30,6 +30,7 @@ import com.arsdigita.globalization.GlobalizedMessage;
import static com.arsdigita.ui.admin.AdminUiConstants.*; 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> * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/ */