- Session session = null;
- try {
- session = repository.login(credentials);
- session.getWorkspace().createWorkspace(workspaceName);
- JcrUtils.logoutQuietly(session);
- // init new workspace
- session = repository.login(workspaceName);
- JcrUtils.addPrivilege(session, "/", slcRole, Privilege.JCR_ALL);
- CommandHelpers.callCommand(RefreshDistributionsView.ID);
- } catch (RepositoryException re) {
- throw new ArgeoException(
- "Unexpected error while creating the new workspace.",
- re);
- } finally {
- JcrUtils.logoutQuietly(session);
- }
+ session = repository.login(credentials);
+ session.getWorkspace().createWorkspace(workspaceName);
+ JcrUtils.logoutQuietly(session);
+ // init new workspace
+ session = repository.login(credentials, workspaceName);
+ JcrUtils.addPrivilege(session, "/", slcRole, Privilege.JCR_ALL);
+ CommandHelpers.callCommand(RefreshDistributionsView.ID);