X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.security.ui.admin%2Fsrc%2Forg%2Fargeo%2Fsecurity%2Fui%2Fadmin%2Finternal%2Fparts%2FUserBatchUpdateWizard.java;h=80c817ebeb6b993d5321fbd085fce05adec89fd5;hb=de7b5af85c24b20ec977e44d6d6658026f65ab86;hp=5edcfbd4b9dea31e5dbbab67de56ed41c55ea354;hpb=f0be5ec381492eff23d4576ee4122734af4ad877;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/internal/parts/UserBatchUpdateWizard.java b/org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/internal/parts/UserBatchUpdateWizard.java index 5edcfbd4b..80c817ebe 100644 --- a/org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/internal/parts/UserBatchUpdateWizard.java +++ b/org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/internal/parts/UserBatchUpdateWizard.java @@ -10,8 +10,9 @@ import javax.transaction.UserTransaction; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.argeo.ArgeoException; +import org.argeo.cms.CmsException; import org.argeo.cms.auth.AuthConstants; +import org.argeo.cms.util.useradmin.UserAdminUtils; import org.argeo.eclipse.ui.ColumnDefinition; import org.argeo.eclipse.ui.EclipseUiUtils; import org.argeo.eclipse.ui.parts.LdifUsersTable; @@ -97,7 +98,7 @@ public class UserBatchUpdateWizard extends Wizard { + "are you sure you want to proceed ?")) return false; } catch (SystemException e) { - throw new ArgeoException("Cannot get user transaction state " + throw new CmsException("Cannot get user transaction state " + "before user batch update", e); } @@ -110,7 +111,7 @@ public class UserBatchUpdateWizard extends Wizard { if (CMD_UPDATE_PASSWORD.equals(chooseCommandPage.getCommand())) { char[] newValue = chooseCommandPage.getPwdValue(); if (newValue == null) - throw new ArgeoException( + throw new CmsException( "Password cannot be null or an empty string"); ResetPassword job = new ResetPassword(userAdminWrapper, userListPage.getSelectedUsers(), newValue); @@ -149,7 +150,7 @@ public class UserBatchUpdateWizard extends Wizard { userTransaction.commit(); UiAdminUtils.notifyTransactionStateChange(userTransaction); } catch (Exception e) { - throw new ArgeoException( + throw new CmsException( "Cannot perform batch update on users", e); } finally { UserTransaction ut = userAdminWrapper.getUserTransaction(); @@ -182,9 +183,9 @@ public class UserBatchUpdateWizard extends Wizard { // log.info("Add/Remove to group actions are not yet implemented"); // // TODO implement this // // try { - // // throw new ArgeoException("Not yet implemented"); + // // throw new CmsException("Not yet implemented"); // // } catch (RepositoryException re) { - // // throw new ArgeoException( + // // throw new CmsException( // // "Unable to update boolean value for node " + node, re); // // } // } @@ -222,7 +223,7 @@ public class UserBatchUpdateWizard extends Wizard { // } // userAdminWrapper.getUserTransaction().commit(); // } catch (Exception e) { - // throw new ArgeoException( + // throw new CmsException( // "Cannot perform batch update on users", e); // } finally { // UserTransaction ut = userAdminWrapper.getUserTransaction(); @@ -417,7 +418,7 @@ public class UserBatchUpdateWizard extends Wizard { 200)); // Only show technical DN to admin - if (UiAdminUtils.isUserInRole(AuthConstants.ROLE_ADMIN)) + if (UserAdminUtils.isUserInRole(AuthConstants.ROLE_ADMIN)) columnDefs.add(new ColumnDefinition(new UserNameLP(), "Distinguished Name", 300)); @@ -455,7 +456,7 @@ public class UserBatchUpdateWizard extends Wizard { private static final long serialVersionUID = 5080437561015853124L; private final String[] knownProps = { LdifName.uid.name(), LdifName.dn.name(), LdifName.cn.name(), - LdifName.givenname.name(), LdifName.sn.name(), + LdifName.givenName.name(), LdifName.sn.name(), LdifName.mail.name() }; public ChooseUserTableViewer(Composite parent, int style) { @@ -470,7 +471,7 @@ public class UserBatchUpdateWizard extends Wizard { StringBuilder builder = new StringBuilder(); StringBuilder tmpBuilder = new StringBuilder(); - if (UiAdminUtils.notNull(filter)) + if (EclipseUiUtils.notEmpty(filter)) for (String prop : knownProps) { tmpBuilder.append("("); tmpBuilder.append(prop); @@ -494,14 +495,14 @@ public class UserBatchUpdateWizard extends Wizard { roles = userAdminWrapper.getUserAdmin().getRoles( builder.toString()); } catch (InvalidSyntaxException e) { - throw new ArgeoException( + throw new CmsException( "Unable to get roles with filter: " + filter, e); } List users = new ArrayList(); for (Role role : roles) // Prevent current logged in user to perform batch on // himself - if (!UiAdminUtils.isCurrentUser((User) role)) + if (!UserAdminUtils.isCurrentUser((User) role)) users.add((User) role); return users; } @@ -531,7 +532,7 @@ public class UserBatchUpdateWizard extends Wizard { columnDefs.add(new ColumnDefinition(new DomainNameLP(), "Domain", 200)); // Only show technical DN to admin - if (UiAdminUtils.isUserInRole(AuthConstants.ROLE_ADMIN)) + if (UserAdminUtils.isUserInRole(AuthConstants.ROLE_ADMIN)) columnDefs.add(new ColumnDefinition(new UserNameLP(), "Distinguished Name", 300)); userTableCmp = new ChosenUsersTableViewer(pageCmp, SWT.MULTI