import java.util.Dictionary;
import java.util.Map;
-import org.argeo.ArgeoException;
+import org.argeo.cms.CmsException;
import org.argeo.eclipse.ui.EclipseUiUtils;
import org.argeo.eclipse.ui.dialogs.ErrorFeedback;
import org.argeo.jcr.ArgeoNames;
private class NewGroupWizard extends Wizard {
- // pages
+ // Pages
private MainGroupInfoWizardPage mainGroupInfo;
- // End user fields
+ // UI fields
private Text dNameTxt, commonNameTxt, descriptionTxt;
private Combo baseDnCmb;
String commonName = commonNameTxt.getText();
try {
userAdminWrapper.beginTransactionIfNeeded();
+ String dn = getDn(commonName);
Group group = (Group) userAdminWrapper.getUserAdmin()
- .createRole(getDn(commonName), Role.GROUP);
+ .createRole(dn, Role.GROUP);
Dictionary props = group.getProperties();
String descStr = descriptionTxt.getText();
if (EclipseUiUtils.notEmpty(descStr))
props.put(LdifName.description.name(), descStr);
+ userAdminWrapper.commitOrNotifyTransactionStateChange();
userAdminWrapper.notifyListeners(new UserAdminEvent(null,
UserAdminEvent.ROLE_CREATED, group));
return true;
"Common name");
commonNameTxt.addFocusListener(this);
-
Label descLbl = new Label(bodyCmp, SWT.LEAD);
descLbl.setText("Description");
descLbl.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false,
public void focusGained(FocusEvent event) {
}
- /** @return error message or null if complete */
+ /** @return the error message or null if complete */
protected String checkComplete() {
String name = commonNameTxt.getText();
private void initialiseDnCmb(Combo combo) {
Map<String, String> dns = userAdminWrapper.getKnownBaseDns(true);
if (dns.isEmpty())
- throw new ArgeoException(
+ throw new CmsException(
"No writable base dn found. Cannot create group");
combo.setItems(dns.keySet().toArray(new String[0]));
if (dns.size() == 1)