2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.security
.ui
.admin
.commands
;
18 import javax
.jcr
.Repository
;
19 import javax
.jcr
.Session
;
21 import org
.argeo
.jcr
.JcrUtils
;
22 import org
.argeo
.security
.UserAdminService
;
23 import org
.argeo
.security
.ui
.admin
.wizards
.UserBatchUpdateWizard
;
24 import org
.eclipse
.core
.commands
.AbstractHandler
;
25 import org
.eclipse
.core
.commands
.ExecutionEvent
;
26 import org
.eclipse
.core
.commands
.ExecutionException
;
27 import org
.eclipse
.jface
.wizard
.WizardDialog
;
28 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
30 /** Launch a wizard to update various properties about users in JCR. */
31 public class UserBatchUpdate
extends AbstractHandler
{
32 private Repository repository
;
33 private UserAdminService userAdminService
;
35 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
36 Session session
= null;
38 session
= repository
.login();
39 UserBatchUpdateWizard userBatchUpdateWizard
= new UserBatchUpdateWizard(
40 session
, userAdminService
);
41 WizardDialog dialog
= new WizardDialog(
42 HandlerUtil
.getActiveShell(event
), userBatchUpdateWizard
);
44 } catch (Exception e
) {
45 throw new ExecutionException("Cannot open wizard", e
);
47 JcrUtils
.logoutQuietly(session
);
52 public void setRepository(Repository repository
) {
53 this.repository
= repository
;
56 public void setUserAdminService(UserAdminService userAdminService
) {
57 this.userAdminService
= userAdminService
;
60 // public void setJcrSecurityModel(JcrSecurityModel jcrSecurityModel) {
61 // this.jcrSecurityModel = jcrSecurityModel;