import org.argeo.api.cms.ux.CmsView;
import org.argeo.app.ui.SuiteEvent;
import org.argeo.app.ui.SuiteIcon;
-import org.argeo.app.ui.dialogs.NewUserWizard;
import org.argeo.cms.CmsUserManager;
import org.argeo.cms.acr.ContentUtils;
import org.argeo.cms.auth.CmsRole;
import org.argeo.cms.auth.CurrentUser;
import org.argeo.cms.auth.UserAdminUtils;
import org.argeo.cms.jcr.acr.JcrContent;
-import org.argeo.cms.jface.dialog.CmsWizardDialog;
import org.argeo.cms.swt.CmsSwtTheme;
import org.argeo.cms.swt.CmsSwtUtils;
import org.argeo.cms.swt.Selected;
import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.argeo.cms.swt.widgets.SwtGuidedFormDialog;
import org.argeo.cms.swt.widgets.SwtTableView;
import org.argeo.cms.swt.widgets.SwtTreeView;
import org.argeo.cms.ui.CmsUiProvider;
import org.argeo.cms.ux.widgets.AbstractHierarchicalPart;
import org.argeo.cms.ux.widgets.Column;
import org.argeo.cms.ux.widgets.DefaultTabularPart;
+import org.argeo.cms.ux.widgets.GuidedForm;
import org.argeo.cms.ux.widgets.HierarchicalPart;
import org.argeo.osgi.useradmin.UserDirectory;
import org.argeo.util.directory.HierarchyUnit;
import org.argeo.util.naming.LdapAttrs;
import org.argeo.util.naming.LdapObjs;
import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.GridData;
@Override
public CmsIcon getIcon(HierarchyUnit model) {
- return SuiteIcon.group;
+ Content content = ContentUtils.hierarchyUnitToContent(contentSession, model);
+ if (content.hasContentClass(LdapObjs.organization.qName()))
+ return SuiteIcon.organisation;
+ else if (content.hasContentClass(LdapObjs.posixGroup.qName()))
+ return SuiteIcon.group;
+ else
+ return SuiteIcon.people;
}
};
@Override
public CmsIcon getIcon(Content role) {
- if (role.isContentClass(LdapObjs.inetOrgPerson.qName()))
+ if (role.hasContentClass(LdapObjs.posixAccount.qName()))
+ return SuiteIcon.user;
+ else if (role.isContentClass(LdapObjs.inetOrgPerson.qName()))
return SuiteIcon.person;
else if (role.isContentClass(LdapObjs.organization.qName()))
return SuiteIcon.organisation;
});
addItem.addSelectionListener((Selected) (e) -> {
- // SuiteUtils.getOrCreateUserNode(adminSession, userDn);
- Wizard wizard = new NewUserWizard(null);
- CmsWizardDialog dialog = new CmsWizardDialog(parent.getShell(), wizard);
+ HierarchyUnit hierarchyUnit = usersPart.getInput();
+ Content huContent = ContentUtils.hierarchyUnitToContent(contentSession, hierarchyUnit);
+ GuidedForm wizard = new NewUserForm(cmsUserManager, huContent);
+ SwtGuidedFormDialog dialog = new SwtGuidedFormDialog(parent.getShell(), wizard);
// WizardDialog dialog = new WizardDialog(shell, wizard);
if (dialog.open() == Window.OK) {
// TODO create