1 package org
.argeo
.slc
.client
.ui
.dist
.commands
;
3 import javax
.jcr
.Repository
;
4 import javax
.jcr
.RepositoryException
;
5 import javax
.jcr
.Session
;
6 import javax
.jcr
.security
.Privilege
;
8 import org
.argeo
.ArgeoException
;
9 import org
.argeo
.slc
.client
.ui
.dist
.DistPlugin
;
10 import org
.argeo
.slc
.client
.ui
.dist
.wizards
.ChangeRightsWizard
;
11 import org
.eclipse
.core
.commands
.AbstractHandler
;
12 import org
.eclipse
.core
.commands
.ExecutionEvent
;
13 import org
.eclipse
.core
.commands
.ExecutionException
;
14 import org
.eclipse
.jface
.wizard
.WizardDialog
;
15 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
18 * Open a dialog to change rights on the root node of the current workspace.
21 public class ManageWorkspaceAuth
extends AbstractHandler
{
22 // private static final Log log =
23 // LogFactory.getLog(ManageWorkspaceAuth.class);
24 public final static String ID
= DistPlugin
.ID
+ ".manageWorkspaceAuth";
25 public final static String PARAM_WORKSPACE_NAME
= DistPlugin
.ID
27 public final static String DEFAULT_LABEL
= "Change rights for current workspace";
28 public final static String DEFAULT_ICON_PATH
= "icons/changeRights.gif";
30 /* DEPENDENCY INJECTION */
31 private Repository repository
;
33 private Session session
;
35 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
36 String workspaceName
= event
.getParameter(PARAM_WORKSPACE_NAME
);
38 session
= repository
.login(workspaceName
);
39 ChangeRightsWizard wizard
= new ChangeRightsWizard(session
);
40 WizardDialog dialog
= new WizardDialog(
41 HandlerUtil
.getActiveShell(event
), wizard
);
44 } catch (RepositoryException re
) {
45 throw new ArgeoException(
46 "Unexpected error while creating the new workspace.", re
);
53 /* DEPENDENCY INJECTION */
54 public void setRepository(Repository repository
) {
55 this.repository
= repository
;