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