import org.argeo.app.ux.SuiteUxEvent;
import org.argeo.cms.LocaleUtils;
import org.argeo.cms.Localized;
-import org.argeo.cms.acr.ContentUtils;
import org.argeo.cms.swt.CmsSwtUtils;
import org.argeo.cms.swt.acr.SwtUiProvider;
import org.argeo.cms.swt.dialogs.CmsFeedback;
pidPrefix = appPid.substring(0, lastDotIndex);
}
} else {
- // TODO doe it make sense to accept that?
+ // TODO does it make sense to accept that?
appPid = "<unknown>";
}
+ Objects.requireNonNull(contentRepository, "Content repository must be provided");
+ Objects.requireNonNull(appUserState, "App user state must be provided");
// if (pidPrefix == null)
// throw new IllegalArgumentException("PID prefix must be set.");
// leadPanePid = pidPrefix + "leadPane";
// adminLeadPanePid = pidPrefix + "adminLeadPane";
// loginScreenPid = pidPrefix + "loginScreen";
+
}
public void stop(Map<String, Object> properties) {
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;
}
try {
Content context = null;
SwtAppUi ui = (SwtAppUi) cmsUi;
+ ui.updateLastAccess();
String uiName = Objects.toString(ui.getParent().getData(UI_NAME_PROPERTY), null);
if (uiName == null)
if (cmsSession == null || cmsView.isAnonymous()) {
assert publicBasePath != null;
Content userDir = contentSession
- .get(ContentUtils.SLASH + CmsConstants.SYS_WORKSPACE + publicBasePath);
+ .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);
}
// TODO move it to an internal package?
- public static String nodeToState(Content node) {
+ private static String nodeToState(Content node) {
return node.getPath();
}
SwtAppUi ui = getRelatedUi(event);
if (ui == null)
return;
+ ui.updateLastAccess();
ui.getCmsView().runAs(() -> {
try {
String appTitle = "";