X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.e4%2Fsrc%2Forg%2Fargeo%2Fcms%2Fe4%2Fusers%2FGroupEditor.java;h=a4d8317b2f4d6d4b669df2a2c363406101f38937;hb=e7dc62c485696931a3e048d9102a7c86f9323b92;hp=a38879424f87a1b990bb510d376ceea15ecd562b;hpb=088c1b517a543e935d8ab65c3b2fd2d0269b551d;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms.e4/src/org/argeo/cms/e4/users/GroupEditor.java b/org.argeo.cms.e4/src/org/argeo/cms/e4/users/GroupEditor.java index a38879424..a4d8317b2 100644 --- a/org.argeo.cms.e4/src/org/argeo/cms/e4/users/GroupEditor.java +++ b/org.argeo.cms.e4/src/org/argeo/cms/e4/users/GroupEditor.java @@ -15,10 +15,10 @@ */ package org.argeo.cms.e4.users; -import static org.argeo.cms.util.UserAdminUtils.setProperty; +import static org.argeo.api.NodeInstance.WORKGROUP; +import static org.argeo.cms.auth.UserAdminUtils.setProperty; import static org.argeo.naming.LdapAttrs.businessCategory; import static org.argeo.naming.LdapAttrs.description; -import static org.argeo.node.NodeInstance.WORKGROUP; import java.util.ArrayList; import java.util.Iterator; @@ -34,23 +34,23 @@ import javax.naming.InvalidNameException; import javax.naming.ldap.LdapName; import javax.transaction.UserTransaction; -import org.argeo.cms.ArgeoNames; +import org.argeo.api.NodeConstants; +import org.argeo.api.NodeInstance; +import org.argeo.api.NodeUtils; import org.argeo.cms.CmsException; +import org.argeo.cms.auth.UserAdminUtils; import org.argeo.cms.e4.users.providers.CommonNameLP; import org.argeo.cms.e4.users.providers.MailLP; import org.argeo.cms.e4.users.providers.RoleIconLP; import org.argeo.cms.e4.users.providers.UserFilter; import org.argeo.cms.ui.eclipse.forms.AbstractFormPart; import org.argeo.cms.ui.eclipse.forms.IManagedForm; -import org.argeo.cms.util.CmsUtils; -import org.argeo.cms.util.UserAdminUtils; +import org.argeo.cms.ui.util.CmsUiUtils; import org.argeo.eclipse.ui.ColumnDefinition; import org.argeo.eclipse.ui.EclipseUiUtils; import org.argeo.eclipse.ui.parts.LdifUsersTable; import org.argeo.jcr.JcrUtils; import org.argeo.naming.LdapAttrs; -import org.argeo.node.NodeInstance; -import org.argeo.node.NodeUtils; import org.eclipse.e4.ui.workbench.modeling.EPartService; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.ToolBarManager; @@ -92,7 +92,7 @@ import org.osgi.service.useradmin.UserAdmin; import org.osgi.service.useradmin.UserAdminEvent; /** Display/edit main properties of a given group */ -public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { +public class GroupEditor extends AbstractRoleEditor { // final static String ID = "GroupEditor.mainPage"; @Inject @@ -104,7 +104,7 @@ public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { @Inject private NodeInstance nodeInstance; // private final UserAdminWrapper userAdminWrapper; - private Session session; + private Session groupsSession; // public GroupMainPage(FormEditor editor, UserAdminWrapper userAdminWrapper, // Repository repository, @@ -134,7 +134,7 @@ public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { @Override protected void createUi(Composite parent) { try { - session = repository.login(); + groupsSession = repository.login(NodeConstants.SRV_WORKSPACE); } catch (RepositoryException e) { throw new CmsException("Cannot retrieve session", e); } @@ -151,7 +151,7 @@ public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { @PreDestroy public void dispose() { - JcrUtils.logoutQuietly(session); + JcrUtils.logoutQuietly(groupsSession); super.dispose(); } @@ -161,7 +161,7 @@ public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { // GridLayout layout = new GridLayout(5, false); GridLayout layout = new GridLayout(2, false); body.setLayout(layout); - body.setLayoutData(CmsUtils.fillWidth()); + body.setLayoutData(CmsUiUtils.fillWidth()); String cn = UserAdminUtils.getProperty(group, LdapAttrs.cn.name()); createReadOnlyLT(body, "Name", cn); @@ -212,7 +212,7 @@ public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { // dnTxt.setText(group.getName()); // cnTxt.setText(UserAdminUtils.getProperty(group, LdapAttrs.cn.name())); descTxt.setText(UserAdminUtils.getProperty(group, LdapAttrs.description.name())); - Node workgroupHome = NodeUtils.getGroupHome(session, cn); + Node workgroupHome = NodeUtils.getGroupHome(groupsSession, cn); if (workgroupHome == null) markAsWorkgroupLk.setText("Mark as workgroup"); else @@ -231,7 +231,7 @@ public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { boolean confirmed = MessageDialog.openConfirm(parent.getShell(), "Mark as workgroup", "Are you sure you want to mark " + cn + " as being a workgroup? "); if (confirmed) { - Node workgroupHome = NodeUtils.getGroupHome(session, cn); + Node workgroupHome = NodeUtils.getGroupHome(groupsSession, cn); if (workgroupHome != null) return; // already marked as workgroup, do nothing else @@ -302,7 +302,7 @@ public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT); ToolBar toolBar = toolBarManager.createControl(body); - toolBar.setLayoutData(CmsUtils.fillWidth()); + toolBar.setLayoutData(CmsUiUtils.fillWidth()); toolBarManager.add(action); toolBarManager.update(true); @@ -568,7 +568,7 @@ public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { // lbl.setFont(EclipseUiUtils.getBoldFont(parent)); // Text text = toolkit.createText(parent, value, SWT.BORDER); // text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); - // CmsUtils.style(text, CmsWorkbenchStyles.WORKBENCH_FORM_TEXT); + // CmsUiUtils.style(text, CmsWorkbenchStyles.WORKBENCH_FORM_TEXT); // return text; // } // @@ -580,7 +580,7 @@ public class GroupEditor extends AbstractRoleEditor implements ArgeoNames { // Text text = toolkit.createText(parent, value, SWT.NONE); // text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); // text.setEditable(false); - // CmsUtils.style(text, CmsWorkbenchStyles.WORKBENCH_FORM_TEXT); + // CmsUiUtils.style(text, CmsWorkbenchStyles.WORKBENCH_FORM_TEXT); // return text; // }