import java.util.ArrayList;
import java.util.List;
+import javax.transaction.UserTransaction;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.argeo.ArgeoException;
import org.argeo.eclipse.ui.EclipseUiUtils;
import org.argeo.jcr.ArgeoNames;
/** List all users with filter - based on Ldif userAdmin */
public class UsersView extends ViewPart implements ArgeoNames {
+ private final static Log log = LogFactory.getLog(UsersView.class);
public final static String ID = SecurityAdminPlugin.PLUGIN_ID
+ ".usersView";
/* DEPENDENCY INJECTION */
private UserAdmin userAdmin;
+ private UserTransaction userTransaction;
// UI Objects
private UserTableViewer userTableViewerCmp;
public void createPartControl(Composite parent) {
parent.setLayout(EclipseUiUtils.noSpaceGridLayout());
// Define the displayed columns
- columnDefs.add(new ColumnDefinition(new UserNameLP(),
- "Distinguished Name", 200));
columnDefs.add(new ColumnDefinition(new CommonNameLP(), "Common Name",
150));
columnDefs.add(new ColumnDefinition(new MailLP(), "E-mail", 150));
+ columnDefs.add(new ColumnDefinition(new UserNameLP(),
+ "Distinguished Name", 300));
// Create and configure the table
userTableViewerCmp = new MyUserTableViewer(parent, SWT.MULTI
// Really?
userTableViewerCmp.refresh();
+
+// try {
+// if (userTransaction != null)
+// userTransaction.begin();
+// } catch (Exception e) {
+// throw new ArgeoException("Cannot begin transaction", e);
+// }
}
private class MyUserTableViewer extends UserTableViewer {
}
}
+ public void refresh() {
+ userTableViewerCmp.refresh();
+ }
+
// Override generic view methods
@Override
public void dispose() {
super.dispose();
+ // try {
+ // if (userTransaction != null
+ // && userTransaction.getStatus() != Status.STATUS_NO_TRANSACTION)
+ // userTransaction.rollback();
+ // } catch (Exception e) {
+ // log.error("Cannot clean transaction", e);
+ // }
}
@Override
public void setUserAdmin(UserAdmin userAdmin) {
this.userAdmin = userAdmin;
}
+
+ public void setUserTransaction(UserTransaction userTransaction) {
+ this.userTransaction = userTransaction;
+ }
+
}
\ No newline at end of file