Update UI last access
[gpl/argeo-suite.git] / swt / org.argeo.app.swt / src / org / argeo / app / swt / ux / SwtArgeoApp.java
index 816be08b269b6c1f513171d2e41edd8c00ab939e..a81c33ef83f17fce709099e4fe52dc4293a563bf 100644 (file)
@@ -123,7 +123,7 @@ public class SwtArgeoApp extends AbstractArgeoApp implements CmsEventSubscriber
                                pidPrefix = appPid.substring(0, lastDotIndex);
                        }
                } else {
-                       // TODO doe it make sense to accept that?
+                       // TODO does it make sense to accept that?
                        appPid = "<unknown>";
                }
 
@@ -137,6 +137,7 @@ public class SwtArgeoApp extends AbstractArgeoApp implements CmsEventSubscriber
 //             leadPanePid = pidPrefix + "leadPane";
 //             adminLeadPanePid = pidPrefix + "adminLeadPane";
 //             loginScreenPid = pidPrefix + "loginScreen";
+
        }
 
        public void stop(Map<String, Object> properties) {
@@ -173,18 +174,6 @@ public class SwtArgeoApp extends AbstractArgeoApp implements CmsEventSubscriber
                String uid = cmsView.getUid();
                managedUis.put(uid, argeoSuiteUi);
                argeoSuiteUi.addDisposeListener(new CleanUpUi(uid));
-//             argeoSuiteUi.addDisposeListener((e) -> {
-//                     managedUis.remove(uid);
-//                     if (log.isDebugEnabled())
-//                             log.debug("Suite UI " + uid + " has been disposed.");
-//             });
-//             Display.getCurrent().disposeExec(() -> {
-//                     if (managedUis.containsKey(uid)) {
-//                             managedUis.remove(uid);
-//                             if (log.isDebugEnabled())
-//                                     log.debug("Suite UI " + uid + " has been disposed from Display#disposeExec().");
-//                     }
-//             });
                return argeoSuiteUi;
        }
 
@@ -201,6 +190,7 @@ public class SwtArgeoApp extends AbstractArgeoApp implements CmsEventSubscriber
                try {
                        Content context = null;
                        SwtAppUi ui = (SwtAppUi) cmsUi;
+                       ui.updateLastAccess();
 
                        String uiName = Objects.toString(ui.getParent().getData(UI_NAME_PROPERTY), null);
                        if (uiName == null)
@@ -251,7 +241,7 @@ public class SwtArgeoApp extends AbstractArgeoApp implements CmsEventSubscriber
                                                                .get(Content.ROOT_PATH + CmsConstants.SYS_WORKSPACE + publicBasePath);
                                                ui.setUserDir(userDir);
                                        } else {
-                                               Content userDir = appUserState.getOrCreateSessionDir(contentSession, cmsSession);
+                                               Content userDir = appUserState.getOrCreateSessionDir(cmsSession);
                                                ui.setUserDir(userDir);
 //                                             Node userDirNode = jcrContentProvider.doInAdminSession((adminSession) -> {
 //                                                     Node node = SuiteUtils.getOrCreateCmsSessionNode(adminSession, cmsSession);
@@ -496,6 +486,7 @@ public class SwtArgeoApp extends AbstractArgeoApp implements CmsEventSubscriber
                SwtAppUi ui = getRelatedUi(event);
                if (ui == null)
                        return;
+               ui.updateLastAccess();
                ui.getCmsView().runAs(() -> {
                        try {
                                String appTitle = "";