Log out home session.
[gpl/argeo-suite.git] / core / org.argeo.suite.ui / src / org / argeo / suite / ui / SuiteUi.java
index 816c65818605761c73d4713d3fda98471ba48806..187888e55e0190d4b5a2cd8b2998627622d46ddb 100644 (file)
@@ -32,7 +32,7 @@ class SuiteUi extends Composite {
        private Composite dynamicArea;
 
        private Session sysSession;
-//     private Session homeSession;
+       private Session homeSession;
        private Node userDir;
 
        private Map<String, SuiteLayer> layers = new HashMap<>();
@@ -149,6 +149,7 @@ class SuiteUi extends Composite {
                }
                throw new IllegalArgumentException("Layer is not registered.");
        }
+       
 
        void addLayer(String id, SuiteLayer layer) {
                layers.put(id, layer);
@@ -174,7 +175,7 @@ class SuiteUi extends Composite {
        synchronized void logout() {
                userDir = null;
                Jcr.logout(sysSession);
-//             Jcr.logout(homeSession);
+               Jcr.logout(homeSession);
                currentLayerId = null;
                workAreas.clear();
        }
@@ -205,11 +206,11 @@ class SuiteUi extends Composite {
 //
        synchronized void initSessions(Repository repository, String userDirPath) throws RepositoryException {
                this.sysSession = repository.login();
-//             this.homeSession = repository.login(NodeConstants.HOME_WORKSPACE);
+               this.homeSession = repository.login(NodeConstants.HOME_WORKSPACE);
                userDir = sysSession.getNode(userDirPath);
                addDisposeListener((e) -> {
                        Jcr.logout(sysSession);
-//                     Jcr.logout(homeSession);
+                       Jcr.logout(homeSession);
                });
        }
 
@@ -226,8 +227,8 @@ class SuiteUi extends Composite {
                        return sysSession;
                if (NodeConstants.SYS_WORKSPACE.equals(workspaceName))
                        return sysSession;
-//             else if (NodeConstants.HOME_WORKSPACE.equals(workspaceName))
-//                     return homeSession;
+               else if (NodeConstants.HOME_WORKSPACE.equals(workspaceName))
+                       return homeSession;
                else
                        throw new IllegalArgumentException("Unknown workspace " + workspaceName);
        }