X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.app.ui%2Fsrc%2Forg%2Fargeo%2Fapp%2Fui%2Fpeople%2FPeopleEntryArea.java;h=8ef935c238b9fb85be1d506901bec3ad0b5f2174;hb=13018794d5ffea90bd27906fb04cd28647a164e0;hp=eb39e062c29a439628f788951ae92d8b1fafa5b3;hpb=446d637e8e7c48edce93f11de493fdf22171eb3e;p=gpl%2Fargeo-suite.git diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java b/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java index eb39e06..8ef935c 100644 --- a/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java +++ b/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java @@ -13,24 +13,24 @@ import org.argeo.api.cms.ux.CmsIcon; 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; @@ -38,7 +38,6 @@ import org.argeo.util.directory.ldap.IpaUtils; 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; @@ -110,12 +109,18 @@ public class PeopleEntryArea implements SwtUiProvider, CmsUiProvider { @Override public String getText(HierarchyUnit model) { - return model.getHierarchyUnitName(); + return model.getHierarchyUnitLabel(CurrentUser.locale()); } @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.users; + else + return SuiteIcon.addressBook; } }; @@ -167,10 +172,12 @@ public class PeopleEntryArea implements SwtUiProvider, CmsUiProvider { @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; + return SuiteIcon.organisationContact; else if (role.isContentClass(LdapObjs.groupOfNames.qName())) return SuiteIcon.group; else @@ -230,9 +237,10 @@ public class PeopleEntryArea implements SwtUiProvider, CmsUiProvider { }); 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