- Subject subject = getSubject();
- session = Subject.doAs(subject, new PrivilegedExceptionAction<Session>() {
-
- @Override
- public Session run() throws PrivilegedActionException {
- try {
- return repository.login(NodeConstants.HOME_WORKSPACE);
- } catch (RepositoryException e) {
- throw new PrivilegedActionException(e);
+ if (state != null && state.startsWith("/")) {
+ String path = state.substring(1);
+ String workspace;
+ if (path.equals("")) {
+ workspace = null;
+ path = "/";
+ } else {
+ int index = path.indexOf('/');
+ if (index == 0) {
+ log.error("Cannot interpret // " + state);
+ getBrowserNavigation().pushState("~", null);
+ return;
+ } else if (index > 0) {
+ workspace = path.substring(0, index);
+ path = path.substring(index);
+ } else {// index<0, assuming root node
+ workspace = path;
+ path = "/";