Work on security Admin UI, batch processing, specific admin abilities, some code...
[lgpl/argeo-commons.git] / org.argeo.security.ui.admin / src / org / argeo / security / ui / admin / internal / commands / UserBatchUpdate.java
index fb1a491d95f67c29e2f654efd37c34399a21ba58..c02f5c2200447b8c1cf488bfb6ab179f3c3b1a38 100644 (file)
  */
 package org.argeo.security.ui.admin.internal.commands;
 
+import org.argeo.security.ui.admin.internal.UserAdminWrapper;
+import org.argeo.security.ui.admin.internal.parts.UserBatchUpdateWizard;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.handlers.HandlerUtil;
 
-/** Launch a wizard to update various properties about users in JCR. */
+/** Launch a wizard to perform batch process on users */
 public class UserBatchUpdate extends AbstractHandler {
-       // private Repository repository;
-       // private UserAdminService userAdminService;
+
+       /* DEPENDENCY INJECTION */
+       private UserAdminWrapper uaWrapper;
 
        public Object execute(ExecutionEvent event) throws ExecutionException {
-               // Session session = null;
-               // try {
-               // session = repository.login();
-               // UserBatchUpdateWizard userBatchUpdateWizard = new
-               // UserBatchUpdateWizard(
-               // session, userAdminService);
-               // WizardDialog dialog = new WizardDialog(
-               // HandlerUtil.getActiveShell(event), userBatchUpdateWizard);
-               // dialog.open();
-               // } catch (Exception e) {
-               // throw new ExecutionException("Cannot open wizard", e);
-               // } finally {
-               // JcrUtils.logoutQuietly(session);
-               // }
+               UserBatchUpdateWizard wizard = new UserBatchUpdateWizard(uaWrapper);
+               wizard.setWindowTitle("User batch processing");
+               WizardDialog dialog = new WizardDialog(
+                               HandlerUtil.getActiveShell(event), wizard);
+               dialog.open();
                return null;
        }
 
-//     public void setRepository(Repository repository) {
-//             this.repository = repository;
-//     }
-       //
-       // public void setUserAdminService(UserAdminService userAdminService) {
-       // this.userAdminService = userAdminService;
-       // }
-
-       // public void setJcrSecurityModel(JcrSecurityModel jcrSecurityModel) {
-       // this.jcrSecurityModel = jcrSecurityModel;
-       // }
-
-}
+       public void setUserAdminWrapper(UserAdminWrapper userAdminWrapper) {
+               this.uaWrapper = userAdminWrapper;
+       }
+}
\ No newline at end of file